Skip to content
Snippets Groups Projects

L2SS-1054: add loki datasource

Merged L2SS-1054: add loki datasource
All threads resolved!
Merged Stefano Di Frischia requested to merge L2SS-1054-loki-dashboard into main
All threads resolved!
2 files
+ 331
0
Compare changes
  • Side-by-side
  • Inline

Files

+ 286
0
 
{
 
"annotations": {
 
"list": [
 
{
 
"builtIn": 1,
 
"datasource": {
 
"type": "grafana",
 
"uid": "-- Grafana --"
 
},
 
"enable": true,
 
"hide": true,
 
"iconColor": "rgba(0, 211, 255, 1)",
 
"name": "Annotations & Alerts",
 
"target": {
 
"limit": 100,
 
"matchAny": false,
 
"tags": [],
 
"type": "dashboard"
 
},
 
"type": "dashboard"
 
}
 
]
 
},
 
"editable": true,
 
"fiscalYearStartMonth": 0,
 
"graphTooltip": 0,
 
"id": null,
 
"links": [],
 
"liveNow": false,
 
"panels": [
 
{
 
"datasource": {
 
"type": "loki",
 
"uid": "loki"
 
},
 
"fieldConfig": {
 
"defaults": {
 
"color": {
 
"mode": "palette-classic"
 
},
 
"custom": {
 
"axisCenteredZero": false,
 
"axisColorMode": "text",
 
"axisLabel": "",
 
"axisPlacement": "auto",
 
"fillOpacity": 80,
 
"gradientMode": "none",
 
"hideFrom": {
 
"legend": false,
 
"tooltip": false,
 
"viz": false
 
},
 
"lineWidth": 1,
 
"scaleDistribution": {
 
"type": "linear"
 
},
 
"thresholdsStyle": {
 
"mode": "off"
 
}
 
},
 
"mappings": [],
 
"thresholds": {
 
"mode": "absolute",
 
"steps": [
 
{
 
"color": "green",
 
"value": null
 
},
 
{
 
"color": "red",
 
"value": 80
 
}
 
]
 
}
 
},
 
"overrides": [
 
{
 
"matcher": {
 
"id": "byName",
 
"options": "DEBUG"
 
},
 
"properties": [
 
{
 
"id": "color",
 
"value": {
 
"fixedColor": "blue",
 
"mode": "fixed"
 
}
 
}
 
]
 
},
 
{
 
"matcher": {
 
"id": "byName",
 
"options": "ERROR"
 
},
 
"properties": [
 
{
 
"id": "color",
 
"value": {
 
"fixedColor": "red",
 
"mode": "fixed"
 
}
 
}
 
]
 
},
 
{
 
"matcher": {
 
"id": "byName",
 
"options": "INFO"
 
},
 
"properties": [
 
{
 
"id": "color",
 
"value": {
 
"fixedColor": "green",
 
"mode": "fixed"
 
}
 
}
 
]
 
},
 
{
 
"matcher": {
 
"id": "byName",
 
"options": "WARNING"
 
},
 
"properties": [
 
{
 
"id": "color",
 
"value": {
 
"fixedColor": "yellow",
 
"mode": "fixed"
 
}
 
}
 
]
 
}
 
]
 
},
 
"gridPos": {
 
"h": 9,
 
"w": 24,
 
"x": 0,
 
"y": 0
 
},
 
"id": 3,
 
"options": {
 
"barRadius": 0,
 
"barWidth": 0.5,
 
"groupWidth": 0.7,
 
"legend": {
 
"calcs": [],
 
"displayMode": "list",
 
"placement": "bottom",
 
"showLegend": false
 
},
 
"orientation": "auto",
 
"showValue": "never",
 
"stacking": "normal",
 
"tooltip": {
 
"mode": "single",
 
"sort": "none"
 
},
 
"xTickLabelRotation": 0,
 
"xTickLabelSpacing": 0
 
},
 
"pluginVersion": "9.3.0-beta1",
 
"targets": [
 
{
 
"datasource": {
 
"type": "loki",
 
"uid": "loki"
 
},
 
"editorMode": "code",
 
"expr": "rate({program=\"/home/tango/.local/bin/l2ss-$device\"} [$__interval])",
 
"hide": false,
 
"legendFormat": "{{level}}",
 
"queryType": "range",
 
"refId": "A",
 
"resolution": 1
 
}
 
],
 
"title": "Log Volume",
 
"type": "barchart"
 
},
 
{
 
"datasource": {
 
"type": "loki",
 
"uid": "loki"
 
},
 
"gridPos": {
 
"h": 9,
 
"w": 24,
 
"x": 0,
 
"y": 9
 
},
 
"id": 1,
 
"options": {
 
"dedupStrategy": "none",
 
"enableLogDetails": true,
 
"prettifyLogMessage": false,
 
"showCommonLabels": false,
 
"showLabels": false,
 
"showTime": true,
 
"sortOrder": "Descending",
 
"wrapLogMessage": false
 
},
 
"targets": [
 
{
 
"datasource": {
 
"type": "loki",
 
"uid": "loki"
 
},
 
"editorMode": "code",
 
"expr": "{program=\"/home/tango/.local/bin/l2ss-$device\"} |= `` | logfmt",
 
"key": "Q-9ba51526-d461-4190-a861-0ca3403910d3-0",
 
"queryType": "range",
 
"refId": "A"
 
}
 
],
 
"title": "Device Log",
 
"transformations": [
 
{
 
"id": "filterFieldsByName",
 
"options": {}
 
}
 
],
 
"type": "logs"
 
}
 
],
 
"refresh": "",
 
"schemaVersion": 37,
 
"style": "dark",
 
"tags": [],
 
"templating": {
 
"list": [
 
{
 
"current": {},
 
"definition": "scrape_series_added",
 
"hide": 0,
 
"includeAll": false,
 
"label": "Station",
 
"multi": false,
 
"name": "station",
 
"options": [],
 
"query": {
 
"query": "scrape_series_added",
 
"refId": "StandardVariableQuery"
 
},
 
"refresh": 1,
 
"regex": "/.*host=\"(?<text>[^\"]*)\".*/",
 
"skipUrlSync": false,
 
"sort": 1,
 
"type": "query"
 
},
 
{
 
"current": {},
 
"definition": "device_scraping{host=\"$station\", device=~\"stat/.*/1\"}",
 
"hide": 0,
 
"includeAll": false,
 
"label": "Device",
 
"multi": false,
 
"name": "device",
 
"options": [],
 
"query": {
 
"query": "device_scraping{host=\"$station\", device=~\"stat/.*/1\"}",
 
"refId": "StandardVariableQuery"
 
},
 
"refresh": 1,
 
"regex": "/.*device=\"stat/(?<text>[^\"]*)/1\".*/",
 
"skipUrlSync": false,
 
"sort": 1,
 
"type": "query"
 
}
 
]
 
},
 
"time": {
 
"from": "now-1h",
 
"to": "now"
 
},
 
"timepicker": {},
 
"timezone": "",
 
"title": "Logs",
 
"uid": "Hqo-qIO4z",
 
"version": 15,
 
"weekStart": ""
 
}
Loading