Skip to content

Instantly share code, notes, and snippets.

@rootsongjc
Created April 17, 2025 07:38
Show Gist options
  • Select an option

  • Save rootsongjc/539b9fd1cf3006e3e1b0af90c844f155 to your computer and use it in GitHub Desktop.

Select an option

Save rootsongjc/539b9fd1cf3006e3e1b0af90c844f155 to your computer and use it in GitHub Desktop.
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"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"
}
]
},
"description": "Logs collected from Envoy Gateway, stored in Loki",
"editable": true,
"fiscalYearStartMonth": 0,
"gnetId": null,
"graphTooltip": 0,
"id": null,
"links": [],
"refresh": "30s",
"schemaVersion": 39,
"tags": [],
"templating": {
"list": [
{
"type": "textbox",
"name": "query",
"label": "Search Query",
"hide": 0,
"description": "Regex to filter log line body",
"current": { "selected": false, "text": "", "value": "" },
"options": [{ "selected": true, "text": "", "value": "" }],
"skipUrlSync": false
},
{
"type": "query",
"name": "namespace",
"label": "Namespace",
"datasource": { "type": "loki", "uid": "loki" },
"query": "label_values(k8s_namespace_name)",
"definition": "label_values(k8s_namespace_name)",
"refresh": 1,
"includeAll": true,
"multi": true,
"allValue": ".+",
"current": { "selected": false, "text": "All", "value": "$__all" },
"options": [],
"hide": 0,
"skipUrlSync": false,
"sort": 0,
"regex": ""
},
{
"type": "query",
"name": "pod",
"label": "Pod",
"datasource": { "type": "loki", "uid": "loki" },
"query": "label_values(k8s_pod_name)",
"definition": "label_values(k8s_pod_name)",
"refresh": 1,
"includeAll": true,
"multi": true,
"allValue": ".+",
"current": { "selected": false, "text": "All", "value": "$__all" },
"options": [],
"hide": 0,
"skipUrlSync": false,
"sort": 0,
"regex": ""
}
]
},
"time": { "from": "now-6h", "to": "now" },
"timepicker": {},
"timezone": "",
"title": "Envoy Gateway Logs",
"uid": null,
"version": 1,
"panels": [
{
"id": 4,
"type": "timeseries",
"title": "Log Volume (count/min)",
"datasource": { "type": "loki", "uid": "loki" },
"gridPos": { "h": 4, "w": 24, "x": 0, "y": 0 },
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"drawStyle": "lines",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": { "legend": false, "tooltip": false, "viz": false },
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": { "type": "linear" },
"showPoints": "auto",
"spanNulls": false,
"stacking": { "group": "A", "mode": "none" },
"thresholdsStyle": { "mode": "off" }
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null },
{ "color": "red", "value": 80 }
]
}
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": false,
"calcs": []
},
"tooltip": { "mode": "single", "sort": "none", "show": true }
},
"targets": [
{
"refId": "A",
"expr": "sum(count_over_time({exporter=\"OTLP\",k8s_namespace_name=~\"$namespace\",k8s_pod_name=~\"$pod\"} |~\"$query\"[$__interval]))",
"legendFormat": "Log count"
}
]
},
{
"id": 2,
"type": "logs",
"title": "Envoy Access Logs (Loki)",
"datasource": { "type": "loki", "uid": "loki" },
"gridPos": { "h": 25, "w": 24, "x": 0, "y": 4 },
"options": {
"dedupStrategy": "none",
"enableLogDetails": true,
"prettifyLogMessage": false,
"showCommonLabels": false,
"showLabels": false,
"showTime": false,
"sortOrder": "Descending",
"wrapLogMessage": false
},
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": {
"hideFrom": { "legend": false, "tooltip": false, "viz": false }
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null },
{ "color": "red", "value": 80 }
]
}
},
"overrides": []
},
"targets": [
{
"refId": "A",
"expr": "{exporter=\"OTLP\",k8s_namespace_name=~\"$namespace\",k8s_pod_name=~\"$pod\"} |~\"$query\""
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment