Skip to content

feat: Add Culture context model attributes#243

Open
logaretm wants to merge 4 commits intomainfrom
awad/add-culture-attributes
Open

feat: Add Culture context model attributes#243
logaretm wants to merge 4 commits intomainfrom
awad/add-culture-attributes

Conversation

@logaretm
Copy link
Member

@logaretm logaretm commented Feb 4, 2026

Description

Add semantic conventions for the culture context, which captures localization and regional settings.

  • culture.calendar
  • culture.display_name
  • culture.locale
  • culture.is_24_hour_format
  • culture.timezone

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: culture.timezone)
  • I have used the correct value for pii (We were sending those already so PII is false to all of them but happy to discuss and re-evaluate)

Related to getsentry/sentry-javascript#19148 and getsentry/relay#5615

@logaretm logaretm requested a review from Lms24 as a code owner February 4, 2026 16:51
Copilot AI review requested due to automatic review settings February 4, 2026 16:51
@logaretm logaretm requested review from a team, cleptric, lcian, mjq and nsdeschenes as code owners February 4, 2026 16:51
@logaretm logaretm changed the title feat: add culture model attributes feat: Add culture model attributes Feb 4, 2026
@github-actions
Copy link

github-actions bot commented Feb 4, 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 sentry.profiler_id attribute by Lms24 in #242
  • Add attribute gen_ai.response.time_to_first_token by constantinius in #227
  • Add sentry.status_code attribute by mjq in #223
  • Backfill db.system attribute by mjq in #224
  • Add sentry.category attribute by mjq in #218
  • Add sentry.normalized_db_query.hash by Ahmed-Labs in #200

Other

  • (ai) Add input tokens cache write by shellmayr in #217
  • (gen_ai) Add new Gen AI attributes by obostjancic in #221
  • Add Culture context model attributes by logaretm in #243
  • Better docs website by Lms24 in #238
  • Add page listing all attributes by Lms24 in #207

Bug Fixes 🐛

Attributes

  • Migrating several numeric fields to pii=maybe by constantinius in #228
  • Improve gen_ai.operation.name description by obostjancic in #225

Other

  • (db) Clarify db.query.text and db.query.summary attributes by Lms24 in #208

Documentation 📚

  • Link to individual attributes by Lms24 in #248
  • Add links to llms.txt files by Lms24 in #247
  • Add toggleable dark and light mode by Lms24 in #246
  • Use proper svelte 5 syntax in search modal by Lms24 in #244
  • Add llms.txt for full list of attributes by Lms24 in #245

Internal Changes 🔧

Attributes

  • Update sentry.span.source with known values by Lms24 in #214
  • Add legacy attribute definitions for transaction spans by Ahmed-Labs in #212
  • Normalize deprecated db attribute names by Ahmed-Labs in #199

Deps Dev

  • Bump tar from 7.5.4 to 7.5.7 by dependabot in #239
  • Bump tar from 7.5.3 to 7.5.4 by dependabot in #226
  • Bump tar from 7.4.3 to 7.5.3 by dependabot in #220

Repo

  • Add Claude Code settings with basic permissions by philipphofmann in #222
  • Unstale yarn lock by Lms24 in #215

Other

  • (ai) Remove gen_ai_usage_total_cost attribute by vgrozdanic in #206
  • (lint) Don't lint Claude's config files by mjq in #219
  • (release) Switch from action-prepare-release to Craft by BYK in #216
  • Add statuses permission to Changelog Preview by lcian in #232

Other

  • Add more CODEOWNERS by cleptric in #240
  • Add @getsentry/ingest to CODEOWNERS by cleptric in #236
  • Update CODEOWNERS to change global ownership by cleptric in #230

🤖 This preview updates automatically when you update the PR.

@logaretm logaretm changed the title feat: Add culture model attributes feat: Add Culture context model attributes Feb 4, 2026
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

This PR adds semantic conventions for the culture context, which captures localization and regional settings. The changes introduce 5 new culture-related attributes that align with Sentry's culture context specification.

Changes:

  • Added 5 new culture attributes: culture.calendar, culture.display_name, culture.locale, culture.is_24_hour_format, and culture.timezone
  • Generated corresponding code in Python and JavaScript/TypeScript libraries
  • Updated documentation to include the new culture attributes namespace

Reviewed changes

Copilot reviewed 7 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
model/attributes/culture/culture__calendar.json Defines the calendar system attribute
model/attributes/culture/culture__display_name.json Defines the human-readable culture name attribute
model/attributes/culture/culture__is_24_hour_format.json Defines the 24-hour time format preference attribute
model/attributes/culture/culture__locale.json Defines the locale identifier attribute
model/attributes/culture/culture__timezone.json Defines the timezone attribute
python/src/sentry_conventions/attributes.py Adds culture attributes to Python library with proper alphabetical ordering
javascript/sentry-conventions/src/attributes.ts Adds culture attributes to JavaScript/TypeScript library with proper alphabetical ordering
generated/attributes/index.md Adds culture namespace to attribute index
generated/attributes/culture.md Generated documentation for culture attributes
generated/attributes/all.md Updates the total attribute count and includes culture attributes

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

@@ -0,0 +1,10 @@
{
"key": "culture.locale",
"brief": "The locale identifier following RFC 4646.",
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The reference to RFC 4646 is outdated. RFC 4646 was obsoleted by RFC 5646 in 2009. The brief description should reference RFC 5646 or BCP 47 instead, which is the current standard for language tags. The example "en-US" correctly follows this standard.

Suggested change
"brief": "The locale identifier following RFC 4646.",
"brief": "The locale identifier following BCP 47 (RFC 5646).",

Copilot uses AI. Check for mistakes.
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

I would classify all of these attributes as pii: 'maybe'. Not because they strictly contain PII but because setting maybe allows users to define scrubbing rules in Relay (AFAIK).

Copy link
Member

@Lms24 Lms24 Feb 5, 2026

Choose a reason for hiding this comment

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

OTel defines browser.language which we could use instead.

That being said, scoping a value of sentry's culture context to browser isn't a great global strategy so I think we can just add this attribute as well for all SDKs. For the browser SDK, we could consider double-writing.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't sure how to classify them, but makes sense. I will update that in rely definitions as well.

For OTEL's browser.language, does that block this PR or does it need a re-thinking in terms of including this whole context?

Copy link
Member

Choose a reason for hiding this comment

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

No blocker from my PoV, just a thought!

@logaretm logaretm force-pushed the awad/add-culture-attributes branch from e21d899 to f1b1b42 Compare February 5, 2026 14:20
@logaretm logaretm requested a review from Lms24 February 5, 2026 14:29
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

One more request, otherwise LGTM otherwise from my end

Copy link
Member

Choose a reason for hiding this comment

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

let's remove the markdown files. We no longer need them after merging the docs website (#238)

If you rerun yarn:generate after rebaseing, these files shouldn't be generated anymore. Let me know in case they still show up.

Copy link
Member Author

Choose a reason for hiding this comment

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

Weird, I did re-run them and it generated them again. I removed them anyways!

@logaretm logaretm force-pushed the awad/add-culture-attributes branch from f1b1b42 to ca8f3fb Compare February 5, 2026 16: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.

2 participants