Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 160 additions & 0 deletions javascript/sentry-conventions/src/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,106 @@ export const CODE_NAMESPACE = 'code.namespace';
*/
export type CODE_NAMESPACE_TYPE = string;

// Path: model/attributes/culture/culture__calendar.json

/**
* The calendar system used by the culture. `culture.calendar`
*
* Attribute Value Type: `string` {@link CULTURE_CALENDAR_TYPE}
*
* Contains PII: maybe
*
* Attribute defined in OTEL: No
*
* @example "GregorianCalendar"
*/
export const CULTURE_CALENDAR = 'culture.calendar';

/**
* Type for {@link CULTURE_CALENDAR} culture.calendar
*/
export type CULTURE_CALENDAR_TYPE = string;

// Path: model/attributes/culture/culture__display_name.json

/**
* Human readable name of the culture. `culture.display_name`
*
* Attribute Value Type: `string` {@link CULTURE_DISPLAY_NAME_TYPE}
*
* Contains PII: maybe
*
* Attribute defined in OTEL: No
*
* @example "English (United States)"
*/
export const CULTURE_DISPLAY_NAME = 'culture.display_name';

/**
* Type for {@link CULTURE_DISPLAY_NAME} culture.display_name
*/
export type CULTURE_DISPLAY_NAME_TYPE = string;

// Path: model/attributes/culture/culture__is_24_hour_format.json

/**
* Whether the culture uses 24-hour time format. `culture.is_24_hour_format`
*
* Attribute Value Type: `boolean` {@link CULTURE_IS_24_HOUR_FORMAT_TYPE}
*
* Contains PII: maybe
*
* Attribute defined in OTEL: No
*
* @example true
*/
export const CULTURE_IS_24_HOUR_FORMAT = 'culture.is_24_hour_format';

/**
* Type for {@link CULTURE_IS_24_HOUR_FORMAT} culture.is_24_hour_format
*/
export type CULTURE_IS_24_HOUR_FORMAT_TYPE = boolean;

// Path: model/attributes/culture/culture__locale.json

/**
* The locale identifier following RFC 4646. `culture.locale`
*
* Attribute Value Type: `string` {@link CULTURE_LOCALE_TYPE}
*
* Contains PII: maybe
*
* Attribute defined in OTEL: No
*
* @example "en-US"
*/
export const CULTURE_LOCALE = 'culture.locale';

/**
* Type for {@link CULTURE_LOCALE} culture.locale
*/
export type CULTURE_LOCALE_TYPE = string;

// Path: model/attributes/culture/culture__timezone.json

/**
* The timezone of the culture, as a geographic timezone identifier. `culture.timezone`
*
* Attribute Value Type: `string` {@link CULTURE_TIMEZONE_TYPE}
*
* Contains PII: maybe
*
* Attribute defined in OTEL: No
*
* @example "Europe/Vienna"
*/
export const CULTURE_TIMEZONE = 'culture.timezone';

/**
* Type for {@link CULTURE_TIMEZONE} culture.timezone
*/
export type CULTURE_TIMEZONE_TYPE = string;

// Path: model/attributes/db/db__collection__name.json

/**
Expand Down Expand Up @@ -8907,6 +9007,11 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
[CODE_LINENO]: 'integer',
[CODE_LINE_NUMBER]: 'integer',
[CODE_NAMESPACE]: 'string',
[CULTURE_CALENDAR]: 'string',
[CULTURE_DISPLAY_NAME]: 'string',
[CULTURE_IS_24_HOUR_FORMAT]: 'boolean',
[CULTURE_LOCALE]: 'string',
[CULTURE_TIMEZONE]: 'string',
[DB_COLLECTION_NAME]: 'string',
[DB_NAME]: 'string',
[DB_NAMESPACE]: 'string',
Expand Down Expand Up @@ -9334,6 +9439,11 @@ export type AttributeName =
| typeof CODE_LINENO
| typeof CODE_LINE_NUMBER
| typeof CODE_NAMESPACE
| typeof CULTURE_CALENDAR
| typeof CULTURE_DISPLAY_NAME
| typeof CULTURE_IS_24_HOUR_FORMAT
| typeof CULTURE_LOCALE
| typeof CULTURE_TIMEZONE
| typeof DB_COLLECTION_NAME
| typeof DB_NAME
| typeof DB_NAMESPACE
Expand Down Expand Up @@ -10362,6 +10472,51 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
reason: 'code.function.name should include the namespace.',
},
},
[CULTURE_CALENDAR]: {
brief: 'The calendar system used by the culture.',
type: 'string',
pii: {
isPii: 'maybe',
},
isInOtel: false,
example: 'GregorianCalendar',
},
[CULTURE_DISPLAY_NAME]: {
brief: 'Human readable name of the culture.',
type: 'string',
pii: {
isPii: 'maybe',
},
isInOtel: false,
example: 'English (United States)',
},
[CULTURE_IS_24_HOUR_FORMAT]: {
brief: 'Whether the culture uses 24-hour time format.',
type: 'boolean',
pii: {
isPii: 'maybe',
},
isInOtel: false,
example: true,
},
[CULTURE_LOCALE]: {
brief: 'The locale identifier following RFC 4646.',
type: 'string',
pii: {
isPii: 'maybe',
},
isInOtel: false,
example: 'en-US',
},
[CULTURE_TIMEZONE]: {
brief: 'The timezone of the culture, as a geographic timezone identifier.',
type: 'string',
pii: {
isPii: 'maybe',
},
isInOtel: false,
example: 'Europe/Vienna',
},
[DB_COLLECTION_NAME]: {
brief: 'The name of a collection (table, container) within the database.',
type: 'string',
Expand Down Expand Up @@ -14106,6 +14261,11 @@ export type Attributes = {
[CODE_LINENO]?: CODE_LINENO_TYPE;
[CODE_LINE_NUMBER]?: CODE_LINE_NUMBER_TYPE;
[CODE_NAMESPACE]?: CODE_NAMESPACE_TYPE;
[CULTURE_CALENDAR]?: CULTURE_CALENDAR_TYPE;
[CULTURE_DISPLAY_NAME]?: CULTURE_DISPLAY_NAME_TYPE;
[CULTURE_IS_24_HOUR_FORMAT]?: CULTURE_IS_24_HOUR_FORMAT_TYPE;
[CULTURE_LOCALE]?: CULTURE_LOCALE_TYPE;
[CULTURE_TIMEZONE]?: CULTURE_TIMEZONE_TYPE;
[DB_COLLECTION_NAME]?: DB_COLLECTION_NAME_TYPE;
[DB_NAME]?: DB_NAME_TYPE;
[DB_NAMESPACE]?: DB_NAMESPACE_TYPE;
Expand Down
10 changes: 10 additions & 0 deletions model/attributes/culture/culture__calendar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"key": "culture.calendar",
"brief": "The calendar system used by the culture.",
"type": "string",
"pii": {
"key": "maybe"
},
"is_in_otel": false,
"example": "GregorianCalendar"
}
10 changes: 10 additions & 0 deletions model/attributes/culture/culture__display_name.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"key": "culture.display_name",
"brief": "Human readable name of the culture.",
"type": "string",
"pii": {
"key": "maybe"
},
"is_in_otel": false,
"example": "English (United States)"
}
10 changes: 10 additions & 0 deletions model/attributes/culture/culture__is_24_hour_format.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"key": "culture.is_24_hour_format",
"brief": "Whether the culture uses 24-hour time format.",
"type": "boolean",
"pii": {
"key": "maybe"
},
"is_in_otel": false,
"example": true
}
10 changes: 10 additions & 0 deletions model/attributes/culture/culture__locale.json
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!

Original file line number Diff line number Diff line change
@@ -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.
"type": "string",
"pii": {
"key": "maybe"
},
"is_in_otel": false,
"example": "en-US"
}
10 changes: 10 additions & 0 deletions model/attributes/culture/culture__timezone.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"key": "culture.timezone",
"brief": "The timezone of the culture, as a geographic timezone identifier.",
"type": "string",
"pii": {
"key": "maybe"
},
"is_in_otel": false,
"example": "Europe/Vienna"
}
92 changes: 92 additions & 0 deletions python/src/sentry_conventions/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,58 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Example: "http.handler"
"""

# Path: model/attributes/culture/culture__calendar.json
CULTURE_CALENDAR: Literal["culture.calendar"] = "culture.calendar"
"""The calendar system used by the culture.

Type: str
Contains PII: maybe
Defined in OTEL: No
Example: "GregorianCalendar"
"""

# Path: model/attributes/culture/culture__display_name.json
CULTURE_DISPLAY_NAME: Literal["culture.display_name"] = "culture.display_name"
"""Human readable name of the culture.

Type: str
Contains PII: maybe
Defined in OTEL: No
Example: "English (United States)"
"""

# Path: model/attributes/culture/culture__is_24_hour_format.json
CULTURE_IS_24_HOUR_FORMAT: Literal["culture.is_24_hour_format"] = (
"culture.is_24_hour_format"
)
"""Whether the culture uses 24-hour time format.

Type: bool
Contains PII: maybe
Defined in OTEL: No
Example: true
"""

# Path: model/attributes/culture/culture__locale.json
CULTURE_LOCALE: Literal["culture.locale"] = "culture.locale"
"""The locale identifier following RFC 4646.

Type: str
Contains PII: maybe
Defined in OTEL: No
Example: "en-US"
"""

# Path: model/attributes/culture/culture__timezone.json
CULTURE_TIMEZONE: Literal["culture.timezone"] = "culture.timezone"
"""The timezone of the culture, as a geographic timezone identifier.

Type: str
Contains PII: maybe
Defined in OTEL: No
Example: "Europe/Vienna"
"""

# Path: model/attributes/db/db__collection__name.json
DB_COLLECTION_NAME: Literal["db.collection.name"] = "db.collection.name"
"""The name of a collection (table, container) within the database.
Expand Down Expand Up @@ -5325,6 +5377,41 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
reason="code.function.name should include the namespace.",
),
),
"culture.calendar": AttributeMetadata(
brief="The calendar system used by the culture.",
type=AttributeType.STRING,
pii=PiiInfo(isPii=IsPii.MAYBE),
is_in_otel=False,
example="GregorianCalendar",
),
"culture.display_name": AttributeMetadata(
brief="Human readable name of the culture.",
type=AttributeType.STRING,
pii=PiiInfo(isPii=IsPii.MAYBE),
is_in_otel=False,
example="English (United States)",
),
"culture.is_24_hour_format": AttributeMetadata(
brief="Whether the culture uses 24-hour time format.",
type=AttributeType.BOOLEAN,
pii=PiiInfo(isPii=IsPii.MAYBE),
is_in_otel=False,
example=True,
),
"culture.locale": AttributeMetadata(
brief="The locale identifier following RFC 4646.",
type=AttributeType.STRING,
pii=PiiInfo(isPii=IsPii.MAYBE),
is_in_otel=False,
example="en-US",
),
"culture.timezone": AttributeMetadata(
brief="The timezone of the culture, as a geographic timezone identifier.",
type=AttributeType.STRING,
pii=PiiInfo(isPii=IsPii.MAYBE),
is_in_otel=False,
example="Europe/Vienna",
),
"db.collection.name": AttributeMetadata(
brief="The name of a collection (table, container) within the database.",
type=AttributeType.STRING,
Expand Down Expand Up @@ -8210,6 +8297,11 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
"code.line.number": int,
"code.lineno": int,
"code.namespace": str,
"culture.calendar": str,
"culture.display_name": str,
"culture.is_24_hour_format": bool,
"culture.locale": str,
"culture.timezone": str,
"db.collection.name": str,
"db.name": str,
"db.namespace": str,
Expand Down
Loading