Skip to content

feat(core): Add sentry.timestamp.sequence attribute for timestamp tie-breaking#19421

Draft
logaretm wants to merge 10 commits intodevelopfrom
awad/js-1762-add-log-sequence-attribute-for-timestamp-tie-breaking
Draft

feat(core): Add sentry.timestamp.sequence attribute for timestamp tie-breaking#19421
logaretm wants to merge 10 commits intodevelopfrom
awad/js-1762-add-log-sequence-attribute-for-timestamp-tie-breaking

Conversation

@logaretm
Copy link
Member

@logaretm logaretm commented Feb 19, 2026

Implements the sentry.timestamp.sequence attribute for both logs and metrics, following the logs spec v1.16.0 and metrics spec.

The attribute provides deterministic ordering of telemetry items that share the same millisecond timestamp.

A single shared counter is used across all telemetry types so logs and metrics can be ordered relative to each other. The counter starts at 0, increments by 1 per item, and resets when the integer millisecond timestamp changes.

Closes #19420

@linear
Copy link

linear bot commented Feb 19, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

Codecov Results 📊


Generated by Codecov Action

@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 25.63 kB - -
@sentry/browser - with treeshaking flags 24.13 kB - -
@sentry/browser (incl. Tracing) 42.43 kB - -
@sentry/browser (incl. Tracing, Profiling) 47.09 kB - -
@sentry/browser (incl. Tracing, Replay) 81.25 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.87 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 85.95 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 98.21 kB - -
@sentry/browser (incl. Feedback) 42.44 kB - -
@sentry/browser (incl. sendFeedback) 30.3 kB - -
@sentry/browser (incl. FeedbackAsync) 35.35 kB - -
@sentry/browser (incl. Metrics) 26.91 kB +0.44% +117 B 🔺
@sentry/browser (incl. Logs) 27.06 kB +0.45% +120 B 🔺
@sentry/browser (incl. Metrics & Logs) 27.73 kB +0.44% +120 B 🔺
@sentry/react 27.38 kB - -
@sentry/react (incl. Tracing) 44.77 kB - -
@sentry/vue 30.08 kB - -
@sentry/vue (incl. Tracing) 44.3 kB - -
@sentry/svelte 25.66 kB - -
CDN Bundle 28.26 kB +0.32% +88 B 🔺
CDN Bundle (incl. Tracing) 43.36 kB +0.24% +101 B 🔺
CDN Bundle (incl. Logs, Metrics) 29.12 kB +0.39% +112 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 44.21 kB +0.26% +112 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 68.2 kB +0.17% +112 B 🔺
CDN Bundle (incl. Tracing, Replay) 80.2 kB +0.09% +65 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81.11 kB +0.14% +111 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 85.75 kB +0.11% +92 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.64 kB +0.14% +114 B 🔺
CDN Bundle - uncompressed 82.55 kB +0.24% +197 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 128.26 kB +0.16% +197 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 85.42 kB +0.27% +230 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 131.13 kB +0.18% +230 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 209.08 kB +0.12% +230 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 245.15 kB +0.09% +197 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 248 kB +0.1% +230 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 258.06 kB +0.08% +197 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 260.9 kB +0.09% +230 B 🔺
@sentry/nextjs (client) 47.18 kB - -
@sentry/sveltekit (client) 42.89 kB - -
@sentry/node-core 52.25 kB +0.02% +8 B 🔺
@sentry/node 174.73 kB +0.02% +20 B 🔺
@sentry/node - without tracing 97.4 kB +0.02% +12 B 🔺
@sentry/aws-serverless 113.2 kB +0.01% +8 B 🔺

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,600 - 9,030 -5%
GET With Sentry 1,573 18% 1,692 -7%
GET With Sentry (error only) 5,928 69% 5,999 -1%
POST Baseline 1,092 - 1,198 -9%
POST With Sentry 520 48% 581 -10%
POST With Sentry (error only) 947 87% 1,057 -10%
MYSQL Baseline 3,165 - 3,233 -2%
MYSQL With Sentry 414 13% 461 -10%
MYSQL With Sentry (error only) 2,590 82% 2,637 -2%

View base workflow run

Rename `sentry.log.sequence` to `sentry.timestamp.sequence` per the
published spec. Extract sequence logic into a shared utility so both
logs and metrics use a single counter, enabling cross-telemetry ordering.
The counter resets to 0 when the integer millisecond timestamp changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@logaretm logaretm changed the title fix(core): add tie-breaking attribute to generated logs feat(core): Add sentry.timestamp.sequence attribute for timestamp tie-breaking Mar 6, 2026
logaretm and others added 6 commits March 6, 2026 11:00
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sequence 0 is the default and doesn't provide tie-breaking value,
so omitting it saves bytes on the vast majority of telemetry items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@logaretm logaretm force-pushed the awad/js-1762-add-log-sequence-attribute-for-timestamp-tie-breaking branch from 2471999 to 1cc231b Compare March 6, 2026 20:33
logaretm and others added 2 commits March 6, 2026 15:41
…ibute

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 log sequence attribute for timestamp tie-breaking

1 participant