-
Notifications
You must be signed in to change notification settings - Fork 95
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
Feat/integration updates #1130
Feat/integration updates #1130
Conversation
…at/integration-updates # Conflicts: # charts/k8s-monitoring/docs/examples/meta-monitoring/alloy-singleton.alloy # charts/k8s-monitoring/docs/examples/meta-monitoring/output.yaml
…at/integration-updates
{{- if .namespaces }} | ||
{{- $labelList = append $labelList "__meta_kubernetes_namespace" -}} | ||
{{- $valueList = append $valueList (printf "(%s)" (join "|" .namespaces)) -}} | ||
{{- $valueList = append $valueList (printf "(?:%s)" (join "|" .namespaces)) -}} | ||
{{- end }} | ||
{{- range $k, $v := .labelSelectors }} | ||
{{- if kindIs "slice" $v }} | ||
{{- $labelList = append $labelList (include "pod_label" $k) -}} | ||
{{- $valueList = append $valueList (printf "(%s)" (join "|" $v)) -}} | ||
{{- $valueList = append $valueList (printf "(?:%s)" (join "|" $v)) -}} | ||
{{- else }} | ||
{{- $labelList = append $labelList (include "pod_label" $k) -}} | ||
{{- $valueList = append $valueList $v -}} | ||
{{- $valueList = append $valueList (printf "(?:%s)" $v) -}} | ||
{{- end }} | ||
{{- end }} | ||
rule { | ||
source_labels = {{ $labelList | sortAlpha | toJson }} | ||
source_labels = {{ $labelList | toJson }} | ||
separator = ";" | ||
regex = {{ $valueList | sortAlpha | join ";" | quote }} | ||
regex = {{ $valueList | join ";" | quote }} | ||
target_label = "job" | ||
replacement = "integrations/grafana" | ||
} | ||
rule { | ||
source_labels = {{ $labelList | sortAlpha | toJson }} | ||
source_labels = {{ $labelList | toJson }} | ||
separator = ";" | ||
regex = {{ $valueList | sortAlpha | join ";" | quote }} | ||
regex = {{ $valueList | join ";" | quote }} | ||
target_label = "instance" | ||
replacement = {{ $instance.name | quote }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We gotta do something about predictable layout for this. We had the sortAlpha
in there before because it wasn't deterministic and it failed autotests pretty regularly.
Maybe instead of range $k, $v := .labelSelectors
we do something more like range $key := (keys .labelSelectors | sort)
?
No description provided.