bundles/postfix: rework exporter for better usability

This commit is contained in:
Franzi 2021-05-02 12:06:53 +02:00
parent 9b9465502a
commit ae0bb8ed58
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 2 additions and 4 deletions

View file

@ -19,11 +19,9 @@ def dashboard_row_postfix(panel_id, node):
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r["_measurement"] == "postfix_queue" and
r["_field"] == "count" and
r["status"] == "{measurement}" and
r["_field"] == "{measurement}" and
r["host"] == "{node.name}"
)
|> rename(columns: {{_field: "{measurement}"}})
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "{measurement}")""",
'resultFormat': 'time_series',

View file

@ -14,4 +14,4 @@ for line in queue_json.splitlines():
queue_counts[j['queue_name']] += 1
for queue in ('incoming', 'active', 'deferred', 'corrupt', 'hold'):
print('postfix_queue,status={} count={}i'.format(queue, queue_counts.get(queue, 0)))
print('postfix_queue {}={}i'.format(queue, queue_counts.get(queue, 0)))