Skip to content

Commit

Permalink
Merge pull request #1253 from porter-dev/metrics-label-allowlist
Browse files Browse the repository at this point in the history
Add metric labels allowlist argument to kube state metrics
  • Loading branch information
MauAraujo authored Apr 15, 2024
2 parents 33bc4a2 + 8db5eae commit 5c18ce7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ spec:
{{ if .Values.kubeconfig.enabled }}
- --kubeconfig=/opt/k8s/.kube/config
{{ end }}
{{- if .Values.metricLabelsAllowlist }}
- --metric-labels-allowlist={{ .Values.metricLabelsAllowlist | join "," }}
{{- end }}
{{- if .Values.kubeconfig.enabled }}
volumeMounts:
- name: kubeconfig
Expand Down
10 changes: 10 additions & 0 deletions addons/prometheus/charts/kube-state-metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ tolerations: []
# Annotations to be added to the pod
podAnnotations: {}

# Comma-separated list of additional Kubernetes label keys that will be used in the resource's
# labels metric. By default the metric contains only name and namespace labels.
# To include additional labels, provide a list of resource names in their plural form and Kubernetes
# label keys you would like to allow for them (Example: '=namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...)'.
# A single '*' can be provided per resource instead to allow any labels, but that has
# severe performance implications (Example: '=pods=[*]').
metricLabelsAllowlist:
# This label is used by the porter agent to group and aggregate resource usage metrics for billing
- pods[porter.run/project-id]

## Assign a PriorityClassName to pods if set
# priorityClassName: ""

Expand Down

0 comments on commit 5c18ce7

Please sign in to comment.