Skip to content

Commit 4e0e79c

Browse files
Remove Jaeger's broken scrape annotation and the blackbox probe job
The jaeger pod asked Prometheus to scrape port 16686, which serves the UI and returns 404 for /metrics. The kubernetes-services job probed through a blackbox exporter the chart does not ship, and no Service opts in. Amp-Thread-ID: https://ampcode.com/threads/T-01a1d269-2788-7075-b66b-b87e3087047d Co-authored-by: Amp <amp@ampcode.com>
1 parent 856d19a commit 4e0e79c

5 files changed

Lines changed: 5 additions & 72 deletions

File tree

‎charts/sourcegraph/CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Use `**BREAKING**:` to denote a breaking change
3737
- Removed Jaeger's `remote_sampling` extension and its container port 5778. It served sampling strategies to Jaeger clients that ask for them, and nothing ever asked: no Service exposed the port, Sourcegraph and zoekt always used a constant sampler while they had Jaeger clients, and they have used OpenTelemetry since Sourcegraph 4.0. `jaeger.config.samplingDefaultProbability` no longer has any effect; trace sampling is set with `observability.tracing.sampling` in site configuration. The `jaeger` pod is replaced once on upgrade.
3838
- Removed the unused container port 2375 from the `dind` sidecar in the Docker-in-Docker executor chart (`sourcegraph-executor/dind`). `dockerd` listens on `127.0.0.1:2375` only, the executor reaches it over `localhost`, and no Service targets the port. The executor pod is replaced once on upgrade.
3939
- Narrowed the Kubernetes-native executor's Role (`sg-executor-role`) in `sourcegraph-executor/k8s` to the calls the executor makes: `watch` on `pods`, `get` on `pods/log`, and `create` and `delete` on `jobs`, `secrets`, and `persistentvolumeclaims`. It no longer grants `get` and `list` on `pods`, `secrets`, or `persistentvolumeclaims`; executors have not used them since Sourcegraph 5.1. Also removed the unread `SRC_TRACE_LOG` setting and its `executor.log.trace` value.
40+
- Removed the Prometheus scrape annotations from the `jaeger` pod. They pointed Prometheus at port 16686, which serves the Jaeger UI and returns 404 for `/metrics`, so the scrape always failed. The `jaeger` pod is replaced once on upgrade.
41+
- Removed the `kubernetes-services` scrape job from the built-in Prometheus configuration and the k3s example override. It probed Services annotated `prometheus.io/probe: "true"` through a `blackbox` exporter that the chart does not ship, and no Service carries that annotation, so it never produced data.
4042
- Removed the unused `http-debug` container port (6060) and the `executor-<queueName>` Service from the Kubernetes-native executor chart (`sourcegraph-executor/k8s`). Nothing listens on that port: executors stopped serving it in Sourcegraph 4.1, before this chart existed. Helm deletes the Service on upgrade. The undocumented `executor.serviceAnnotations`, `executor.serviceLabels`, and `executor.serviceType` values no longer have any effect. Executor metrics are unaffected; `worker` serves them through the `worker-executors` Service
4143

4244
## 8.1.0

‎charts/sourcegraph/examples/prometheus/prometheus-override-k3s.ConfigMap.yaml‎

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -119,35 +119,6 @@ data:
119119
action: replace
120120
target_label: instance
121121
122-
- job_name: 'kubernetes-services'
123-
metrics_path: /probe
124-
params:
125-
module: [http_2xx]
126-
kubernetes_sd_configs:
127-
- role: service
128-
relabel_configs:
129-
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_probe]
130-
action: keep
131-
regex: true
132-
- source_labels: [__address__]
133-
target_label: __param_target
134-
- target_label: __address__
135-
replacement: blackbox
136-
- source_labels: [__param_target]
137-
target_label: instance
138-
- action: labelmap
139-
regex: __meta_kubernetes_service_label_(.+)
140-
# Sourcegraph specific customization. Do not copy the labels the chart adds to every object to every
141-
# metric: `helm.sh/chart` and `app.kubernetes.io/version` change on every upgrade. If you set
142-
# `sourcegraph.labels`, append its keys, with `_` for every character that is not a letter, digit, or `_`,
143-
# e.g. `|example_com_project` for `example.com/project`.
144-
- action: labeldrop
145-
regex: helm_sh_chart|app_kubernetes_io_(name|instance|version|managed_by)
146-
- source_labels: [__meta_kubernetes_service_namespace]
147-
target_label: ns
148-
- source_labels: [__meta_kubernetes_service_name]
149-
target_label: kubernetes_name
150-
151122
- job_name: 'kubernetes-pods'
152123
kubernetes_sd_configs:
153124
- role: pod

‎charts/sourcegraph/templates/jaeger/jaeger.Deployment.yaml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ spec:
2828
metadata:
2929
annotations:
3030
kubectl.kubernetes.io/default-container: jaeger
31-
prometheus.io/port: "16686"
32-
sourcegraph.prometheus/scrape: "true"
3331
{{- if not .Values.jaeger.config.existingConfigMap }}
3432
checksum/jaeger-config: {{ include (print $.Template.BasePath "/jaeger/jaeger.ConfigMap.yaml") . | sha256sum }}
3533
{{- end }}

‎charts/sourcegraph/templates/prometheus/prometheus.ConfigMap.yaml‎

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -195,44 +195,6 @@ data:
195195
regex: ^$
196196
action: drop
197197
198-
# Example scrape config for probing services via the Blackbox Exporter.
199-
#
200-
# The relabeling allows the actual service scrape endpoint to be configured
201-
# via the following annotations:
202-
#
203-
# * `prometheus.io/probe`: Only probe services that have a value of `true`
204-
- job_name: 'kubernetes-services'
205-
206-
metrics_path: /probe
207-
params:
208-
module: [http_2xx]
209-
210-
kubernetes_sd_configs:
211-
- role: service
212-
213-
relabel_configs:
214-
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_probe]
215-
action: keep
216-
regex: true
217-
- source_labels: [__address__]
218-
target_label: __param_target
219-
- target_label: __address__
220-
replacement: blackbox
221-
- source_labels: [__param_target]
222-
target_label: instance
223-
- action: labelmap
224-
regex: __meta_kubernetes_service_label_(.+)
225-
# Sourcegraph specific customization. Do not copy the labels the chart adds to every object, or
226-
# `sourcegraph.labels`, to every metric: `helm.sh/chart` and `app.kubernetes.io/version` change on every upgrade.
227-
- action: labeldrop
228-
regex: {{ include "sourcegraph.prometheus.droppedLabels" . }}
229-
- source_labels: [__meta_kubernetes_service_namespace]
230-
# Sourcegraph specific customization. We want a more convenient to type label.
231-
# target_label: kubernetes_namespace
232-
target_label: ns
233-
- source_labels: [__meta_kubernetes_service_name]
234-
target_label: kubernetes_name
235-
236198
# Example scrape config for pods
237199
#
238200
# The relabeling allows the actual pod scrape endpoint to be configured via the

‎charts/sourcegraph/tests/allObjectLabels_test.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ tests:
384384
asserts:
385385
- matchRegex:
386386
path: data["prometheus.yml"]
387-
# All three jobs that map Service or pod labels to metric labels drop the chart's labels afterwards.
388-
pattern: (?s)(regex. __meta_kubernetes_(service|pod)_label_\(\.\+\)\n(\s*#[^\n]*\n)*\s*- action. labeldrop\n\s*regex. helm_sh_chart\|app_kubernetes_io_\(name\|instance\|version\|managed_by\)\n.*){3}
387+
# Both jobs that map Service or pod labels to metric labels drop the chart's labels afterwards.
388+
pattern: (?s)(regex. __meta_kubernetes_(service|pod)_label_\(\.\+\)\n(\s*#[^\n]*\n)*\s*- action. labeldrop\n\s*regex. helm_sh_chart\|app_kubernetes_io_\(name\|instance\|version\|managed_by\)\n.*){2}
389389

390390
- it: should not copy sourcegraph.labels to metrics
391391
set:
@@ -400,4 +400,4 @@ tests:
400400
- matchRegex:
401401
path: data["prometheus.yml"]
402402
# Prometheus replaces every character of a label key outside [a-zA-Z0-9_] with `_`.
403-
pattern: (?s)(regex. __meta_kubernetes_(service|pod)_label_\(\.\+\)\n(\s*#[^\n]*\n)*\s*- action. labeldrop\n\s*regex. helm_sh_chart\|app_kubernetes_io_\(name\|instance\|version\|managed_by\)\|cost_center\|example_com_project\|team\n.*){3}
403+
pattern: (?s)(regex. __meta_kubernetes_(service|pod)_label_\(\.\+\)\n(\s*#[^\n]*\n)*\s*- action. labeldrop\n\s*regex. helm_sh_chart\|app_kubernetes_io_\(name\|instance\|version\|managed_by\)\|cost_center\|example_com_project\|team\n.*){2}

0 commit comments

Comments
 (0)