Skip to content

Commit

Permalink
feat: renovate grafana dashboard revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
buroa committed Oct 17, 2023
1 parent 4b0649b commit d8d909a
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
color: "ffc300"
- name: renovate/terraform
color: "ffc300"
- name: renovate/grafana-dashboard
color: "ffc300"
# Semantic Type
- name: type/digest
color: "FFEC19"
Expand Down
21 changes: 21 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,29 @@
],
"datasourceTemplate": "docker",
"versioningTemplate": "redhat"
},
{
"description": "Process Grafana dashboards",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"#\\s+renovate:\\s+depName=\"(?<depName>.*)\"\\n\\s+gnetId:\\s+(?<packageName>.*?)\\n\\s+revision:\\s+(?<currentValue>.*)"
],
"customType": "regex",
"versioningTemplate": "regex:^(?<major>\\d+)$",
"datasourceTemplate": "custom.grafana-dashboards"
}
],
"customDatasources": {
"grafana-dashboards": {
"defaultRegistryUrlTemplate": "https://grafana.com/api/dashboards/{{packageName}}",
"format": "json",
"transformTemplates": [
"{\"releases\":[{\"version\": $string(revision)}]}"
]
}
},
"packageRules": [
{
"description": "Loose versioning for non-semver packages",
Expand Down
5 changes: 5 additions & 0 deletions .github/renovate/commitMessage.json5
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
{
"matchDatasources": ["docker"],
"commitMessageTopic": "image {{depName}}"
},
{
"matchDatasources": ["custom.grafana-dashboards"],
"commitMessageTopic": "dashboard {{depName}}",
"commitMessageExtra": "to v{{newVersion}}"
}
]
}
4 changes: 4 additions & 0 deletions .github/renovate/labels.json5
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
{
"matchDatasources": ["pypi"],
"addLabels": ["renovate/pip"]
},
{
"matchDatasources": ["custom.grafana-dashboards"],
"addLabels": ["renovate/grafana-dashboard"]
}
]
}
5 changes: 5 additions & 0 deletions .github/renovate/semanticCommits.json5
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@
"matchUpdateTypes": ["patch"],
"semanticCommitType": "fix",
"semanticCommitScope": "github-action"
},
{
"matchDatasources": ["custom.grafana-dashboards"],
"matchUpdateTypes": ["major"],
"commitMessagePrefix": "feat(grafana-dashboard)!: "
}
]
}
48 changes: 32 additions & 16 deletions kubernetes/apps/monitoring/grafana/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,29 +186,35 @@ spec:
dashboards:
default:
node-exporter-full:
gnetId: 1860 # https://grafana.com/grafana/dashboards/1860?tab=revisions
# renovate: depName="Node Exporter Full"
gnetId: 1860
revision: 31
datasource: Prometheus
redis:
gnetId: 763 # https://grafana.com/grafana/dashboards/763?tab=revisions
# renovate: depName="Redis Dashboard for Prometheus Redis Exporter 1.x"
gnetId: 763
revision: 5
datasource: Prometheus
external-dns:
gnetId: 15038 # https://grafana.com/grafana/dashboards/15038?tab=revisions
# renovate: depName="External-dns"
gnetId: 15038
revision: 1
datasource: Prometheus
blackbox-exporter:
gnetId: 7587 # https://grafana.com/grafana/dashboards/7587?tab=revisions
# renovate: depName="Prometheus Blackbox Exporter"
gnetId: 7587
revision: 3
datasource: Prometheus
cloudflared:
gnetId: 17457 # https://grafana.com/grafana/dashboards/17457?tab=revisions
# renovate: depName="Cloudflare Tunnels (cloudflared)"
gnetId: 17457
revision: 6
datasource:
- name: DS_PROMETHEUS
value: Prometheus
speedtest-exporter:
gnetId: 13665 # https://grafana.com/grafana/dashboards/13665?tab=revisions
# renovate: depName="Speedtest-Exporter Dashboard"
gnetId: 13665
revision: 4
datasource:
- name: DS_PROMETHEUS
Expand All @@ -224,15 +230,18 @@ spec:
datasource: Prometheus
ceph:
ceph-cluster:
gnetId: 2842 # https://grafana.com/grafana/dashboards/2842?tab=revisions
# renovate: depName="Ceph Cluster"
gnetId: 2842
revision: 17
datasource: Prometheus
ceph-osd:
gnetId: 5336 # https://grafana.com/grafana/dashboards/5336?tab=revisions
# renovate: depName="Ceph - OSD (Single)"
gnetId: 5336
revision: 9
datasource: Prometheus
ceph-pools:
gnetId: 5342 # https://grafana.com/grafana/dashboards/5342?tab=revisions
# renovate: depName="Ceph - Pools"
gnetId: 5342
revision: 9
datasource: Prometheus
flux:
Expand Down Expand Up @@ -265,7 +274,8 @@ spec:
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-pods.json
datasource: Prometheus
kubernetes-volumes:
gnetId: 11454 # https://grafana.com/grafana/dashboards/11454?tab=revisions
# renovate: depName="K8s / Storage / Volumes / Cluster"
gnetId: 11454
revision: 14
datasource: Prometheus
nginx:
Expand All @@ -277,7 +287,8 @@ spec:
datasource: Prometheus
blocky:
blocky:
gnetId: 13768 # https://grafana.com/grafana/dashboards/13768?tab=revisions
# renovate: depName="blocky"
gnetId: 13768
revision: 3
datasource:
- name: DS_PROMETHEUS
Expand Down Expand Up @@ -317,19 +328,23 @@ spec:
datasource: Prometheus
unifi:
unifi-insights:
gnetId: 11315 # https://grafana.com/grafana/dashboards/11315?tab=revisions
# renovate: depName="UniFi-Poller: Client Insights - Prometheus"
gnetId: 11315
revision: 9
datasource: Prometheus
unifi-network-sites:
gnetId: 11311 # https://grafana.com/grafana/dashboards/11311?tab=revisions
# renovate: depName="UniFi-Poller: Network Sites - Prometheus"
gnetId: 11311
revision: 5
datasource: Prometheus
unifi-uap:
gnetId: 11314 # https://grafana.com/grafana/dashboards/11314?tab=revisions
# renovate: depName="UniFi-Poller: UAP Insights - Prometheus"
gnetId: 11314
revision: 10
datasource: Prometheus
unifi-usw:
gnetId: 11312 # https://grafana.com/grafana/dashboards/11312?tab=revisions
# renovate: depName="UniFi-Poller: USW Insights - Prometheus"
gnetId: 11312
revision: 9
datasource: Prometheus
media:
Expand All @@ -345,7 +360,8 @@ spec:
- name: DS_PROMETHEUS
value: Prometheus
unpackerr:
gnetId: 18817 # https://grafana.com/grafana/dashboards/18817?tab=revisions
# renovate: depName="Unpackerr"
gnetId: 18817
revision: 1
datasource:
- name: DS_PROMETHEUS
Expand Down

0 comments on commit d8d909a

Please sign in to comment.