Skip to content

feat: client reports#1549

Open
jpnurmi wants to merge 6 commits intomasterfrom
jpnurmi/feat/client-reports
Open

feat: client reports#1549
jpnurmi wants to merge 6 commits intomasterfrom
jpnurmi/feat/client-reports

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented Mar 3, 2026

Track and report discarded events per the client reports spec:

  • sample_rate: events dropped by the sample rate
  • before_send: events, transactions, logs, and metrics dropped by before-send hooks
  • ratelimit_backoff: envelope items dropped by rate limiter
  • network_error: envelope items lost on send failure
  • send_error: envelope items rejected by the server (4xx/5xx)
  • queue_overflow: logs and metrics dropped when the batcher is full

Reports are opportunistically attached to outgoing envelopes. Opt-out via sentry_options_set_send_client_reports().

Close: #1216

@jpnurmi jpnurmi force-pushed the jpnurmi/feat/http-retry branch from b133fd6 to 93db900 Compare March 17, 2026 16:15
Base automatically changed from jpnurmi/feat/http-retry to master March 31, 2026 19:23
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/client-reports branch 3 times, most recently from 03b4c49 to 08697e5 Compare April 1, 2026 10:23
@jpnurmi jpnurmi changed the title WIP: feat: client reports feat: client reports Apr 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 47ca4e4

@jpnurmi jpnurmi force-pushed the jpnurmi/feat/client-reports branch 6 times, most recently from d20984f to dd39920 Compare April 2, 2026 11:15
@jpnurmi jpnurmi marked this pull request as ready for review April 2, 2026 11:16
Copy link
Copy Markdown

@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 2 potential issues.

Fix All in Cursor

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

jpnurmi added 6 commits April 2, 2026 17:15
Track and report discarded events per the client reports spec:
- sample_rate: events dropped by sample rate
- before_send: events, transactions, logs, and metrics dropped by
  before_send hooks
- ratelimit_backoff: envelope items dropped by rate limiter
- network_error: envelope items lost on send failure
- send_error: envelope items rejected by the server (4xx/5xx)
- queue_overflow: logs and metrics dropped when batcher is full

Reports are opportunistically attached to outgoing envelopes.
Opt-out via sentry_options_set_send_client_reports().

See https://develop.sentry.dev/sdk/telemetry/client-reports/
Subtract reported values instead of zeroing to preserve concurrent
increments that happen between read and reset.
Use the item type string directly to determine the data category
instead of going through the lossy RL category mapping.
The rate limiter is updated from the response headers before the status
code is returned. Pass NULL to skip the stale rate limiter check since
all items were already serialized and sent.
Split http_send_request so the rate limiter is updated after recording
discards, not before. This ensures items that were rate-limited during
serialization are not also counted as send_error.
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/client-reports branch from 3a646a5 to 47ca4e4 Compare April 2, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Client Reports to the native SDK

1 participant