Commit Graph

13 Commits

Author SHA1 Message Date
SuperQ
81c4933986 Update build
* Update to Go 1.18.
* Update minimum Go version to 1.17.
* Update Go modules for 1.17 format.
* Bump Go modules
* Enable dependabot.
* Update Prometheus common files.
* Fixup yamllint.

Signed-off-by: SuperQ <superq@gmail.com>
2022-05-25 11:27:42 +02:00
Corin Lawson
3fd1c2c0eb Introduce histogram support (#435)
* Introduce histogram support

Prior to this change, the custom queries were restricted to counters and
gauges.

This change introduces a new ColumnUsage, namely HISTOGRAM, that expects
the column to contain an array of upper inclusive bounds for each
observation bucket in the emitted metric.  It also expects three more
columns to be present with the suffixes:
- `_bucket`, containing an array of cumulative counters for the
  observation buckets;
- `_sum`, the total sum of all observed values; and
- `_count`, the count of events that have been observed.

A flag has been added to the MetricMap struct to easily identify metrics
that should emit a histogram and the construction of a histogram metric
is aided by the pg.Array function and a new helper dbToUint64 function.

Finally, and example of usage is given in queries.yaml.

fixes #402

Signed-off-by: Corin Lawson <corin@responsight.com>

* Introduces tests for histogram support

Prior to this change, the histogram support was untested.

This change introduces a new integration test that reads a user query
containing a number of histogram metrics.  Also, additional checks have
been added to TestBooleanConversionToValueAndString to test dbToUint64.

Signed-off-by: Corin Lawson <corin@responsight.com>
2020-12-25 02:34:26 +11:00
Alexis Sellier
ececfdeab7 Yaml parsing refactor (#299)
* Use struct instead of interface{} when parsing query user

* Use MappingOptions

* Split function to be more testable

* Rename function to parseUserQueries

* Start to add test about query parsing
2019-10-31 22:07:59 +11:00
Will Rouesnel
0d7891de1a Fix smoke-tests to more reliably use pg_isready. 2019-07-03 23:14:20 +10:00
Asher Foa
c9dc7a20a1 remove unsupported postgres versions 2019-06-15 19:38:40 +10:00
Will Rouesnel
474a600842 Add Postgresql 11 to smoke-tests. 2018-11-11 15:40:09 +11:00
Will Rouesnel
414e9b13c2 Remove -x from smoke-test. 2018-11-11 15:39:51 +11:00
Will Rouesnel
99ff02c6a9 Fix the errors introduced into smoke-test from the refactor. 2018-11-11 15:34:33 +11:00
Will Rouesnel
43072ddaa7 Improve support code quality. 2018-11-11 15:07:07 +11:00
Adam Harrison
3f905289a2 URL encode username/password fields
Fixes #188.
2018-05-23 10:42:19 +10:00
Will Rouesnel
9eff17a257 Fix the replication test. 2018-05-23 01:06:52 +10:00
Will Rouesnel
fa2c1e8f0f Fix pg_up never being set to 1 (introduced by #162).
Correct fix for #160.
2018-03-07 05:25:17 +10:00
Will Rouesnel
989489096e Refactor repository layout and convert build system to Mage.
This commit implements a massive refactor of the repository, and
moves the build system over to use Mage (magefile.org) which should
allow seamless building across multiple platforms.
2018-03-06 07:29:35 +10:00