Fix: OTelLinksResponse.count over-counts and writes a removed dropped field#4346
Conversation
… field Signed-off-by: justin212407 <charlesjustin2124@gmail.com>
|
@justin212407 is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR modifies the OpenTelemetry span ingestion response to report only accepted links in the response count and removes the dropped field from the response object, changing the API semantics for reporting span ingestion outcomes. ChangesSpan Ingestion Response Semantics
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Fixes incorrect OTelLinksResponse.count semantics in the tracing ingest endpoint so the response count reflects only spans successfully accepted/published (i.e., the number of returned links), and removes a stale dropped=... kwarg that no longer exists on the response model.
Changes:
- Update
/tracing/spans/ingestresponsecounttolen(links)(accepted spans only), instead oflen(links) + len(dropped). - Remove the stale
dropped=...argument when constructingOTelLinksResponse.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
api/oss/src/apis/fastapi/tracing/router.py:307
OTelLinksResponse(seeapi/oss/src/apis/fastapi/tracing/models.py:108-134) no longer declares adroppedfield, so passingdropped=...here is ignored by Pydantic and makes the response construction misleading (and could become a runtime error ifextrais tightened). Remove thedroppedkwarg from thisOTelLinksResponse(...)call (and consider whetherdroppedshould be logged or otherwise surfaced).
count=len(links),
links=links,
dropped=dropped or None,
)
fixes: #4318
Summary
Fix silent over-counting in tracing ingest responses where
OTelLinksResponse.countincluded dropped spans instead of only accepted spans.Changes
dropped=...kwarg (field was removed from model but was still being set)Behavior
Before
Nspans withKfailures returned:count = NN-Kentries inlinksAfter
countnow accurately reflects only accepted spansTesting
Verified locally.
Acceptance Validation
QA Follow-up
/tracing/spans/ingestwith mixed valid/invalid span batches returns correctcount/tracing/traces/ingestpath using the same patternsDemo
Files Changed
router.pyingest_spans(line ~303)Checklist
ruff format+ruff check)