Skip to content

Commit

Permalink
fix(reloader): autodiscover prom metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsimonemms committed Dec 12, 2024
1 parent 7f36be2 commit 230f5ce
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 0 deletions.
4 changes: 4 additions & 0 deletions registry/components/reloader/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ spec:
helm:
valuesObject:
reloader:
podMonitor:
enabled: true
labels:
prometheus: enabled
watchGlobally: true
deployment:
resources:
Expand Down
186 changes: 186 additions & 0 deletions registry/components/reloader/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-dashboard-example
namespace: reloader
labels:
grafana_dashboard: "1"
data:
app-status.json: |-
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 176,
"links": [],
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.3.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "reloader_reload_executed_total{success=\"true\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Successful reloads",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#EAB839",
"value": 1
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.3.0",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "reloader_reload_executed_total{success=\"false\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Failed reloads",
"type": "stat"
}
],
"preload": false,
"schemaVersion": 40,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "Reloader",
"uid": "de6inpqahbg8wd",
"version": 5,
"weekStart": ""
}
1 change: 1 addition & 0 deletions registry/components/reloader/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- application.yaml
- dashboard.yaml
- namespace.yaml
2 changes: 2 additions & 0 deletions registry/components/reloader/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ apiVersion: v1
kind: Namespace
metadata:
name: reloader
labels:
prometheus: enabled
annotations:
argocd.argoproj.io/sync-wave: "-1"

0 comments on commit 230f5ce

Please sign in to comment.