Skip to content

fix(trace-item-details): allow timestamp#116321

Merged
wmak merged 3 commits into
masterfrom
wmak/fix/allow-timestamps-on-trace-item-details-endpoint
May 27, 2026
Merged

fix(trace-item-details): allow timestamp#116321
wmak merged 3 commits into
masterfrom
wmak/fix/allow-timestamps-on-trace-item-details-endpoint

Conversation

@wmak
Copy link
Copy Markdown
Member

@wmak wmak commented May 27, 2026

  • This endpoint was defaulting to all time so queries were commonly timing out, add our usual snuba params style timestamps along with a trace style timestamp parameter with a buffer

- This endpoint was defaulting to all time so queries were commonly
  timing out, add our usual snuba params style timestamps along with a
  trace style timestamp parameter with a buffer
@wmak wmak requested review from a team as code owners May 27, 2026 17:26
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 27, 2026
Comment thread src/sentry/api/endpoints/project_trace_item_details.py Outdated
@wmak wmak enabled auto-merge (squash) May 27, 2026 17:56
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 228016a. Configure here.

if end is not None:
end = min(end, example_end)
else:
end = example_end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intersection of non-overlapping ranges yields inverted timestamps

Medium Severity

When both timestamp and date range params (e.g. statsPeriod) are provided but their resulting intervals don't overlap, the intersection logic (max for start, min for end) produces start > end. This inverted range is then passed directly to FromDatetime and sent to the RPC without validation, which could cause an error or undefined query behavior downstream.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 228016a. Configure here.

@wmak wmak merged commit c302e7b into master May 27, 2026
62 checks passed
@wmak wmak deleted the wmak/fix/allow-timestamps-on-trace-item-details-endpoint branch May 27, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants