-
Notifications
You must be signed in to change notification settings - Fork 0
Update prom scrape config to match dcgm-exporter pattern #228
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
Merged
+13
−8
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 121
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 119
🏁 Script executed:
# Search for the file fd prometheus-configmap.yamlRepository: devzero-inc/zxporter
Length of output: 119
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 1264
🏁 Script executed:
# Also check the git history to see what changed git log --oneline -20 -- ./helm-chart/zxporter/templates/prometheus-configmap.yamlRepository: devzero-inc/zxporter
Length of output: 164
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 250
🏁 Script executed:
# Get the full commit to see the changes git show 81bf4dc --statRepository: devzero-inc/zxporter
Length of output: 17165
🏁 Script executed:
# Get the actual diff of this commit git show 81bf4dcRepository: devzero-inc/zxporter
Length of output: 50378
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 4085
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 1047
🌐 Web query:
Prometheus relabel_config multiple source_labels concatenation separator💡 Result:
Yes — when you list multiple source_labels in a relabel_config, Prometheus concatenates their values using the separator (defaults to ";"), then matches that combined string with your regex and uses capture groups in replacement. Example:
Example:
relabel_configs:
separator: "_"
regex: (.+)
replacement: "$1"
target_label: combined
This will set label combined to "job_instance" (e.g. "api_10.0.0.1"). (prometheus.io)
Citations:
🌐 Web query:
Prometheus relabel action keep regex multiple source_labels behavior💡 Result:
Short answer: When keep (or drop/replace/hashmod) has multiple source_labels, Prometheus concatenates their values with the configured separator (default ";"), then matches your regex against that single concatenated string (the regex is anchored on both ends). If the regex matches the concatenation the object is kept (keep) or dropped (drop); otherwise it is removed/kept accordingly. Example: source_labels: [app,region], separator: ":" and regex: "frontend:us-west" will match only when app=="frontend" and region=="us-west". [1][2]
Sources:
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 757
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 3546
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 1022
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 46
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 426
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 716
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 743
🏁 Script executed:
Repository: devzero-inc/zxporter
Length of output: 749
The regex pattern change correctly supports GKE dcgm-exporter with flexible labeling.
The changes appropriately:
nvidia-dcgm-exporterto'.*dcgm-exporter.*'to accommodate label variations across different Kubernetes distributions__meta_kubernetes_pod_label_app_kubernetes_io_nameto handle GKE's standard labeling schemePrometheus concatenates multiple
source_labelswith a separator (default;) and matches the regex against the combined string. This effectively creates an OR condition—the pod is scraped if either theapporapp.kubernetes.io/namelabel contains "dcgm-exporter".The broader regex pattern could match unintended pods (e.g., "test-dcgm-exporter-backup", "dcgm-exporter-v2-dev"), but the configuration remains protected by the
prometheus.io/scrape=trueannotation requirement (checked in the preceding relabel rule) and any downstream metric filtering.🤖 Prompt for AI Agents