Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: tidy up grafana example dashboard #8056

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 1 commit into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 4 additions & 5 deletions coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ import (
"tailscale.com/types/key"
"tailscale.com/util/singleflight"

"cdr.dev/slog"

"github.com/coder/coder/buildinfo"
"github.com/coder/coder/codersdk/agentsdk"

// Used for swagger docs.
_ "github.com/coder/coder/coderd/apidoc"

"cdr.dev/slog"
"github.com/coder/coder/buildinfo"
"github.com/coder/coder/coderd/audit"
"github.com/coder/coder/coderd/awsidentity"
"github.com/coder/coder/coderd/database"
Expand All @@ -64,6 +62,7 @@ import (
"github.com/coder/coder/coderd/workspaceapps"
"github.com/coder/coder/coderd/wsconncache"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/codersdk/agentsdk"
"github.com/coder/coder/provisionerd/proto"
"github.com/coder/coder/provisionersdk"
"github.com/coder/coder/site"
Expand Down
2 changes: 1 addition & 1 deletion examples/monitoring/dashboards/grafana/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Grafana Example Dashboard

![image](https://github.com/coder/coder/assets/6332295/1dd61c3c-9fa5-4ff4-87ff-6cd840f9f7d6)
![image](https://github.com/coder/coder/assets/6332295/00135fb6-5678-42c2-8679-a20f345ff197)

Download `dashboard.json` and import it into your Grafana instance. It has two
filter variables which can be used to select the label you set for your Coder
Expand Down
78 changes: 58 additions & 20 deletions examples/monitoring/dashboards/grafana/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,24 @@
]
}
},
"overrides": []
"overrides": [
{
"matcher": {
"id": "byRegexp",
"options": "/.*/"
},
"properties": [
{
"id": "displayName",
"value": "CPU seconds"
},
{
"id": "unit",
"value": "s"
}
]
}
]
},
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -413,15 +430,27 @@
"overrides": [
{
"matcher": {
"id": "byName",
"options": "{__name__=\"coderd_provisionerd_num_daemons\", app=\"coderd\", instance=\"coder:2112\", job=\"coderd\"}"
"id": "byRegexp",
"options": "/coderd_provisionerd_num_daemons/"
},
"properties": [
{
"id": "displayName",
"value": "Running provisioners"
}
]
},
{
"matcher": {
"id": "byRegexp",
"options": "/coderd_provisionerd_jobs_current/"
},
"properties": [
{
"id": "displayName",
"value": "Running jobs"
}
]
}
]
},
Expand Down Expand Up @@ -531,8 +560,8 @@
"overrides": [
{
"matcher": {
"id": "byName",
"options": "sum(rate(coderd_db_query_latencies_seconds_count[1m0s]))"
"id": "byRegexp",
"options": "/.*coderd_db_query_latencies_seconds_count.*/"
},
"properties": [
{
Expand All @@ -547,13 +576,13 @@
},
{
"matcher": {
"id": "byName",
"options": "histogram_quantile(0.95, sum by(le) (rate(coderd_db_query_latencies_seconds_bucket[1m0s])))"
"id": "byRegexp",
"options": "/.*coderd_db_query_latencies_seconds_bucket.*/"
},
"properties": [
{
"id": "displayName",
"value": "P95 latency"
"value": "P95 query latency"
}
]
}
Expand Down Expand Up @@ -666,8 +695,8 @@
"overrides": [
{
"matcher": {
"id": "byName",
"options": "{__name__=\"go_memstats_alloc_bytes\", app=\"coderd\", instance=\"coder:2112\", job=\"coderd\"}"
"id": "byRegexp",
"options": "/go_memstats_alloc_bytes/"
},
"properties": [
{
Expand All @@ -686,8 +715,8 @@
},
{
"matcher": {
"id": "byName",
"options": "{__name__=\"go_goroutines\", app=\"coderd\", instance=\"coder:2112\", job=\"coderd\"}"
"id": "byRegexp",
"options": "/go_goroutines/"
},
"properties": [
{
Expand Down Expand Up @@ -804,32 +833,40 @@
"overrides": [
{
"matcher": {
"id": "byName",
"options": "sum(rate(coderd_api_requests_processed_total{code=\"500\"}[1m0s]))"
"id": "byRegexp",
"options": "/coderd_api_requests_processed_total{code=\"500\"}/"
},
"properties": [
{
"id": "displayName",
"value": "Error rate"
},
{
"id": "unit",
"value": "reqps"
}
]
},
{
"matcher": {
"id": "byName",
"options": "coderd"
"id": "byRegexp",
"options": "/coderd_api_requests_processed_total/"
},
"properties": [
{
"id": "displayName",
"value": "Request rate"
},
{
"id": "unit",
"value": "reqps"
}
]
},
{
"matcher": {
"id": "byName",
"options": "histogram_quantile(0.95, sum by(le) (rate(coderd_api_request_latencies_seconds_bucket[1m0s])))"
"id": "byRegexp",
"options": "/coderd_api_request_latencies_seconds_bucket/"
},
"properties": [
{
Expand Down Expand Up @@ -870,7 +907,8 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "builder",
"expr": "sum by(job) (rate(coderd_api_requests_processed_total{$filter_key=\"$filter_value\"}[$__rate_interval]))",
"expr": "sum(rate(coderd_api_requests_processed_total{$filter_key=\"$filter_value\"}[$__rate_interval]))",
"interval": "",
"legendFormat": "__auto",
"range": true,
"refId": "A"
Expand Down Expand Up @@ -962,6 +1000,6 @@
"timezone": "",
"title": "Coder Dashboard",
"uid": "cb63c6ac-e392-42a9-a966-ee642b9c997c",
"version": 9,
"version": 10,
"weekStart": ""
}