Skip to content

fix(perf-detection): skip spans with PII-redacted http.response_content_length#119480

Closed
billyvg wants to merge 1 commit into
masterfrom
claude/serene-cannon-fbk6co
Closed

fix(perf-detection): skip spans with PII-redacted http.response_content_length#119480
billyvg wants to merge 1 commit into
masterfrom
claude/serene-cannon-fbk6co

Conversation

@billyvg

@billyvg billyvg commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

Fixes SENTRY-5R9R (ValueError: invalid literal for int() with base 10: '[Filtered]')

In LargeHTTPPayloadDetector.visit_span, the code converts http.response_content_length from str to int when the value arrives as a string. When PII scrubbing is active, that value can be replaced with a non-numeric sentinel like '[Filtered]' or '[REDACTED]', causing int() to raise ValueError. This bubbles up as "Failed to detect performance problems" logged from the spans process-segments consumer.

Root cause: large_http_payload_detector.py:59 — unconditional int(encoded_body_size) when the value is a scrubbed string.

Fix: Wrap the conversion in try/except ValueError and return early (skip the span) when the value is non-numeric. The span can't be evaluated anyway.

Evidence from Sentry:

  • 1,432+ occurrences since 2026-07-07 (Seer actionability: high)
  • Culprit: spans.consumers.process_segments.process_segment
  • Local variable at crash: encoded_body_size: "'[REDACTED]'"
  • Environment: DE region, process-segments consumer pods

Changes

  • src/sentry/issue_detection/detectors/large_http_payload_detector.py: wrap int() cast in try/except ValueError, returning early for non-parseable values
  • tests/sentry/issue_detection/test_large_http_payload_detector.py: add test_does_not_raise_on_redacted_payload_size covering '[Filtered]', '[REDACTED]', and '***'

Claude Session

https://claude.ai/code/session_01AQUEoDMYw8jPUTwTHHHLt6

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.


Generated by Claude Code

…nt_length

When PII scrubbing replaces encoded_body_size with '[Filtered]' or '[REDACTED]',
int() raises ValueError and causes 'Failed to detect performance problems' errors.
Gracefully skip those spans instead.

Fixes SENTRY-5R9R
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 13, 2026
@billyvg billyvg closed this Jul 13, 2026
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