Skip to content

Commit

Permalink
ci(renovate): Add grafana dashboards
Browse files Browse the repository at this point in the history
  • Loading branch information
szinn committed Mar 22, 2024
1 parent e6c7ef5 commit c4c49f3
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
color: "ffc300"
- name: renovate/github-release
color: "ffc300"
- name: renovate/grafana-dashboard
color: "ffc300"
- name: renovate/helm
color: "ffc300"
- name: renovate/terraform
Expand Down
1 change: 1 addition & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"github>szinn/k8s-homelab//.github/renovate/customManagers.json5",
"github>szinn/k8s-homelab//.github/renovate/disabledDatasources.json5",
"github>szinn/k8s-homelab//.github/renovate/groups.json5",
"github>szinn/k8s-homelab//.github/renovate/grafanaDashboards.json5",
"github>szinn/k8s-homelab//.github/renovate/packageRules.json5"
],
"ignorePaths": [
Expand Down
47 changes: 47 additions & 0 deletions .github/renovate/grafanaDashboards.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customDatasources": {
"grafana-dashboards": {
"defaultRegistryUrlTemplate": "https://grafana.com/api/dashboards/{{packageName}}",
"format": "json",
"transformTemplates": [
"{\"releases\":[{\"version\": $string(revision)}]}"
]
}
},
"customManagers": [
{
"customType": "regex",
"description": ["Process Grafana dashboards"],
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(?:\\.j2)?$"
],
"matchStrings": [
"depName=\"(?<depName>.*)\"\\n(?<indentation>\\s+)gnetId: (?<packageName>\\d+)\\n.+revision: (?<currentValue>\\d+)"
],
"autoReplaceStringTemplate": "depName=\"{{{depName}}}\"\n{{{indentation}}}gnetId: {{{packageName}}}\n{{{indentation}}}revision: {{{newValue}}}",
"datasourceTemplate": "custom.grafana-dashboards",
"versioningTemplate": "regex:^(?<major>\\d+)$"
}
],
"packageRules": [
{
"addLabels": ["renovate/grafana-dashboard"],
"matchDatasources": ["custom.grafana-dashboards"],
"matchUpdateTypes": ["major"],
"semanticCommitType": "chore",
"semanticCommitScope": "grafana-dashboards",
"commitMessageTopic": "dashboard {{depName}}",
"commitMessageExtra": "( {{currentVersion}} → {{newVersion}} )"
},
{
"description": "Grafana Dashboard Update",
"groupName": "grafana-dashboard",
"matchDatasources": ["custom.grafana-dashboards"],
"group": {
"commitMessageTopic": "{{{groupName}}} group"
},
"separateMinorPatch": true
}
]
}
15 changes: 11 additions & 4 deletions kubernetes/main/apps/monitoring/grafana/app/helm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,12 @@ spec:
url: https://raw.githubusercontent.com/dragonflydb/dragonfly/main/tools/local/monitoring/grafana/provisioning/dashboards/dashboard.json
datasource: Prometheus
redis:
# renovate: depName="Redis Exporter Quickstart and Dashboard"
gnetId: 14091
revision: 1
datasource: Prometheus
redis-sentinel:
# renovate: depName="Redis"
gnetId: 12776
revision: 2
datasource: Redis
Expand Down Expand Up @@ -416,6 +418,7 @@ spec:
datasource: Prometheus
loki:
loki-metrics:
# renovate: depName="Loki2.0 Global Metrics"
gnetId: 13407
revision: 1
datasource: Prometheus
Expand All @@ -424,6 +427,7 @@ spec:
url: https://raw.githubusercontent.com/monitoring-mixins/website/master/assets/cert-manager/dashboards/cert-manager.json
datasource: Prometheus
speedtest-exporter-hub:
# renovate: depName="Speedtest-Exporter Dashboard"
gnetId: 13665
revision: 4
datasource:
Expand All @@ -433,12 +437,14 @@ spec:
url: https://grafana.com/api/dashboards/11074/revisions/9/download
datasource: Prometheus
cloudflared:
# renovate: depName="Cloudflare Tunnels (cloudflared)"
gnetId: 17457 # https://grafana.com/grafana/dashboards/17457?tab=revisions
revision: 6
datasource:
- name: DS_PROMETHEUS
value: Prometheus
node-exporter-full:
# renovate: depName="Node Exporter Full"
gnetId: 1860
revision: 30
datasource: Prometheus
Expand All @@ -461,6 +467,7 @@ spec:
datasource: Prometheus
# Ref: https://grafana.com/grafana/dashboards/7845
zfs:
# renovate: depName="ZFS"
gnetId: 7845
revision: 4
datasource: Prometheus
Expand Down Expand Up @@ -548,23 +555,23 @@ spec:
url: https://raw.githubusercontent.com/monitoring-mixins/website/master/assets/thanos/dashboards/store.json
datasource: Prometheus
unifi:
# Ref: https://grafana.com/grafana/dashboards/11315
unifi-client-insights:
# renovate: depName="UniFi-Poller: Client Insights - Prometheus"
gnetId: 11315
revision: 9
datasource: Prometheus
# Ref: https://grafana.com/grafana/dashboards/11311
unifi-network-sites:
# renovate: depName="UniFi-Poller: Network Sites - Prometheus"
gnetId: 11311
revision: 5
datasource: Prometheus
# Ref: https://grafana.com/grafana/dashboards/11314
unifi-uap-insights:
# renovate: depName="UniFi-Poller: UAP Insights - Prometheus"
gnetId: 11314
revision: 10
datasource: Prometheus
# Ref: https://grafana.com/grafana/dashboards/11312
unifi-usw-insights:
# renovate: depName="UniFi-Poller: USW Insights - Prometheus"
gnetId: 11312
revision: 9
datasource: Prometheus

0 comments on commit c4c49f3

Please sign in to comment.