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

Feat/integration updates #1130

Merged
merged 12 commits into from
Jan 16, 2025
Merged

Feat/integration updates #1130

merged 12 commits into from
Jan 16, 2025

Conversation

bentonam
Copy link
Collaborator

No description provided.

@bentonam bentonam requested a review from petewall as a code owner January 16, 2025 15:42
…at/integration-updates

# Conflicts:
#	charts/k8s-monitoring/docs/examples/meta-monitoring/alloy-singleton.alloy
#	charts/k8s-monitoring/docs/examples/meta-monitoring/output.yaml
Comment on lines 20 to 45
{{- 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 }}
Copy link
Collaborator

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)?

@bentonam bentonam merged commit e1a29cd into main Jan 16, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants