Repository navigation
Closed
Labels
effort/mediumEffort Mediumpriority/p1-highPriority P1: high-impact work for the next planned milestonescope/telemetryOpenTelemetry tracing spans, Prometheus metrics, and Jaegersource/agentFiled by an agenttype/bugType bug: the code does not do what it mustvalue/highValue High: the delivery of the item matters much
Description
Problem
A vetting review of #5324 (merged 2026-11-13 02:13Z as 0165669, for #4697) found two major defects and some minor ones. The core change is correct: the tracer keeps only service.name, service.namespace, service.instance.id, os.type and telemetry.sdk.* in the metric Resource, and both CronJobs set service.instance.id=devops-cli-job.
- The alert DevopsCliMetricStreamsShareSeries names a cause that cannot raise it. A different service.instance.id gives a different instance label. The real cause is version skew: a devops-cli process from a build before fix(telemetry): keep one metric stream per workload #4697 still sends host.name next to a new build with the same job and instance, so two cumulative streams write one series and its counts are wrong. At 02:38Z the alert was pending for 3 such pairs (a workstation, a runner pod, and roadmap-service after its pod change). The README row (k8s/README.md, Alerting) gives the same wrong cause, and it has 5 cells in a 4-column table, so GFM does not render the action.
- No test guards the workstation default any more (no OTEL_RESOURCE_ATTRIBUTES, so service.instance.id is the host name). The PR changed the only such test to set the variable. A change of the default to a constant or a per-process value passes all 466 telemetry tests. No test fails when the allowlist filter in tracer.py _ensure_meter is removed.
Proposed solution
- In the OpenTelemetry collector metrics pipeline, before deltatocumulative, add a transform processor (OTTL) that deletes the resource attribute host.name, so every build, old or new, writes one stream. This is the cure; the description fix alone does not stop the wrong counts.
- Rewrite the alert description, the expected description in tests/fixtures/prometheus_rules/metric_streams_tests.yaml and the README row: compare the label sets of the two target_info series; a different host_name means an old build runs next to a new one (old global install, long-lived MCP server, worktree on an old branch, Job from an old image); a different telemetry_sdk_* label means a second SDK; the alert clears 15 minutes after the old writer stops. Put the action in a cell that renders, and make the README test parse the table so a row with more cells than the header fails.
- Add a test with OTEL_RESOURCE_ATTRIBUTES removed and platform.node set: the metric Resource equals the literal allowlisted dict with no host.name. Add host.name and k8s.pod.name to OTEL_RESOURCE_ATTRIBUTES in test_two_tracers_with_one_instance_send_equal_metric_resources, so removing the filter fails a test.
- Pin the promtool cases: eval times that fail with a shorter for:, a quiet case for a job outside the regex, a case that needs the 15m lookback.
- One line in docs/TELEMETRY.md: overlapping Job pods share one deltatocumulative stream; watch otelcol_deltatocumulative_datapoints{error!=""}.
Acceptance
- After the merge, count by (job, instance) (last_over_time(target_info{job=~"devops-cli.*|roadmap-service"}[15m])) is 1 for every pair within 30 minutes, with an old and a new build both running.
- The new tests fail on the current main and pass on the branch.
- The rendered README shows the runbook action.
Process note: #5324 applied the CronJob env at the merge, before the image with the tracer change rolled (window 02:13Z to 02:27Z, no Job started in it). Ship a manifest change that needs new image code after the release that carries the code.
Metadata
Metadata
Assignees
Labels
effort/mediumEffort Mediumpriority/p1-highPriority P1: high-impact work for the next planned milestonescope/telemetryOpenTelemetry tracing spans, Prometheus metrics, and Jaegersource/agentFiled by an agenttype/bugType bug: the code does not do what it mustvalue/highValue High: the delivery of the item matters much
Activity
dan-petty commentedon Nov 13, 2026
A merged fix left a wrong alert cause and a test gap that allow silent regressions of the metric stream invariant.The regression commit 0165669 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.Both target one metric stream per workload; #4697 delivered the core tracer fix, the candidate fixes residual defects (wrong alert cause, missing OTTL strip of host.name, test gap) found in that delivery.dan-petty commentedon Nov 13, 2026
Post-merge check: the collector rolled out at 04:45:21Z. At 04:55Z,
count by (job, instance) (last_over_time(target_info{job=~"devops-cli.*|roadmap-service"}[5m]))gives 1 for each pair (the workstationdevops-cliseries androadmap-service), andDevopsCliMetricStreamsShareSeriesno longer fires.devops-cli-service commentedon Nov 13, 2026
Released in v0.126.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.126.1
devops-cli-service commentedon Nov 13, 2026
Live since 2026-11-13 05:08 UTC