Skip to content

Commit

Permalink
fix: improve dash json sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
dy0gu committed Nov 26, 2024
1 parent d3a3000 commit e8bdcc4
Show file tree
Hide file tree
Showing 4 changed files with 378 additions and 636 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
- ${GRAFANA_PORT}:3000
volumes:
- ./grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
- ./grafana-dashboard.yaml:/etc/grafana/provisioning/dashboards/dashboard.yaml
- ./grafana-dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml
- ./grafana-metrics-dashboard.json:/var/lib/grafana/dashboards/metrics.json
- ./grafana-logs-dashboard.json:/var/lib/grafana/dashboards/logs.json
- grafana-data:/var/lib/grafana
Expand Down
2 changes: 1 addition & 1 deletion grafana-dashboard.yaml → grafana-dashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: 1

providers:
- name: "Dashboard"
- name: Dashboards
orgId: 1
type: file

Expand Down
57 changes: 41 additions & 16 deletions grafana-logs-dashboard.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
{
"__inputs": [
{
"name": "DS_LOKI",
"label": "Loki",
"description": "",
"type": "datasource",
"pluginId": "loki",
"pluginName": "Loki"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "11.3.1"
},
{
"type": "panel",
"id": "logs",
"name": "Logs",
"version": ""
},
{
"type": "datasource",
"id": "loki",
"name": "Loki",
"version": "1.0.0"
}
],
"annotations": {
"list": [
{
Expand All @@ -24,18 +55,14 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 15,
"w": 24,
Expand All @@ -54,7 +81,7 @@
{
"datasource": {
"type": "loki",
"uid": "${datasource}"
"uid": "${DS_LOKI}"
},
"expr": "{container_name=~\"$container_name.+\"}",
"refId": "A"
Expand All @@ -64,7 +91,6 @@
"type": "logs"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 40,
"tags": [
Expand All @@ -74,11 +100,11 @@
"list": [
{
"allValue": ".*",
"current": {
"text": "All",
"value": "$__all"
"current": {},
"datasource": {
"type": "loki",
"uid": "${DS_LOKI}"
},
"datasource": "${datasource}",
"includeAll": true,
"label": "Container",
"multi": true,
Expand All @@ -89,10 +115,7 @@
"type": "query"
},
{
"current": {
"text": "Loki",
"value": "P8E80F9AEF21F6940"
},
"current": {},
"label": "Datasource",
"name": "datasource",
"options": [],
Expand Down Expand Up @@ -120,5 +143,7 @@
"timepicker": {},
"timezone": "",
"title": "Logs",
"uid": "be54tqkbqhse8d",
"version": 28,
"weekStart": ""
}
}
Loading

0 comments on commit e8bdcc4

Please sign in to comment.