Skip to content

feat(snuba): add a metric in query_trace_data to see what spans report span.status "ok" but have an associated error#112090

Merged
constantinius merged 4 commits intomasterfrom
constantinius/feat/snuba/query-trace-data-add-metric-to-get-incoherent-spans
Apr 9, 2026
Merged

feat(snuba): add a metric in query_trace_data to see what spans report span.status "ok" but have an associated error#112090
constantinius merged 4 commits intomasterfrom
constantinius/feat/snuba/query-trace-data-add-metric-to-get-incoherent-spans

Conversation

@constantinius
Copy link
Copy Markdown
Contributor

Emit a metric for cases when we detect a span with status "ok" but errors associated.

This queries the additional fields "span.status", "origin", "sdk.version" which we use as tags in the metric.

Contributes to https://linear.app/getsentry/issue/TET-2102/detect-spanstatus-inconsistencies-and-report-to-sdk-teams

@constantinius constantinius requested review from a team as code owners April 2, 2026 09:44
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 2, 2026

@constantinius constantinius requested a review from vgrozdanic April 2, 2026 09:44
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 2, 2026
@constantinius constantinius requested a review from a team April 2, 2026 09:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Backend Test Failures

Failures on 27a1755 in this run:

tests/snuba/api/endpoints/test_organization_trace.py::OrganizationEventsTraceEndpointTest::test_emits_metric_for_error_on_ok_spanlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/snuba/api/endpoints/test_organization_trace.py:439: in test_emits_metric_for_error_on_ok_span
    mock_metrics.incr.assert_any_call(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/unittest/mock.py:1048: in assert_any_call
    raise AssertionError(
E   AssertionError: incr('performance.trace.span_with_errors_ok_status', sample_rate=<ANY>, tags=<ANY>) call not found

@constantinius constantinius requested review from a team and vgrozdanic April 2, 2026 11:43
@constantinius constantinius merged commit b041cd6 into master Apr 9, 2026
56 checks passed
@constantinius constantinius deleted the constantinius/feat/snuba/query-trace-data-add-metric-to-get-incoherent-spans branch April 9, 2026 07:09
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
…ort `span.status` "ok" but have an associated error (#112090)

Emit a metric for cases when we detect a span with status "ok" but
errors associated.

This queries the additional fields "span.status", "origin",
"sdk.version" which we use as tags in the metric.

Contributes to
https://linear.app/getsentry/issue/TET-2102/detect-spanstatus-inconsistencies-and-report-to-sdk-teams
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