Skip to content

Commit

Permalink
Add logs cluster label override to helm chart (#7764)
Browse files Browse the repository at this point in the history
* Add clusterLabel to logs

* Update compiled manifests

* Add [ENHANCEMENT] line to CHANGELOG.md

---------

Co-authored-by: Dimitar Dimitrov <[email protected]>
  • Loading branch information
ian-lmcb and dimitarvdimitrov authored Apr 12, 2024
1 parent 8db94a9 commit d86537f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions operations/helm/charts/mimir-distributed/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Entries should include a reference to the Pull Request that introduced the chang
* [ENHANCEMENT] Make the PSP template configurable via `rbac.podSecurityPolicy`. #7190
* [ENHANCEMENT] Recording rules: add native histogram recording rules to `cortex_request_duration_seconds`. #7528
* [ENHANCEMENT] Make the port used in ServiceMonitor for kube-state-metrics configurable. #7507
* [ENHANCEMENT] The new value `metaMonitoring.grafanaAgent.logs.clusterLabel` controls whether to add a `cluster` label and with what content to PodLogs logs. #7764
* [ENHANCEMENT] Produce a clearer error messages when multiple X-Scope-OrgID headers are present. #7704
* [BUGFIX] Metamonitoring: update dashboards to drop unsupported `step` parameter in targets. #7157
* [BUGFIX] Recording rules: drop rules for metrics removed in 2.0: `cortex_memcache_request_duration_seconds` and `cortex_cache_request_duration_seconds`. #7514
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ spec:
sourceLabels:
- __meta_kubernetes_pod_container_name
targetLabel: name
{{- if kindIs "string" .logs.clusterLabel }}
- targetLabel: cluster
replacement: {{ include "mimir.clusterName" $ }}
replacement: "{{ .logs.clusterLabel | default (include "mimir.clusterName" $) }}"
{{- end }}

namespaceSelector:
matchNames:
Expand Down
5 changes: 5 additions & 0 deletions operations/helm/charts/mimir-distributed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3213,6 +3213,11 @@ metaMonitoring:
# -- Controls whether to create resources PodLogs and LogsInstance resources
enabled: true

# -- To disable setting a 'cluster' label in logs, set to 'null'.
# To overwrite the 'cluster' label with your own value, set to a non-empty string.
# Keep empty string "" to have the default value in the 'cluster' label, which is the helm release name for Mimir and the actual cluster name for Enterprise Metrics.
clusterLabel: ""

# -- Default destination for logs. The config here is translated to Promtail client
# configuration to write logs to this Loki-compatible remote. Optional.
remote:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
- __meta_kubernetes_pod_container_name
targetLabel: name
- targetLabel: cluster
replacement: metamonitoring-values
replacement: "metamonitoring-values"

namespaceSelector:
matchNames:
Expand Down

0 comments on commit d86537f

Please sign in to comment.