Skip to content

feat: add example grafana dashboard #7987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! feat: add example grafana dashboard
  • Loading branch information
coadler committed Jun 12, 2023
commit dd68e01376ec88e2b51b3cdb89c234a4b9e3af3e
2 changes: 2 additions & 0 deletions examples/monitoring/dashboards/grafana/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Grafana Example Dashboard

![image](https://github.com/coder/coder/assets/6332295/1dd61c3c-9fa5-4ff4-87ff-6cd840f9f7d6)
88 changes: 73 additions & 15 deletions examples/monitoring/dashboards/grafana/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
},
{
"name": "VAR_FILTER_KEY",
"type": "constant",
"label": "Filter key",
"value": "app",
"description": ""
},
{
"name": "VAR_FILTER_VALUE",
"type": "constant",
"label": "Filter value",
"value": "coder",
"description": ""
}
],
"__elements": {},
Expand Down Expand Up @@ -142,7 +156,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "rate(process_cpu_seconds_total[$__rate_interval])",
"expr": "rate(process_cpu_seconds_total{$filter_key=\"$filter_value\"}[$__rate_interval])",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -207,7 +221,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "coderd_api_active_users_duration_hour",
"expr": "coderd_api_active_users_duration_hour{$filter_key=\"$filter_value\"}",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -272,7 +286,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "sum(coderd_agents_up)",
"expr": "sum(coderd_agents_up{$filter_key=\"$filter_value\"})",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -338,7 +352,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "avg(coderd_agents_connection_latencies_seconds)",
"expr": "avg(coderd_agents_connection_latencies_seconds{$filter_key=\"$filter_value\"})",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -443,7 +457,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "coderd_provisionerd_jobs_current",
"expr": "coderd_provisionerd_jobs_current{$filter_key=\"$filter_value\"}",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand All @@ -454,7 +468,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "coderd_provisionerd_num_daemons",
"expr": "coderd_provisionerd_num_daemons{$filter_key=\"$filter_value\"}",
"hide": false,
"legendFormat": "__auto",
"range": true,
Expand Down Expand Up @@ -578,7 +592,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "histogram_quantile(0.95, sum by(le) (rate(coderd_db_query_latencies_seconds_bucket[$__rate_interval])))",
"expr": "histogram_quantile(0.95, sum by(le) (rate(coderd_db_query_latencies_seconds_bucket{$filter_key=\"$filter_value\"}[$__rate_interval])))",
"hide": false,
"legendFormat": "__auto",
"range": true,
Expand All @@ -590,7 +604,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "sum(rate(coderd_db_query_latencies_seconds_count[$__rate_interval]))",
"expr": "sum(rate(coderd_db_query_latencies_seconds_count{$filter_key=\"$filter_value\"}[$__rate_interval]))",
"hide": false,
"legendFormat": "__auto",
"range": true,
Expand Down Expand Up @@ -716,7 +730,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "go_memstats_alloc_bytes",
"expr": "go_memstats_alloc_bytes{$filter_key=\"$filter_value\"}",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand All @@ -728,7 +742,7 @@
},
"editorMode": "builder",
"exemplar": false,
"expr": "go_goroutines",
"expr": "go_goroutines{$filter_key=\"$filter_value\"}",
"hide": false,
"legendFormat": "__auto",
"range": true,
Expand All @@ -751,6 +765,7 @@
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
Expand Down Expand Up @@ -861,7 +876,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "sum by(job) (rate(coderd_api_requests_processed_total[$__rate_interval]))",
"expr": "sum by(job) (rate(coderd_api_requests_processed_total{$filter_key=\"$filter_value\"}[$__rate_interval]))",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -895,21 +910,64 @@
"type": "timeseries"
}
],
"refresh": "",
"refresh": "10s",
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": []
"list": [
{
"description": "The key to use for filtering metrics",
"hide": 2,
"label": "Filter key",
"name": "filter_key",
"query": "${VAR_FILTER_KEY}",
"skipUrlSync": false,
"type": "constant",
"current": {
"value": "${VAR_FILTER_KEY}",
"text": "${VAR_FILTER_KEY}",
"selected": false
},
"options": [
{
"value": "${VAR_FILTER_KEY}",
"text": "${VAR_FILTER_KEY}",
"selected": false
}
]
},
{
"description": "The value to use for filtering metrics",
"hide": 2,
"label": "Filter value",
"name": "filter_value",
"query": "${VAR_FILTER_VALUE}",
"skipUrlSync": false,
"type": "constant",
"current": {
"value": "${VAR_FILTER_VALUE}",
"text": "${VAR_FILTER_VALUE}",
"selected": false
},
"options": [
{
"value": "${VAR_FILTER_VALUE}",
"text": "${VAR_FILTER_VALUE}",
"selected": false
}
]
}
]
},
"time": {
"from": "now-6h",
"from": "now-30m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Coder Dashboard",
"uid": "cb63c6ac-e392-42a9-a966-ee642b9c997c",
"version": 7,
"version": 9,
"weekStart": ""
}