Read stable HTTP semconv attributes when building HTTP span messages #2516
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 333 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.348
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2516"
general
weight: 0.35
samuelcolvin
Fixes #2513 (the second half; #2514 handled the stale message after
update_name).What
_tweak_http_spansnow understands the stable HTTP semantic conventions as well as the old ones:| old | stable |
|---|---|
|
http.method|http.request.method||
http.target|url.path|| query parsed from
http.url|url.query||
http.url|url.full|The old keys still take precedence when both are present (as with
OTEL_SEMCONV_STABILITY_OPT_IN=http/dup), so spans from the contrib instrumentations are unchanged.Why
FastAPI's built-in telemetry (0.142+) starts the server span as
GETwith only the stable attributes, then renames it toGET /items/{item_id}once routing has matched. After #2514 the message followed the rename, but_tweak_http_spansonly read the old keys, so it found justhttp.routeand left the message asGET /items/{item_id}instead of buildingGET /items/1.Details
url.querywhen present, otherwise it's parsed from the URL as before, and is rendered the same way (/path ? a='1' & b='2 3').http.targetis still derived fromhttp.urlfor spans on the old conventions, but is not added to spans that only useurl.full, to avoid mixing deprecated attributes into stable-semconv spans.Before / After
Real FastAPI 0.142.2 with its built-in telemetry,
GET /items/1?x=1&y=2:Tests
Added
test_http_spans_stable_semconvintests/test_logfire.pycovering a renamed server span with a query string, a server span without one, and client spans with and withoutserver.address. The lockfile pins FastAPI 0.141.1 which has no built-in telemetry, so the test drives the tracer directly the same way #2514's test does; the FastAPI 0.142.2 output above was checked manually.🤖 Generated with Claude Code
https://claude.ai/code/session_013cgYhnUKiuH97ZvDynSqgf
<!-- This is an auto-generated description by cubic. -->
<a href="https://cubic.dev/pr/pydantic/logfire/pull/2516?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->