bundles/grafana: make rspamd row more pretty
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit

This commit is contained in:
Franzi 2021-08-25 15:15:09 +02:00
parent 2940bfd3d8
commit c7fd6ee041
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -7,7 +7,7 @@ def dashboard_row_rspamd(panel_id, node):
'panels': [
{
'aliasColors': {},
'bars': False,
'bars': True,
'dashLength': 10,
'dashes': False,
'datasource': None,
@ -32,7 +32,7 @@ def dashboard_row_rspamd(panel_id, node):
'total': False,
'values': False
},
'lines': True,
'lines': False,
'linewidth': 1,
'NonePointMode': 'None',
'options': {
@ -46,7 +46,7 @@ def dashboard_row_rspamd(panel_id, node):
'seriesOverrides': [],
'spaceLength': 10,
'span': 6,
'stack': False,
'stack': True,
'steppedLine': False,
'targets': [{
'groupBy': [
@ -62,7 +62,7 @@ def dashboard_row_rspamd(panel_id, node):
r["host"] == "{node.name}"
)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> derivative(unit: 1s, nonNegative: true)
|> derivative(unit: 1m, nonNegative: true)
|> yield(name: "value")""",
'resultFormat': 'time_series',
'select': [[
@ -170,7 +170,7 @@ def dashboard_row_rspamd(panel_id, node):
r["host"] == "{node.name}"
)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> derivative(unit: 1s, nonNegative: true)
|> derivative(unit: 1m, nonNegative: true)
|> yield(name: "avg")""",
'resultFormat': 'time_series',
'select': [[
@ -194,55 +194,7 @@ def dashboard_row_rspamd(panel_id, node):
r["host"] == "{node.name}"
)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> derivative(unit: 1s, nonNegative: true)
|> yield(name: "mean")""",
'resultFormat': 'time_series',
'select': [[
{'type': 'field', 'params': ['value']},
{'type': 'mean', 'params': []},
]],
"tags": []
},
{
'groupBy': [
{'type': 'time', 'params': ['$__interval']},
{'type': 'fill', 'params': ['linear']},
],
'orderByTime': "ASC",
'policy': "default",
'query': f"""from(bucket: "telegraf")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r["_measurement"] == "rspamd_stats" and
r["_field"] == "spam_count" and
r["host"] == "{node.name}"
)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> derivative(unit: 1s, nonNegative: true)
|> yield(name: "mean")""",
'resultFormat': 'time_series',
'select': [[
{'type': 'field', 'params': ['value']},
{'type': 'mean', 'params': []},
]],
"tags": []
},
{
'groupBy': [
{'type': 'time', 'params': ['$__interval']},
{'type': 'fill', 'params': ['linear']},
],
'orderByTime': "ASC",
'policy': "default",
'query': f"""from(bucket: "telegraf")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r["_measurement"] == "rspamd_stats" and
r["_field"] == "ham_count" and
r["host"] == "{node.name}"
)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> derivative(unit: 1s, nonNegative: true)
|> derivative(unit: 1m, nonNegative: true)
|> yield(name: "mean")""",
'resultFormat': 'time_series',
'select': [[
@ -254,7 +206,7 @@ def dashboard_row_rspamd(panel_id, node):
],
'thresholds': [],
'timeRegions': [],
'title': 'rspamd stats',
'title': 'rspamd scanned/learned',
'tooltip': {
'shared': True,
'sort': 0,