Skip to content

Commit 4e7d8e8

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 b4d3657 commit 4e7d8e8

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
@@ -36,6 +36,8 @@ Use `**BREAKING**:` to denote a breaking change
3636
- 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.
3737
- 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.
3838
- 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.
39+
- 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.
40+
- 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.
3941
- 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
4042

4143
## 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
@@ -22,8 +22,6 @@ spec:
2222
metadata:
2323
annotations:
2424
kubectl.kubernetes.io/default-container: jaeger
25-
prometheus.io/port: "16686"
26-
sourcegraph.prometheus/scrape: "true"
2725
{{- if not .Values.jaeger.config.existingConfigMap }}
2826
checksum/jaeger-config: {{ include (print $.Template.BasePath "/jaeger/jaeger.ConfigMap.yaml") . | sha256sum }}
2927
{{- end }}

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

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -190,44 +190,6 @@ data:
190190
regex: ^$
191191
action: drop
192192
193-
# Example scrape config for probing services via the Blackbox Exporter.
194-
#
195-
# The relabeling allows the actual service scrape endpoint to be configured
196-
# via the following annotations:
197-
#
198-
# * `prometheus.io/probe`: Only probe services that have a value of `true`
199-
- job_name: 'kubernetes-services'
200-
201-
metrics_path: /probe
202-
params:
203-
module: [http_2xx]
204-
205-
kubernetes_sd_configs:
206-
- role: service
207-
208-
relabel_configs:
209-
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_probe]
210-
action: keep
211-
regex: true
212-
- source_labels: [__address__]
213-
target_label: __param_target
214-
- target_label: __address__
215-
replacement: blackbox
216-
- source_labels: [__param_target]
217-
target_label: instance
218-
- action: labelmap
219-
regex: __meta_kubernetes_service_label_(.+)
220-
# Sourcegraph specific customization. Do not copy the labels the chart adds to every object, or
221-
# `sourcegraph.labels`, to every metric: `helm.sh/chart` and `app.kubernetes.io/version` change on every upgrade.
222-
- action: labeldrop
223-
regex: {{ include "sourcegraph.prometheus.droppedLabels" . }}
224-
- source_labels: [__meta_kubernetes_service_namespace]
225-
# Sourcegraph specific customization. We want a more convenient to type label.
226-
# target_label: kubernetes_namespace
227-
target_label: ns
228-
- source_labels: [__meta_kubernetes_service_name]
229-
target_label: kubernetes_name
230-
231193
# Example scrape config for pods
232194
#
233195
# 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
@@ -375,8 +375,8 @@ tests:
375375
asserts:
376376
- matchRegex:
377377
path: data["prometheus.yml"]
378-
# All three jobs that map Service or pod labels to metric labels drop the chart's labels afterwards.
379-
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}
378+
# Both jobs that map Service or pod labels to metric labels drop the chart's labels afterwards.
379+
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}
380380

381381
- it: should not copy sourcegraph.labels to metrics
382382
set:
@@ -391,4 +391,4 @@ tests:
391391
- matchRegex:
392392
path: data["prometheus.yml"]
393393
# Prometheus replaces every character of a label key outside [a-zA-Z0-9_] with `_`.
394-
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}
394+
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)