-
Notifications
You must be signed in to change notification settings - Fork 20
/
exporter.cfg
53 lines (50 loc) · 2.24 KB
/
exporter.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# This section defines default settings for how queries should be run.
# All settings can be overridden for any given query in its own section.
# The values shown in this example are also the fallback values used if
# a setting is not specified in the DEFAULT section or a query's section.
[DEFAULT]
# How often to run queries.
QueryIntervalSecs = 15
# What to do if a query throws an error. One of:
# * preserve - keep the metrics/values from the last successful run.
# * drop - remove metrics previously produced by the query.
# * zero - keep metrics previously produced by the query, but reset their values to 0.
QueryOnError = drop
# What to do if a metric produced by the previous run of a query is not present
# in the current run. One of:
# * preserve - keep the value of the metric from the last run it was present in.
# * drop - remove the metric.
# * zero - keep the metric, but reset its value to 0.
QueryOnMissing = drop
# Queries are defined in sections beginning with 'query_'.
# Characters following this prefix will be used as a prefix for all metrics
# generated for this query
[query_test1]
# Settings that are not specified are inherited from the DEFAULT section.
# The database to run the query on.
QueryDatabase = test
# The SQL SELECT statement to run.
QueryStatement = SELECT bar, baz, count(*) as ni, max(ekki) as ptang FROM foo GROUP BY bar, baz;
# A list of result columns to be be exported as metrics. They must be numeric.
# Any result columns not listed will be used as metric labels instead.
QueryValueColumns = ni,ptang
[query_test2]
# The DEFAULT settings can be overridden.
QueryIntervalSecs = 5
QueryOnError = preserve
QueryOnMissing = zero
QueryDatabase = test
QueryStatement = SELECT bar, count(*) as baz FROM foo GROUP BY bar;
QueryValueColumns = baz
[query_test3]
# Run the query at specific times defined using a cron-like format.
# See https://pypi.org/project/croniter/ for format details.
# If QueryCron is set QueryIntervalSecs is ignored.
# This example is 00:03 every night.
QueryCron = 3 0 * * *
# The timezone to use when calcuating cron query run times.
# Defaults to UTC if not specified.
QueryCronTimezone = Pacific/Auckland
QueryDatabase = test
QueryStatement = SELECT bar, count(*) as baz FROM foo GROUP BY bar;
QueryValueColumns = baz