Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linkerd-viz helm: add support for metric_relabel_configs #12248

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions viz/charts/linkerd-viz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ Kubernetes: `>=1.22.0-0`
| prometheus.image.tag | string | `"v2.48.1"` | Docker image tag for the prometheus instance |
| prometheus.logFormat | string | defaultLogLevel | log format (plain, json) of the prometheus instance |
| prometheus.logLevel | string | defaultLogLevel | log level of the prometheus instance |
| prometheus.metricRelabelConfigs | string | `nil` | A metricRelabelConfigs section allows to drop high cardinality metrics. *NOTE:* Please use with caution. Some metrics are needed for linkerd-viz to function properly. |
| prometheus.nodeSelector | object | `{"kubernetes.io/os":"linux"}` | NodeSelector section, See the [K8S documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) for more information |
| prometheus.podAnnotations | object | `{}` | annotations for the prometheus pod |
| prometheus.proxy | string | `nil` | |
Expand Down
4 changes: 4 additions & 0 deletions viz/charts/linkerd-viz/templates/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ data:
# Copy tmp labels into real labels
- action: labelmap
regex: __tmp_pod_label_(.+)
{{- if .Values.prometheus.metricRelabelConfigs }}
metric_relabel_configs:
{{- toYaml .Values.prometheus.metricRelabelConfigs | trim | nindent 6 }}
{{- end}}

{{- if .Values.prometheus.scrapeConfigs }}
{{- toYaml .Values.prometheus.scrapeConfigs | trim | nindent 4 }}
Expand Down
12 changes: 12 additions & 0 deletions viz/charts/linkerd-viz/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,18 @@ prometheus:
# - action: labelmap
# regex: __meta_kubernetes_node_label_(.+)

# -- A metricRelabelConfigs section allows to drop high cardinality metrics.
# *NOTE:* Please use with caution. Some metrics are needed for linkerd-viz to
# function properly.
metricRelabelConfigs:
# This allows us to fine tune prometheus cardinality by dropping certain
# metrics as suggested here: https://itnext.io/optimizing-linkerd-metrics-in-prometheus-de607ec10f6b
#
# Ex:
# - action: keep
# source_labels: [le]
# regex: "(?i)(|10|50|100|500|1000|10000|30000|\\+Inf)"

# -- A sidecarContainers section specifies a list of secondary containers to run
# in the prometheus pod e.g. to export data to non-prometheus systems
sidecarContainers:
Expand Down