Skip to content

Comments

feat(dev/logs): Add sentry.log.sequence definition to the logs' spec#16492

Draft
logaretm wants to merge 1 commit intomasterfrom
awad/add-log-sequence-attr
Draft

feat(dev/logs): Add sentry.log.sequence definition to the logs' spec#16492
logaretm wants to merge 1 commit intomasterfrom
awad/add-log-sequence-attr

Conversation

@logaretm
Copy link
Member

This pull request updates the telemetry logs specification to introduce deterministic log ordering via a new attribute, sentry.log.sequence. This change addresses issues in environments where multiple logs can share identical timestamps, ensuring logs can always be ordered correctly.

The attribute addresses an issue that came up in Cloudflare’s runtime which freezes all timers and clock functions, causing all timestamp calls to return the same value. This can lead to logs being displayed out of order if they don’t get sent in one request. Instead, they’ll appear in the order of arrival in ingest, which is subject to request latencies and out-of-order request completion.

This is a proposal as we have yet to see what product thinks about this.

@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Feb 20, 2026 8:23pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
sentry-docs Ignored Ignored Feb 20, 2026 8:23pm

Request Review

@logaretm logaretm changed the title feat: Add sentry.log.sequence definition to the logs' spec feat(dev/logs): Add sentry.log.sequence definition to the logs' spec Feb 20, 2026
Comment on lines +309 to +310
The sequence number **MUST NOT**:
- Be intentionally reset during the process lifetime.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You only need it as a discriminator per timestamp, so maybe that's enough as a constraint?

"sentry.message.parameter.1": { "value": 85, "type": "integer" },
"sentry.message.parameter.2": { "value": 60, "type": "integer" }
"sentry.message.parameter.2": { "value": 60, "type": "integer" },
"sentry.log.sequence": { "value": 0, "type": "integer" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be top-level, it feels heavily tied to the timestamp and a fundamental attribute of a log.

@k-fish wdyt?

- Be intentionally reset during the process lifetime.
- Be used to modify or synthesize sub-millisecond timestamp precision.

The sequence provides deterministic ordering within a single SDK instance. It does not guarantee ordering across independent processes or workers, which have separate counters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it does between separate threads?

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.

2 participants