Repository navigation
Description
Problem Description
A Service row has no trace span of its own. A trace cannot show what one row of a round did or how long it ran. The round span holds stage (36 to 75 min) and fix_plan together.
Evidence (2026-11-13): both fix_plan selection lines carry the span id of the round (96e94f4a8c6d7336 and 8404ee6e15acb620). The metric devops_cli_roadmap_row_seconds gives the seconds of each row, but a trace in Tempo cannot split a slow round by row.
Cause
src/devops_cli/server/service.py:680-688opens one spanservice.job <repo>for each round.src/devops_cli/roadmap/run.py:1631-1641runs each row insiderequest_scope(row=...)with no span.
Reproduction Steps
- Find a fix_plan line of the Service in Loki (namespace
devops), and open its trace in Tempo. - The trace has the round span and the spans of requests. It has no span for the row.
Expected vs Actual Behavior
Expected: each row runs in a child span of the round, with its name, result and duration.
Actual: all rows of a round share the round span.
Environment Diagnostics
- DevOps CLI Version: 0.128.0 (origin/main 2daf63a)
- Execution Environment: roadmap Service in namespace
devops
Proposed Fix
Open a child span service.row <name> around row.runner in run.py. Give it the attributes service.repo, service.row and service.result, and for fix_plan the mode of the row. Use the tracer of get_tracer(), as the round span does. Set the status ERROR on an exception, as the round span does. The span holds no prompt or tool content (telemetry privacy defaults).
Acceptance Criteria
-
uv run pytest tests/roadmap/test_roadmap_run_job_rows.py::test_each_row_runs_in_a_child_span_of_the_roundpasses: a round with two rows gives twoservice.rowspans with the attributes. -
uv run pytest tests/roadmap/test_roadmap_run_job_rows.py::test_a_failed_row_span_has_status_errorpasses. -
uv run devops ci fail-to-pass --base origin/mainshows that the two tests fail on the base and pass on the head. The pull request cites the run. - Live, after the merge: a Tempo search for spans named
service.row fix_plangives the spans of the Service.
Existing Tool Considered
The OpenTelemetry span API through the tracer of the project (get_tracer). No new library. Cost to build (estimate): 0.15 M tokens and 1 hour elapsed. Keep: one span for each row. Fix: about 0.05 M tokens.
Related
#5211 (the fix-plan repairs), #4576 (the repository name in logs and traces).
Source: #4843
Alternatives check of 2026-11-22: in-use.
The repository already uses this tool.
Tool: open-telemetry/opentelemetry-python (https://github.com/open-telemetry/opentelemetry-python), Apache-2.0, last activity 2026-11-20, maintained.
Reason: Searches found no alternative tool; the project already uses the OpenTelemetry span API through get_tracer, whose child spans, attributes and ERROR status cover the need, with the span wiring written in run.py and the runner entry point.
Covers:
- Child spans under the round span through the project tracer
- Span attributes for repo, row, result and fix_plan mode
- ERROR status on a row that raises
Lacks:
- No per-row span in run.py without new code
- No service.row on runner Job root spans by itself
- No Tempo query or dashboard of row spans
Proposed design
Problem statement
The Service gives no trace span to a row, so a slow round cannot be split by row. Add a service.row <name> child span around each row and set service.row on the runner Job root spans. The CI fail-to-pass run is the merge gate. The Tempo query is a post-merge live check.
Acceptance criteria
Requirement: Per-row child span
The Service SHALL run each due roadmap row inside a child span named service.row <name> of the round span.
Scenario: a round with two rows
- WHEN
uv run pytest tests/roadmap/test_roadmap_run_job_rows.py::test_each_row_runs_in_a_child_span_of_the_roundruns a round with two rows over the OTLP fake - THEN the test passes, and the exported spans hold two spans named
service.row <name>, each with the round span as its parent and the attributesservice.repo,service.rowandservice.result.
Requirement: Fix-plan mode attribute
The span of the fix_plan row MUST carry the mode of the row in the attribute service.mode.
Scenario: a fix_plan row
- WHEN
uv run pytest tests/roadmap/test_roadmap_run_job_rows.py::test_the_fix_plan_row_span_carries_its_moderuns a fix_plan row with a mode over the OTLP fake - THEN the test passes, and the span named
service.row fix_planhas the attributeservice.modeset to the mode of the row.
Requirement: Error status on a failed row
A row whose runner raises an exception MUST set the status ERROR on its span.
Scenario: a failed row
- WHEN
uv run pytest tests/roadmap/test_roadmap_run_job_rows.py::test_a_failed_row_span_has_status_errorruns a row whose runner raises - THEN the test passes, and the span named
service.row <name>has status ERROR.
Requirement: Row span parent of model requests
The span of a row SHALL be the parent of each model request span that the row makes.
Scenario: a refine row with a model request
- WHEN
uv run pytest tests/roadmap/test_roadmap_run_job_rows.py::test_a_row_span_is_the_parent_of_its_model_requestsruns a refine row over the OTLP fake - THEN the test passes, and the model request span with
gen_ai.usage.input_tokensis a child of theservice.row refinespan.
Requirement: Runner Job root span attribute
Each runner Job that runs a roadmap row MUST set service.row on its root span.
Scenario: an implement runner Job and a fix-plan Job
- WHEN
uv run pytest tests/roadmap/test_roadmap_run_job_rows.py::test_the_implement_runner_root_span_carries_the_rowand...::test_the_fix_plan_job_root_span_carries_the_rowrun the runner entry point for each row over the OTLP fake - THEN both tests pass, and each root span has the attribute
service.rowset to its row name.
Requirement: Live Tempo query
The live Tempo query MUST return the row spans and the largest model request of each row.
Scenario: the refine row in Tempo
- WHEN an operator runs the TraceQL query
{ name = "service.row refine" } >> { span.gen_ai.usage.input_tokens > 0 } | max_over_time(span.gen_ai.usage.input_tokens)in Tempo after the merge - THEN the query returns the
service.row refinespans and the largestgen_ai.usage.input_tokensof each span.
Requirement: Fail-to-pass proof
The pull request MUST show that the new tests fail on the base and pass on the head.
Scenario: the fail-to-pass run
- WHEN the pull request runs
uv run devops ci fail-to-pass --base origin/main - THEN the command reports that the new tests fail on the base and pass on the head, and the pull request cites the run.
Existing Tool Considered
open-telemetry/opentelemetry-python (https://github.com/open-telemetry/opentelemetry-python) - verdict in-use (alternatives check of 2026-11-17 in the issue body). The item already names the OpenTelemetry span API through get_tracer(), and the repository already uses the library. The check lists what the tool covers and lacks.
This change opens the service.row <name> child span around row.runner in run.py. It sets the attributes in code. That is the first part the check says the library does not give for free.
It also sets service.row on the root span of the implement runner and fix-plan Jobs. That is the second part the check says no instrumentation does automatically. The issue estimates 0.15 M tokens and 1 hour for the span code, and 0.05 M tokens to fix it.
Key questions
- What is the attribute name for the fix_plan mode?:
service.mode. The span attributes use theservice.prefix, so the mode follows them. (best practice) [sources: src/devops_cli/server/service.py, src/devops_cli/roadmap/run.py]- Chosen: service.mode. It follows the
service.prefix ofservice.repo,service.rowandservice.result. - Rejected: fix_plan.mode. It mixes a row name into the attribute namespace and breaks the prefix.
- Rejected: roadmap.mode. It does not match the
service.prefix of the other span attributes.
- Chosen: service.mode. It follows the
- Should the row span be the current span so the model request spans are children?: Yes. Open the span with the tracer's context manager around
row.runner, so the AI client's model request spans are children of the row span. (best practice) [sources: src/devops_cli/telemetry/tracer.py, src/devops_cli/ai/client/unified.py, src/devops_cli/roadmap/run.py]- Chosen: current span around row.runner. The AI client reads the current span context, so the model request spans become children.
- Rejected: start a span without making it current. The model request spans would not be children, so the TraceQL query would not work.
- Rejected: pass the span context explicitly. It adds code to each call and duplicates the context manager.
- Where do the runner Jobs set
service.rowon their root span?: At the runner entry point that starts the implement and fix-plan Jobs. The entry point setsservice.rowon the root span it already opens. (best practice) [sources: src/devops_cli/main.py, src/devops_cli/roadmap/agent_run.py]- Chosen: runner entry point. The root span of the Job is in the runner pod, so the row name must be set there.
- Rejected: Service Job-creation span. That span is in the Service, not in the Job, so it cannot be the Job's root span.
- Does the span record prompt or tool content?: No. It records only
service.repo,service.row,service.resultand, for fix_plan,service.mode. The telemetry privacy defaults stay. (best practice) [sources: docs/TELEMETRY.md, src/devops_cli/telemetry/tracer.py]- Chosen: attributes only. The issue requires the telemetry privacy defaults and no prompt or tool content.
- Rejected: record the row's input. It would put prompt or tool content in a span and break the privacy defaults.
- Is the live Tempo query a merge gate?: No. The CI fail-to-pass run is the merge gate. The Tempo query is a post-merge live check, because it needs the deployed Service and the merged span. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, docs/TELEMETRY.md]
- Chosen: post-merge live check. The query needs the deployed Service and the merged code, so it cannot run before the merge.
- Rejected: merge gate. It cannot pass before the merge, so it would block every pull request.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both add per-row observability in the roadmap service; #4058 delivers a Prometheus histogram, the candidate delivers a Tempo trace span.dan-petty commentedon Nov 13, 2026
A second need for this span (2026-11-13). The owner moves each model slot (
ai.tasks.<slot>) to the localqwen3.8:27bwhen every job of the slot is above 90% and its largest request stays under 256k input tokens.Today a trace cannot give the context size of one job:
gen_ai.usage.input_tokens;gen_ai.agent.nameis alwaysagent;jobholds only the name of a runner Job.So I measured only intake, through the
ModelProposalschema span: at most about 4.3k input tokens in 24 h. Refine, alternatives and the consolidate judge share theanalysisslot, and none of them can be measured.Please add to the acceptance criteria:
{ name = "service.row refine" } >> { span.gen_ai.usage.input_tokens > 0 } | max_over_time(span.gen_ai.usage.input_tokens)gives the largest request of the refine row. The same works for every row.service.rowon their root span, so the same query works for them.devops-cli-service commentedon Nov 17, 2026
Alternatives check: in-use
Reason: The need is per-row trace spans under the existing round span, and the issue already names the OpenTelemetry span API through the project's
get_tracer()as the tool, with no new library. The OpenTelemetry Python API provides exactly this: named child spans from a tracer, arbitrary span attributes, and an error span status, so nothing else has to be introduced.The repository already uses this tool.
Tool: open-telemetry/opentelemetry-python (https://github.com/open-telemetry/opentelemetry-python)
Covers:
service.row <name>child span of the round spanservice.repo,service.row,service.resultand the fix_plan mode are recorded on the spanservice.rowwithgen_ai.usage.input_tokens)get_tracer()) is reused, so the span joins the existing trace with no new dependencyLacks:
row.runnerinrun.pyand the attributes set in codeservice.rowon their root span themselves; no instrumentation does that automaticallyTools considered:
Searches run:
Sources:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 2620fae (see proposed design in issue body).
feat(service): run each roadmap row in a child trace span
chore(main): release 0.217.0 (#7098)
devops-cli-service commentedon Nov 25, 2026
Released in v0.217.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.217.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 06:46 UTC