Skip to content

Commit

Permalink
feat(tempo): Enable Grafana Operator (#740)
Browse files Browse the repository at this point in the history
* feat(tempo): Enable Grafana Operator

Signed-off-by: Nicolas Lamirault <[email protected]>

* feat(tempo): documentation

Signed-off-by: Nicolas Lamirault <[email protected]>

---------

Signed-off-by: Nicolas Lamirault <[email protected]>
  • Loading branch information
nlamirault authored May 17, 2024
1 parent 81577d3 commit e96805b
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 54 deletions.
8 changes: 3 additions & 5 deletions charts/tempo-mixin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ keywords:
- tempo
- monitoring-mixin
- portefaix
version: 1.6.0
version: 1.7.0
appVersion: 2.3.1

maintainers:
Expand All @@ -51,7 +51,5 @@ annotations:
fingerprint: C39918B3EBDE35C23B8D0B8E5F99269A6FCA437C
url: https://keybase.io/nlamirault/pgp_keys.asc
artifacthub.io/changes: |
- kind: fixed
description: YAML indentation when additionalLabels are defined
- kind: changed
description: tempo-mixin v2.3.1
- kind: added
description: Grafana Operator support
35 changes: 19 additions & 16 deletions charts/tempo-mixin/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
# tempo-mixin

![Version: 1.3.0](https://img.shields.io/badge/Version-1.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.0](https://img.shields.io/badge/AppVersion-2.0.0-informational?style=flat-square)
![Version: 1.7.0](https://img.shields.io/badge/Version-1.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.3.1](https://img.shields.io/badge/AppVersion-2.3.1-informational?style=flat-square)

A Helm chart for Grafana Tempo mixin

**Homepage:** <https://charts.portefaix.xyz>

## Maintainers

| Name | Email | Url |
| ---------- | ----------------------------- | --- |
| nlamirault | <[email protected]> | |
| Name | Email | Url |
| ---- | ------ | --- |
| nlamirault | <[email protected]> | |

## Source Code

- <https://github.com/nlamirault/portefaix-hub/tree/master/charts/tempo-mixin>
* <https://github.com/portefaix/portefaix-hub/tree/master/charts/tempo-mixin>

## Values

| Key | Type | Default | Description |
| ------------------------ | ------ | ----------- | ------------------------------------------------------------------------ |
| additionalAnnotations | object | `{}` | Additional annotations to add to all resources |
| additionalLabels | object | `{}` | Additional labels to add to all resources |
| fullnameOverride | string | `""` | Provide a name to substitute for the full names of resources |
| grafana.folder | string | `"tracing"` | |
| monitor.additionalLabels | object | `{}` | Additional labels to add to resources managed by the Prometheus Operator |

---

Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| additionalAnnotations | object | `{}` | Additional annotations to add to all resources |
| additionalLabels | object | `{}` | Additional labels to add to all resources |
| fullnameOverride | string | `""` | Provide a name to substitute for the full names of resources |
| grafanaDashboard.enabled | bool | `true` | |
| grafanaDashboard.folder | string | `"tracing"` | Grafana folder in which to store the dashboards |
| grafanaDashboard.grafanaOperator.allowCrossNamespaceImport | bool | `true` | |
| grafanaDashboard.grafanaOperator.enabled | bool | `false` | |
| grafanaDashboard.grafanaOperator.matchLabels | object | `{}` | Selected labels for Grafana instance |
| monitor.additionalLabels | object | `{}` | Additional labels to add to resources managed by the Prometheus Operator |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3)
25 changes: 1 addition & 24 deletions charts/tempo-mixin/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Create chart name and version as used by the chart label.
{{/*
Selector labels
*/}}
{{- define "tempo-mixin.selectorLabels" }}
{{- define "tempo-mixin.selectorLabels" -}}
app.kubernetes.io/name: {{ include "tempo-mixin.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
Expand All @@ -57,29 +57,6 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{- end }}

{{/* See: https://ambassadorlabs.github.io/k8s-for-humans/ */}}
{{/*
Common annotations
*/}}
{{- define "tempo-mixin.annotations" }}
a8r.io/description: Monitoring Mixin for tempo
a8r.io/owner: portefaix
a8r.io/bugs: https://github.com/portefaix/portefaix-hub/issues
a8r.io/documentation: https://artifacthub.io/packages/helm/portefaix-hub/tempo-mixin
a8r.io/repository: https://github.com/portefaix/portefaix-hub
a8r.io/support: https://github.com/portefaix/portefaix-hub/issues
{{- if .Values.additionalAnnotations }}
{{- toYaml .Values.additionalAnnotations }}
{{- end }}
{{- end }}

{{/* a8r.io/logs: */}}
{{/* a8r.io/runbook: */}}
{{/* a8r.io/incidents: */}}
{{/* a8r.io/uptime */}}
{{/* a8r.io/performance */}}
{{/* a8r.io/dependencies */}}

{{/*
Allow the release namespace to be overridden
*/}}
Expand Down
2 changes: 0 additions & 2 deletions charts/tempo-mixin/templates/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ kind: PrometheusRule
metadata:
name: {{ printf "%s-%s" (include "tempo-mixin.fullname" .) "alerts" | trunc 63 | trimSuffix "-" }}
namespace: {{ include "tempo-mixin.namespace" . }}
annotations:
{{- include "tempo-mixin.annotations" . | indent 4 }}
labels:
{{- include "tempo-mixin.labels" . | indent 4 }}
{{- if .Values.monitor.additionalLabels }}
Expand Down
29 changes: 26 additions & 3 deletions charts/tempo-mixin/templates/configmap-dashboards.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
{{ if .Values.grafanaDashboard.enabled -}}
{{- $files := .Files.Glob "dashboards/*.json" }}
{{- if $files }}
---
apiVersion: v1
kind: ConfigMapList
items:
Expand All @@ -12,13 +13,35 @@ items:
name: {{ printf "dashboard-tempo-mixin-%s" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ include "tempo-mixin.namespace" $ }}
annotations:
grafana-folder: {{ $.Values.grafana.folder }}
{{- include "tempo-mixin.annotations" $ | indent 6 }}
grafana-folder: {{ $.Values.grafanaDashboard.folder }}
labels:
grafana-dashboard: {{ $dashboardName }}
{{- include "tempo-mixin.labels" $ | indent 6 }}
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 "tempo-mixin.labels" $ | indent 4 }}
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 }}
2 changes: 0 additions & 2 deletions charts/tempo-mixin/templates/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ kind: PrometheusRule
metadata:
name: {{ printf "%s-%s" (include "tempo-mixin.fullname" .) "rules" | trunc 63 | trimSuffix "-" }}
namespace: {{ include "tempo-mixin.namespace" . }}
annotations:
{{- include "tempo-mixin.annotations" . | indent 4 }}
labels:
{{- include "tempo-mixin.labels" . | indent 4 }}
{{- if .Values.monitor.additionalLabels }}
Expand Down
10 changes: 8 additions & 2 deletions charts/tempo-mixin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ monitor:
additionalLabels: {}
# release: kube-prometheus-stack

grafana:
# Grafana folder in which to store the dashboards
grafanaDashboard:
enabled: true
# -- Grafana folder in which to store the dashboards
folder: tracing
grafanaOperator:
enabled: false
allowCrossNamespaceImport: true
# -- Selected labels for Grafana instance
matchLabels: {}

0 comments on commit e96805b

Please sign in to comment.