Skip to content

feat: Dual window for metrics with sampled spans - #8427

Open
alexander-alderman-webb wants to merge 5 commits into
webb/early-exit-metrics-samplingfrom
webb/trace-connected-reservoir
Open

alexander-alderman-webb wants to merge 5 commits into
webb/early-exit-metrics-samplingfrom
webb/trace-connected-reservoir

Conversation

@alexander-alderman-webb

@alexander-alderman-webb alexander-alderman-webb commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Add a separate window for trace-connected metrics that have a sampled span. The window is harvested and treated the same as the existing window.
Metrics in the new window are sent in their own envelope to avoid running into Relay's size limits.
The rate per second is divided evenly between the two windows for one name, keeping one more metric in the trace-connected window if we would keep an odd number across a 5 second duration.

Issues

Reminders

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit e451635.

Main concerns: data sent to Sentry, public contract, reach.

This label is a hint for reviewers, not an approval.

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 59841 passed | ⏭️ 3119 skipped | Total: 62960 | Pass Rate: 95.05% | Execution Time: 162m 53s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +384
Passed Tests 📈 +384
Failed Tests —
Skipped Tests —

All tests are passing successfully.

✅ Patch coverage is 93.02% (40 of 43 changed executable lines covered; target 80%).
Project statement coverage is 90.11% (unchanged from base (dc23273) to head (e451635)).

Changed files with executable lines (3)
File Patch coverage Changed executable lines
sentry_sdk/_lock_free_metrics_batcher.py 91.89% 34/37 covered; missed: 102, 103, 181
sentry_sdk/client.py 100.00% 1/1 covered
sentry_sdk/metrics.py 100.00% 5/5 covered
Coverage diff
@@            Coverage Diff             @@
##        master     #8427       +/-##
==========================================
  Coverage    90.11%    90.11%        —%
==========================================
  Files          201       202        +1
  Tracked lines     22199     22507      +308
  Branches      7784      7886      +102
==========================================
+ Hits         20004     20282      +278
- Misses        2195      2225       +30
- Partials      1283      1303       +20

Generated by Coverage Action

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/trace-connected-reservoir branch from 1b0f5e6 to 34330d3 Compare December 1, 2026 08:49
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026
@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review December 1, 2026 09:30
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner December 1, 2026 09:30
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants