Skip to content

Instantly share code, notes, and snippets.

@monsdar
Created March 3, 2022 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monsdar/aff5d3b6fefdd741cc04cced6a82598e to your computer and use it in GitHub Desktop.
Save monsdar/aff5d3b6fefdd741cc04cced6a82598e to your computer and use it in GitHub Desktop.
{
"id": 8,
"gridPos": {
"x": 0,
"y": 7,
"w": 23,
"h": 7
},
"type": "timeseries",
"title": "Log distribution",
"targets": [
{
"refId": "A",
"datasource": {
"uid": "P8E80F9AEF21F6940",
"type": "loki"
},
"expr": "sum by (level) (count_over_time({job=~\"$service_id\"} |~ \"$query\" [$__interval]))",
"legendFormat": "{{ level }}"
}
],
"options": {
"tooltip": {
"mode": "single",
"sort": "none"
},
"legend": {
"displayMode": "list",
"placement": "bottom",
"calcs": []
}
},
"fieldConfig": {
"defaults": {
"custom": {
"drawStyle": "bars",
"lineInterpolation": "stepBefore",
"barAlignment": 0,
"lineWidth": 0,
"fillOpacity": 100,
"gradientMode": "none",
"spanNulls": false,
"showPoints": "never",
"pointSize": 5,
"stacking": {
"mode": "none",
"group": "A"
},
"axisPlacement": "auto",
"axisLabel": "",
"scaleDistribution": {
"type": "linear"
},
"hideFrom": {
"tooltip": false,
"viz": false,
"legend": false
},
"thresholdsStyle": {
"mode": "off"
}
},
"color": {
"mode": "palette-classic"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "none"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "debug"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "blue"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "error"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "red"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "info"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "green"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "warning"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "orange"
}
}
]
},
{
"matcher": {
"id": "byRegexp",
"options": "fatal"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "dark-red"
}
}
]
},
{
"matcher": {
"id": "byRegexp",
"options": "trace"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "purple"
}
}
]
}
]
},
"datasource": {
"uid": "P8E80F9AEF21F6940",
"type": "loki"
},
"maxDataPoints": 100,
"transformations": [
{
"id": "filterFieldsByName",
"options": {
"include": {
"names": [
"Time",
"debug",
"error",
"info",
"warning"
]
}
}
}
],
"interval": null,
"description": ""
}
@monsdar
Copy link
Author

monsdar commented Mar 3, 2022

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment