Skip to content

feat(attributes): Add Cloudflare DO sql attributes - #435

Merged
JPeer264 merged 1 commit into
mainfrom
jp/cloudflare-sql
Jun 24, 2026
Merged

feat(attributes): Add Cloudflare DO sql attributes#435
JPeer264 merged 1 commit into
mainfrom
jp/cloudflare-sql

Conversation

@JPeer264

Copy link
Copy Markdown
Member

Description

This adds Cloudflare attributes for SQL in Durable Object (sqlite). These attributes were taken from Cloudflare's traces directly.

PR Checklist

  • I have run yarn test and verified that the tests pass.
  • I have run yarn generate 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 apply_scrubbing (i.e. manual or auto. Use never only for values that should never be scrubbed such as IDs)

If an attribute was deprecated:

@JPeer264
JPeer264 requested review from a team, Lms24, cleptric, mjq and nsdeschenes as code ownersJune 18, 2026 13:49
@JPeer264JPeer264 self-assigned this Jun 18, 2026
@github-actions

github-actionsBot commented Jun 18, 2026

Copy link
Copy Markdown

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 Cloudflare DO sql attributes by JPeer264 in #435
  • Add gen_ai.request.reasoning_effort attribute by cleptric in #334
  • Add deprecated otel.kind attribute by Lms24 in #440

Other

  • (docs) Make span name and description cards linkable by Lms24 in #433

Bug Fixes 🐛

  • (attributes) Add deprecated sentry.thread.id by mjq in #451

Documentation 📚

  • (contributing) Improve releasing and downstream update instructions by constantinius in #434
  • Remove semicolon in db.query.summary example by JPeer264 in #439

Internal Changes 🔧

Deps

  • Bump dompurify from 3.4.10 to 3.4.11 by dependabot in #438
  • Bump astro from 6.1.10 to 6.4.6 in /docs by dependabot in #432

Other

  • (attributes) Rename pii field to apply_scrubbing by cleptric in #426
  • (test) Exit vitest when running yarn test by Lms24 in #441
  • Exclude formatting changes from git blame by Lms24 in #450
  • Use oxfmt and oxlint for formatting and linting by Lms24 in #449
  • Update yarn.lock file by JPeer264 in #436
  • Bump all dependencies to fix esbuild security issues by cleptric in #431

Other

  • Update blame ignore revs for pii field renaming by cleptric in #437

🤖 This preview updates automatically when you update the PR.

@cleptriccleptric left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As this is just SQL, I would say we stick to the generic db ones. Or does Cloudflare's own instrumentation uses those?

@JPeer264

Copy link
Copy Markdown
MemberAuthor

Or does Cloudflare's own instrumentation uses those?

Yes Cloudflare uses exactly these. db is of course also there, so these will be used anyways. The following is a snapshot from a sql.exec method. In theory we can also just don't emit these extra attributes:

image

@JPeer264
JPeer264 enabled auto-merge (squash) June 24, 2026 09:47
@JPeer264
JPeer264 merged commit a341837 into mainJun 24, 2026
15 checks passed
@JPeer264
JPeer264 deleted the jp/cloudflare-sql branch June 24, 2026 09:50
JPeer264 added a commit to getsentry/sentry-javascript that referenced this pull request Jun 25, 2026
closes#20832
closes [JS-2445](https://linear.app/getsentry/issue/JS-2445)
This instruments `sql.exec()` for an SQLite DurableObject. It adds a
span and a breadcrumb for the `exec` method.
It was inspired by the postgres integration, that is why the
`_INTERNAL_sanitizeSqlQuery` has been now exported from `core`. I wanted
to also add the span attribute `db.query.summary`, but the functionality
didn't exist and didn't want to make the PR bigger. I'll add another PR
for that functionality.
This PR can only be merged once
getsentry/sentry-conventions#435 has been merged
Sign up for freeto 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

@JPeer264@cleptric@Lms24