Skip to content

Commit

Permalink
Update: monitoring mixins set to v1.12.0 for grafana-mixin (#938)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Lamirault <nlamirault@users.noreply.github.com>
Co-authored-by: Nicolas Lamirault <nlamirault@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and nlamirault authored Nov 23, 2024
1 parent fbb1be3 commit 637f81e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
6 changes: 3 additions & 3 deletions charts/grafana-mixin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ keywords:
- grafana
- monitoring-mixin
- portefaix
version: 1.4.0
appVersion: 10.2.1
version: 1.5.0
appVersion: 11.3.1

maintainers:
- name: nlamirault
Expand All @@ -52,4 +52,4 @@ annotations:
url: https://keybase.io/nlamirault/pgp_keys.asc
artifacthub.io/changes: |
- kind: changed
description: grafana-mixin v10.2.1
description: grafana-mixin v11.3.1
3 changes: 3 additions & 0 deletions charts/grafana-mixin/templates/alerts.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.monitor.enabled -}}
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
Expand All @@ -8,6 +9,7 @@ metadata:
{{- include "grafana-mixin.annotations" . | indent 4 }}
labels:
{{- include "grafana-mixin.labels" . | indent 4 }}
app.kubernetes.io/component: metrics
{{- if .Values.monitor.additionalLabels }}
{{- toYaml .Values.monitor.additionalLabels | nindent 4 }}
{{- end }}
Expand All @@ -26,3 +28,4 @@ spec:
for: 5m
labels:
severity: warning
{{- end }}
36 changes: 31 additions & 5 deletions charts/grafana-mixin/templates/configmap-dashboards.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,50 @@
---
{{ if .Values.grafanaDashboard.enabled -}}
{{- $files := .Files.Glob "dashboards/*.json" }}
{{- if $files }}
---
apiVersion: v1
kind: ConfigMapList
items:
{{- range $path, $fileContents := $files }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" | lower }}
- apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "dashboard-grafana-mixin-%s" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ include "grafana-mixin.namespace" $ }}
annotations:
grafana-folder: {{ $.Values.grafana.folder }}
grafana-folder: {{ $.Values.grafanaDashboard.folder }}
{{- include "grafana-mixin.annotations" $ | indent 6 }}
labels:
grafana-dashboard: {{ $dashboardName }}
{{- include "grafana-mixin.labels" $ | indent 6 }}
app.kubernetes.io/component: dashboard
name: {{ printf "dashboard-%s" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ include "grafana-mixin.namespace" $ }}
data:
{{ $dashboardName }}.json: |-
{{ $.Files.Get $path | indent 6}}
{{- end }}
{{ if $.Values.grafanaDashboard.grafanaOperator.enabled -}}
{{- range $path, $fileContents := $files }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
labels:
{{- include "grafana-mixin.labels" $ | indent 4 }}
app.kubernetes.io/component: dashboard
name: {{ printf "%s" $dashboardName | trunc 63 | trimSuffix "-" | lower }}
namespace: {{ $.Release.Namespace }}
spec:
allowCrossNamespaceImport: {{ $.Values.grafanaDashboard.grafanaOperator.allowCrossNamespaceImport }}
folder: {{ $.Values.grafanaDashboard.folder }}
instanceSelector:
matchLabels:
{{- toYaml $.Values.grafanaDashboard.grafanaOperator.matchLabels | nindent 6 }}
configMapRef:
name: {{ printf "dashboard-%s" $dashboardName | trunc 63 | trimSuffix "-" }}
key: {{ $dashboardName }}.json
{{- end }}
{{- end }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/grafana-mixin/templates/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.monitor.enabled -}}
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
Expand All @@ -8,6 +9,7 @@ metadata:
{{- include "grafana-mixin.annotations" . | indent 4 }}
labels:
{{- include "grafana-mixin.labels" . | indent 4 }}
app.kubernetes.io/component: metrics
{{- if .Values.monitor.additionalLabels }}
{{- toYaml .Values.monitor.additionalLabels | nindent 4 }}
{{- end }}
Expand All @@ -18,3 +20,4 @@ spec:
- expr: |
sum by (namespace, job, handler, status_code) (rate(grafana_http_request_duration_seconds_count[5m]))
record: namespace_job_handler_statuscode:grafana_http_request_duration_seconds_count:rate5m
{{- end }}

0 comments on commit 637f81e

Please sign in to comment.