Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a Prometheus ConfigMap override specifically for k3s environments and updates accompanying documentation.
- Introduces a new Prometheus configMap with custom scrape and relabel configurations for k3s and cAdvisor compatibility.
- Updates the README to document how and why to use this override.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| charts/sourcegraph/examples/prometheus/prometheus-override-k3s.ConfigMap.yaml | New Prometheus override ConfigMap with custom scrape_configs for k3s |
| charts/sourcegraph/examples/prometheus/README.md | Documentation for applying the override ConfigMap |
| - source_labels: [__meta_kubernetes_node_name] | ||
| regex: (.+) | ||
| target_label: __metrics_path__ | ||
| replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor |
There was a problem hiding this comment.
Replace '${1}' with '$1' to use the correct capture group syntax in Prometheus replacement patterns.
Suggested change
| replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor | |
| replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor |
| - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] | ||
| action: replace | ||
| regex: (.+):(?:\d+);(\d+) | ||
| replacement: ${1}:${2} |
There was a problem hiding this comment.
Replace '${1}:${2}' with '$1:$2' to ensure proper capture group referencing in Prometheus replacement patterns.
Suggested change
| replacement: ${1}:${2} | |
| replacement: $1:$2 |
DaedalusG
approved these changes
Mar 31, 2025
enriquegh
pushed a commit
that referenced
this pull request
Jul 10, 2025
Linear issue: [REL-809: Investigate why Grafana is not showing Prometheus data](https://linear.app/sourcegraph/issue/REL-809/investigate-why-grafana-is-not-showing-prometheus-data) ### Checklist - [x] Follow the [manual testing process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md) - [ ] Update [changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md) - [ ] Update [Kubernetes update doc](https://docs.sourcegraph.com/admin/updates/kubernetes) ### Test plan Tested with a customer self-hosting on k3s, and on our AMI running k3s <!-- As part of SOC2/GN-104 and SOC2/GN-105 requirements, all pull requests are REQUIRED to provide a "test plan". A test plan is a loose explanation of what you have done or implemented to test this, as outlined in our Testing principles and guidelines: https://docs.sourcegraph.com/dev/background-information/testing_principles Write your test plan here after the "Test plan" header. -->
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Linear issue: REL-809: Investigate why Grafana is not showing Prometheus data
Checklist
Test plan
Tested with a customer self-hosting on k3s, and on our AMI running k3s