Skip to content

feat: add sentry.timestamp.sequence attribute to the spec#262

Merged
logaretm merged 7 commits intomainfrom
awad/add-log-sequence-attr-def
Mar 6, 2026
Merged

feat: add sentry.timestamp.sequence attribute to the spec#262
logaretm merged 7 commits intomainfrom
awad/add-log-sequence-attr-def

Conversation

@logaretm
Copy link
Member

@logaretm logaretm commented Feb 20, 2026

This pull request introduces a new log attribute, sentry. timestamp.sequence, to both the JavaScript and Python Sentry conventions libraries. It’s a monotonically incrementing integer used by the SDK to ensure correct log ordering when timestamps are identical.

The attribute is optional, and not required to be sent by SDKs. Only required if certain runtime environments has unreliable timestamp generation.

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.

Related PRs:

PR Checklist

  • I have run yarn test and verified that the tests pass.
  • I have run yarn generate && yarn format to generate and format code and docs.

If an attribute was added:

  • The attribute is in a namespace (e.g. nextjs.function_id, not function_id)
  • I have used the correct value for pii (i.e. maybe or true. Use false only for values that should never be scrubbed such as IDs)

If an attribute was deprecated:

@github-actions
Copy link

github-actions bot commented Feb 20, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (attributes) Add allow_any_value field to attribute schema by vgrozdanic in #272
  • (http) Add http.server.request.time_in_queue attribute by dingsdax in #267
  • (resource) Add resource.deployment.environment by mjq in #266
  • Add sentry.timestamp.sequence attribute to the spec by logaretm in #262
  • Add changelog tracking to attribute definitions by ericapisani in #270

Bug Fixes 🐛

  • (attributes) Remove allow_any_value boolean attribute and allow any as type by vgrozdanic in #273
  • (gen_ai) Input and output token description by obostjancic in #261
  • Avoid changelog generation recursion by Lms24 in #274

Documentation 📚

  • Update README with up-to-date links by ericapisani in #258

Internal Changes 🔧

Deps

  • Bump svgo from 3.3.2 to 3.3.3 by dependabot in #275
  • Bump svelte from 5.51.5 to 5.53.5 by dependabot in #271
  • Bump rollup from 4.40.1 to 4.59.0 by dependabot in #269
  • Bump svelte from 5.48.1 to 5.51.5 by dependabot in #260

Deps Dev

  • Bump tar from 7.5.8 to 7.5.10 by dependabot in #276
  • Bump tar from 7.5.7 to 7.5.8 by dependabot in #259

Other

  • (ai) Deprecate rest of ai.* attributes by constantinius in #264
  • (gen_ai) Deprecate gen_ai.tool.input, gen_ai.tool.message, gen_ai.tool.output by constantinius in #265

🤖 This preview updates automatically when you update the PR.

@logaretm logaretm changed the title feat: add sentry.log.sequence attribute to the spec feat: add sentry.timestamp.sequence attribute to the spec Mar 4, 2026
@logaretm logaretm force-pushed the awad/add-log-sequence-attr-def branch from 1e487d8 to f412ffa Compare March 4, 2026 22:13
@logaretm logaretm marked this pull request as ready for review March 4, 2026 22:16
@logaretm logaretm requested a review from Lms24 as a code owner March 4, 2026 22:16
Copilot AI review requested due to automatic review settings March 4, 2026 22:16
@logaretm logaretm requested review from a team, cleptric, lcian, mjq and nsdeschenes as code owners March 4, 2026 22:16
Copy link

@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 1 potential issue.

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new sequencing attribute intended to allow deterministic ordering when multiple items share the same timestamp (e.g., runtimes with frozen clocks), updating both the spec model and the generated conventions libraries.

Changes:

  • Adds a new attribute definition JSON under model/attributes/sentry/.
  • Updates Python conventions (attributes.py) with a new attribute constant, metadata, and type mapping.
  • Updates JavaScript conventions (attributes.ts) with a new attribute constant, metadata, and typings.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
python/src/sentry_conventions/attributes.py Adds a new Sentry attribute constant + metadata + type mapping (currently for sentry.log.sequence).
model/attributes/sentry/sentry__timestamp__sequence.json Introduces the spec definition for sentry.timestamp.sequence (currently missing changelog).
javascript/sentry-conventions/src/attributes.ts Adds a new exported attribute constant + metadata + typings (currently for sentry.log.sequence).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"key": "false"
},
"is_in_otel": false,
"example": 0
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

All other model/attributes/sentry/*.json files include a changelog block, but this new attribute file does not. Please add an appropriate changelog entry (version + PR number) to match the established schema and ensure downstream generators include release provenance consistently.

Suggested change
"example": 0
"example": 0,
"changelog": [
{
"version": "1.0.0",
"pr": 12345
}
]

Copilot uses AI. Check for mistakes.
logaretm and others added 6 commits March 5, 2026 13:50
Add attribute for deterministic ordering of logs and metrics when
timestamps share the same integer millisecond. Starts at 0 on SDK
init, increments by 1 per captured item, resets when the millisecond
changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add attribute for deterministic ordering of logs and metrics when
timestamps share the same integer millisecond. Starts at 0 on SDK
init, increments by 1 per captured item, resets when the millisecond
changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@logaretm logaretm force-pushed the awad/add-log-sequence-attr-def branch from e56f596 to 5ec191f Compare March 5, 2026 18:51
@logaretm logaretm merged commit 8cd3574 into main Mar 6, 2026
11 checks passed
@logaretm logaretm deleted the awad/add-log-sequence-attr-def branch March 6, 2026 03:05
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.

3 participants