add annotation to VictoriaLogs dashboards - restarts and version change (#5008)

Signed-off-by: Artem Navoiev <tenmozes@gmail.com>
This commit is contained in:
Artem Navoiev 2023-09-15 06:12:23 -07:00 committed by GitHub
parent d5f9619984
commit f04eb762c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,13 +18,37 @@
"type": "dashboard" "type": "dashboard"
}, },
"type": "dashboard" "type": "dashboard"
},
{
"datasource": {
"type": "prometheus",
"uid": "${ds}"
},
"enable": true,
"expr": "sum(vm_app_version{job=~\"$job\", instance=~\"$instance\"}) by(short_version) unless (sum(vm_app_version{job=~\"$job\", instance=~\"$instance\"} offset 20m) by(short_version))",
"hide": true,
"iconColor": "blue",
"name": "version change",
"textFormat": "{{short_version}}",
"titleFormat": "Version change"
},
{
"datasource": {
"type": "prometheus",
"uid": "${ds}"
},
"enable": true,
"expr": "sum(changes(vm_app_start_timestamp{job=~\"$job\", instance=~\"$instance\"})) by(job)",
"hide": true,
"iconColor": "orange",
"name": "restarts",
"textFormat": "{{job}} restarted"
} }
] ]
}, },
"editable": true, "editable": true,
"fiscalYearStartMonth": 0, "fiscalYearStartMonth": 0,
"graphTooltip": 0, "graphTooltip": 0,
"id": 4,
"links": [], "links": [],
"liveNow": false, "liveNow": false,
"panels": [ "panels": [
@ -2077,8 +2101,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green"
"value": null
}, },
{ {
"color": "red", "color": "red",
@ -2182,8 +2205,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green"
"value": null
}, },
{ {
"color": "red", "color": "red",
@ -2318,8 +2340,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green"
"value": null
}, },
{ {
"color": "red", "color": "red",
@ -2425,8 +2446,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green"
"value": null
}, },
{ {
"color": "red", "color": "red",
@ -2561,6 +2581,10 @@
"type": "query" "type": "query"
}, },
{ {
"datasource": {
"type": "prometheus",
"uid": "$ds"
},
"filters": [], "filters": [],
"hide": 0, "hide": 0,
"name": "adhoc", "name": "adhoc",
@ -2577,6 +2601,6 @@
"timezone": "", "timezone": "",
"title": "VictoriaLogs", "title": "VictoriaLogs",
"uid": "OqPIZTX4z", "uid": "OqPIZTX4z",
"version": 7, "version": 3,
"weekStart": "" "weekStart": ""
} }