Skip to content

Sample 0.5% of Cloud backend traces to stay within the Sentry span quota - #1530

Merged
helpcodeai merged 4 commits into
mainfrom
fix/sentry-cloud-trace-sampling
Nov 5, 2026
Merged

helpcodeai merged 4 commits into
mainfrom
fix/sentry-cloud-trace-sampling

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

Sentry has accepted no spans for days: the organisation's span quota is used up every day. On 11-04 the Cloud backend sent about 714k spans (662k dropped by the SDK's rate-limit backoff, 52k refused with span_usage_exceeded) at the Cloud default SENTRY_TRACES_SAMPLE_RATE=0.05. So we paid the tracing CPU cost (Sentry Prisma tracing was about 12 % of backend CPU in the 11-03 profile) and saw no traces.

Changes

  • The default of SENTRY_TRACES_SAMPLE_RATE in docker-compose.cloud.yml goes from 0.05 to 0.005. MCP calls keep a fifth of it (0.001). Errors are unchanged.
  • The droplet .env does not set this variable, so the next Cloud deploy picks up the new value. Setting it in .env still overrides it.
  • The website goes from 10 % to 2 % in HelpCode-ai/anythingmcp-website#516.

Expected: about 70k backend spans a day plus about 40k from the website, back under the quota.

Type

  • Other: Cloud configuration

Testing

  • No tests needed: a compose default.
  • The droplet .env has no SENTRY_TRACES_SAMPLE_RATE (checked).
  • After the deploy: Sentry spans accepted > 0 and span_usage_exceeded near 0 (find_dropped_events).

Checklist

  • My code follows the existing code style
  • I have tested my changes locally
  • I have updated documentation (if applicable): comment in the compose file
  • All existing tests pass
  • This PR has a descriptive title

Related Issues

Daily check 2026-11-05 (follow-up 4: Sentry spans 100 % dropped).

Deployment: Cloud only. Self-hosted keeps its own default (0, tracing off).

@helpcodeai
helpcodeai enabled auto-merge (squash) November 5, 2026 09:42
@helpcodeai
helpcodeai merged commit d65f451 into main Nov 5, 2026
14 checks passed
@helpcodeai
helpcodeai deleted the fix/sentry-cloud-trace-sampling branch November 5, 2026 10:50
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant