Repository navigation
fix(telemetry): one metric stream across devops-cli builds - #5358
Conversation
…lector A devops-cli build from before #4697 still sends host.name in its metric Resource. deltatocumulative keys a stream by every resource attribute, so an old and a new build of one workload wrote two running totals into one Prometheus series. The transform processor transform/metric_resource deletes host.name where telemetry.sdk.name is devops-cli-otel, before deltatocumulative.
…ce filter A test without OTEL_RESOURCE_ATTRIBUTES pins the metric Resource of a workstation: the host name is the instance, and no host.name is in it. The two-pod test puts host.name and k8s.pod.name in OTEL_RESOURCE_ATTRIBUTES, so a removal of the allowlist filter fails a test.
The description of DevopsCliMetricStreamsShareSeries named a second service.instance.id, which gives a second instance label and cannot raise the alert. It now tells the reader to compare the labels of the two target_info series and names each cause. The promtool cases pin for: 30m, the job matcher and the 15 minute lookback.
Four rows of the Alerting table of k8s/README.md had a fifth cell, which GFM drops, so a reader did not see the action. The action is now in the Fires when cell. The test parses the table with markdown-it-py and fails on a row that does not render each cell.
docs/TELEMETRY.md says that the collector deletes host.name of devops-cli metrics before deltatocumulative, and that Job pods that run at the same time share one stream, whose dropped points otelcol_deltatocumulative_datapoints counts.
…rics pipeline The metrics pipeline of the collector now has a resource statement and a datapoint statement. The scenario of the monitoring-collectors spec said that the pipeline has one transform statement, so it was wrong.
Review, checks and render diffPremise (origin/main, Prometheus through Grafana)
The collector rule on the real collector imageI ran
Tests and checks (worktree at origin/main 2bbb9e2)
Render diff
@@ ConfigMap otel-collector-opentelemetry-collector, processors @@
+ transform/metric_resource:
+ error_mode: ignore
+ metric_statements:
+ - context: resource
+ statements:
+ - delete_key(resource.attributes, "host.name") where resource.attributes["telemetry.sdk.name"]
+ == "devops-cli-otel"
@@ ConfigMap, service.pipelines.metrics.processors @@
- memory_limiter
+ - transform/metric_resource
- deltatocumulative
- transform/cluster
- batch
@@ Deployment otel-collector-opentelemetry-collector, pod template @@
- checksum/config: bf5fba252d726779d5d8aa47443aaea08d8db1978a0394eed4a710297f2373a0
+ checksum/config: 6bfeb808908bdea183b3905155bdadbb33b9f17a339680e522c38560aba3b492The traces and logs pipelines do not change.
What restarts at the merge
Checks after the merge
Known items that this change does not do
|
Check resultsHead commit:
Fail-to-pass run: https://github.com/dan-petty/devops-cli/actions/runs/43365696382/job/131689454896 Skipped check: Plan Check |
🤖 I have created a release *beep* *boop* --- ## [0.126.1](v0.126.0...v0.126.1) (2026-11-13) ### Bug Fixes * **telemetry:** one metric stream across devops-cli builds ([#5358](#5358)) ([19d13d7](19d13d7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Prometheus keeps one series for each job and instance, but the collector keys a metric stream by every resource attribute. A devops-cli build from before #4697 still sends
host.namein its metric Resource, so an old and a new build of one workload wrote two running totals into one series, and its counts were wrong.The collector now deletes
host.namefrom the metric Resource of the devops-cli SDK beforedeltatocumulative, so every build sends one stream. Spans, logs and other SDKs keephost.name. The alertDevopsCliMetricStreamsShareSeriesnames the real causes and tells the reader to compare the labels of the twotarget_infoseries. Each row of the Alerting table renders its action, and a test parses the table. Tests guard the workstation instance, the metric Resource filter and the collector rule, and the promtool cases pin the wait, the job matcher and the lookback.Closes #5338
Change:
openspec/changes/archive/2026-11-13-5338-one-metric-stream-across-devops-cli/