bundles/grafana: make rspamd row more pretty
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
This commit is contained in:
parent
2940bfd3d8
commit
c7fd6ee041
1 changed files with 7 additions and 55 deletions
|
@ -7,7 +7,7 @@ def dashboard_row_rspamd(panel_id, node):
|
||||||
'panels': [
|
'panels': [
|
||||||
{
|
{
|
||||||
'aliasColors': {},
|
'aliasColors': {},
|
||||||
'bars': False,
|
'bars': True,
|
||||||
'dashLength': 10,
|
'dashLength': 10,
|
||||||
'dashes': False,
|
'dashes': False,
|
||||||
'datasource': None,
|
'datasource': None,
|
||||||
|
@ -32,7 +32,7 @@ def dashboard_row_rspamd(panel_id, node):
|
||||||
'total': False,
|
'total': False,
|
||||||
'values': False
|
'values': False
|
||||||
},
|
},
|
||||||
'lines': True,
|
'lines': False,
|
||||||
'linewidth': 1,
|
'linewidth': 1,
|
||||||
'NonePointMode': 'None',
|
'NonePointMode': 'None',
|
||||||
'options': {
|
'options': {
|
||||||
|
@ -46,7 +46,7 @@ def dashboard_row_rspamd(panel_id, node):
|
||||||
'seriesOverrides': [],
|
'seriesOverrides': [],
|
||||||
'spaceLength': 10,
|
'spaceLength': 10,
|
||||||
'span': 6,
|
'span': 6,
|
||||||
'stack': False,
|
'stack': True,
|
||||||
'steppedLine': False,
|
'steppedLine': False,
|
||||||
'targets': [{
|
'targets': [{
|
||||||
'groupBy': [
|
'groupBy': [
|
||||||
|
@ -62,7 +62,7 @@ def dashboard_row_rspamd(panel_id, node):
|
||||||
r["host"] == "{node.name}"
|
r["host"] == "{node.name}"
|
||||||
)
|
)
|
||||||
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|
||||||
|> derivative(unit: 1s, nonNegative: true)
|
|> derivative(unit: 1m, nonNegative: true)
|
||||||
|> yield(name: "value")""",
|
|> yield(name: "value")""",
|
||||||
'resultFormat': 'time_series',
|
'resultFormat': 'time_series',
|
||||||
'select': [[
|
'select': [[
|
||||||
|
@ -170,7 +170,7 @@ def dashboard_row_rspamd(panel_id, node):
|
||||||
r["host"] == "{node.name}"
|
r["host"] == "{node.name}"
|
||||||
)
|
)
|
||||||
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|
||||||
|> derivative(unit: 1s, nonNegative: true)
|
|> derivative(unit: 1m, nonNegative: true)
|
||||||
|> yield(name: "avg")""",
|
|> yield(name: "avg")""",
|
||||||
'resultFormat': 'time_series',
|
'resultFormat': 'time_series',
|
||||||
'select': [[
|
'select': [[
|
||||||
|
@ -194,55 +194,7 @@ def dashboard_row_rspamd(panel_id, node):
|
||||||
r["host"] == "{node.name}"
|
r["host"] == "{node.name}"
|
||||||
)
|
)
|
||||||
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|
|> 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': [[
|
|
||||||
{'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)
|
|
||||||
|> yield(name: "mean")""",
|
|> yield(name: "mean")""",
|
||||||
'resultFormat': 'time_series',
|
'resultFormat': 'time_series',
|
||||||
'select': [[
|
'select': [[
|
||||||
|
@ -254,7 +206,7 @@ def dashboard_row_rspamd(panel_id, node):
|
||||||
],
|
],
|
||||||
'thresholds': [],
|
'thresholds': [],
|
||||||
'timeRegions': [],
|
'timeRegions': [],
|
||||||
'title': 'rspamd stats',
|
'title': 'rspamd scanned/learned',
|
||||||
'tooltip': {
|
'tooltip': {
|
||||||
'shared': True,
|
'shared': True,
|
||||||
'sort': 0,
|
'sort': 0,
|
||||||
|
|
Loading…
Reference in a new issue