Skip to content

Commit 763b56d

Browse files
authored
feat: Add Culture context model attributes (#243)
* feat: add culture model attributes * chore: generate files * fix: define PII as maybe * chore: delete the generated files
1 parent 99d3e68 commit 763b56d

File tree

7 files changed

+302
-0
lines changed

7 files changed

+302
-0
lines changed

javascript/sentry-conventions/src/attributes.ts

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,106 @@ export const CODE_NAMESPACE = 'code.namespace';
12561256
*/
12571257
export type CODE_NAMESPACE_TYPE = string;
12581258

1259+
// Path: model/attributes/culture/culture__calendar.json
1260+
1261+
/**
1262+
* The calendar system used by the culture. `culture.calendar`
1263+
*
1264+
* Attribute Value Type: `string` {@link CULTURE_CALENDAR_TYPE}
1265+
*
1266+
* Contains PII: maybe
1267+
*
1268+
* Attribute defined in OTEL: No
1269+
*
1270+
* @example "GregorianCalendar"
1271+
*/
1272+
export const CULTURE_CALENDAR = 'culture.calendar';
1273+
1274+
/**
1275+
* Type for {@link CULTURE_CALENDAR} culture.calendar
1276+
*/
1277+
export type CULTURE_CALENDAR_TYPE = string;
1278+
1279+
// Path: model/attributes/culture/culture__display_name.json
1280+
1281+
/**
1282+
* Human readable name of the culture. `culture.display_name`
1283+
*
1284+
* Attribute Value Type: `string` {@link CULTURE_DISPLAY_NAME_TYPE}
1285+
*
1286+
* Contains PII: maybe
1287+
*
1288+
* Attribute defined in OTEL: No
1289+
*
1290+
* @example "English (United States)"
1291+
*/
1292+
export const CULTURE_DISPLAY_NAME = 'culture.display_name';
1293+
1294+
/**
1295+
* Type for {@link CULTURE_DISPLAY_NAME} culture.display_name
1296+
*/
1297+
export type CULTURE_DISPLAY_NAME_TYPE = string;
1298+
1299+
// Path: model/attributes/culture/culture__is_24_hour_format.json
1300+
1301+
/**
1302+
* Whether the culture uses 24-hour time format. `culture.is_24_hour_format`
1303+
*
1304+
* Attribute Value Type: `boolean` {@link CULTURE_IS_24_HOUR_FORMAT_TYPE}
1305+
*
1306+
* Contains PII: maybe
1307+
*
1308+
* Attribute defined in OTEL: No
1309+
*
1310+
* @example true
1311+
*/
1312+
export const CULTURE_IS_24_HOUR_FORMAT = 'culture.is_24_hour_format';
1313+
1314+
/**
1315+
* Type for {@link CULTURE_IS_24_HOUR_FORMAT} culture.is_24_hour_format
1316+
*/
1317+
export type CULTURE_IS_24_HOUR_FORMAT_TYPE = boolean;
1318+
1319+
// Path: model/attributes/culture/culture__locale.json
1320+
1321+
/**
1322+
* The locale identifier following RFC 4646. `culture.locale`
1323+
*
1324+
* Attribute Value Type: `string` {@link CULTURE_LOCALE_TYPE}
1325+
*
1326+
* Contains PII: maybe
1327+
*
1328+
* Attribute defined in OTEL: No
1329+
*
1330+
* @example "en-US"
1331+
*/
1332+
export const CULTURE_LOCALE = 'culture.locale';
1333+
1334+
/**
1335+
* Type for {@link CULTURE_LOCALE} culture.locale
1336+
*/
1337+
export type CULTURE_LOCALE_TYPE = string;
1338+
1339+
// Path: model/attributes/culture/culture__timezone.json
1340+
1341+
/**
1342+
* The timezone of the culture, as a geographic timezone identifier. `culture.timezone`
1343+
*
1344+
* Attribute Value Type: `string` {@link CULTURE_TIMEZONE_TYPE}
1345+
*
1346+
* Contains PII: maybe
1347+
*
1348+
* Attribute defined in OTEL: No
1349+
*
1350+
* @example "Europe/Vienna"
1351+
*/
1352+
export const CULTURE_TIMEZONE = 'culture.timezone';
1353+
1354+
/**
1355+
* Type for {@link CULTURE_TIMEZONE} culture.timezone
1356+
*/
1357+
export type CULTURE_TIMEZONE_TYPE = string;
1358+
12591359
// Path: model/attributes/db/db__collection__name.json
12601360

12611361
/**
@@ -8927,6 +9027,11 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
89279027
[CODE_LINENO]: 'integer',
89289028
[CODE_LINE_NUMBER]: 'integer',
89299029
[CODE_NAMESPACE]: 'string',
9030+
[CULTURE_CALENDAR]: 'string',
9031+
[CULTURE_DISPLAY_NAME]: 'string',
9032+
[CULTURE_IS_24_HOUR_FORMAT]: 'boolean',
9033+
[CULTURE_LOCALE]: 'string',
9034+
[CULTURE_TIMEZONE]: 'string',
89309035
[DB_COLLECTION_NAME]: 'string',
89319036
[DB_NAME]: 'string',
89329037
[DB_NAMESPACE]: 'string',
@@ -9355,6 +9460,11 @@ export type AttributeName =
93559460
| typeof CODE_LINENO
93569461
| typeof CODE_LINE_NUMBER
93579462
| typeof CODE_NAMESPACE
9463+
| typeof CULTURE_CALENDAR
9464+
| typeof CULTURE_DISPLAY_NAME
9465+
| typeof CULTURE_IS_24_HOUR_FORMAT
9466+
| typeof CULTURE_LOCALE
9467+
| typeof CULTURE_TIMEZONE
93589468
| typeof DB_COLLECTION_NAME
93599469
| typeof DB_NAME
93609470
| typeof DB_NAMESPACE
@@ -10384,6 +10494,51 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
1038410494
reason: 'code.function.name should include the namespace.',
1038510495
},
1038610496
},
10497+
[CULTURE_CALENDAR]: {
10498+
brief: 'The calendar system used by the culture.',
10499+
type: 'string',
10500+
pii: {
10501+
isPii: 'maybe',
10502+
},
10503+
isInOtel: false,
10504+
example: 'GregorianCalendar',
10505+
},
10506+
[CULTURE_DISPLAY_NAME]: {
10507+
brief: 'Human readable name of the culture.',
10508+
type: 'string',
10509+
pii: {
10510+
isPii: 'maybe',
10511+
},
10512+
isInOtel: false,
10513+
example: 'English (United States)',
10514+
},
10515+
[CULTURE_IS_24_HOUR_FORMAT]: {
10516+
brief: 'Whether the culture uses 24-hour time format.',
10517+
type: 'boolean',
10518+
pii: {
10519+
isPii: 'maybe',
10520+
},
10521+
isInOtel: false,
10522+
example: true,
10523+
},
10524+
[CULTURE_LOCALE]: {
10525+
brief: 'The locale identifier following RFC 4646.',
10526+
type: 'string',
10527+
pii: {
10528+
isPii: 'maybe',
10529+
},
10530+
isInOtel: false,
10531+
example: 'en-US',
10532+
},
10533+
[CULTURE_TIMEZONE]: {
10534+
brief: 'The timezone of the culture, as a geographic timezone identifier.',
10535+
type: 'string',
10536+
pii: {
10537+
isPii: 'maybe',
10538+
},
10539+
isInOtel: false,
10540+
example: 'Europe/Vienna',
10541+
},
1038710542
[DB_COLLECTION_NAME]: {
1038810543
brief: 'The name of a collection (table, container) within the database.',
1038910544
type: 'string',
@@ -14138,6 +14293,11 @@ export type Attributes = {
1413814293
[CODE_LINENO]?: CODE_LINENO_TYPE;
1413914294
[CODE_LINE_NUMBER]?: CODE_LINE_NUMBER_TYPE;
1414014295
[CODE_NAMESPACE]?: CODE_NAMESPACE_TYPE;
14296+
[CULTURE_CALENDAR]?: CULTURE_CALENDAR_TYPE;
14297+
[CULTURE_DISPLAY_NAME]?: CULTURE_DISPLAY_NAME_TYPE;
14298+
[CULTURE_IS_24_HOUR_FORMAT]?: CULTURE_IS_24_HOUR_FORMAT_TYPE;
14299+
[CULTURE_LOCALE]?: CULTURE_LOCALE_TYPE;
14300+
[CULTURE_TIMEZONE]?: CULTURE_TIMEZONE_TYPE;
1414114301
[DB_COLLECTION_NAME]?: DB_COLLECTION_NAME_TYPE;
1414214302
[DB_NAME]?: DB_NAME_TYPE;
1414314303
[DB_NAMESPACE]?: DB_NAMESPACE_TYPE;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"key": "culture.calendar",
3+
"brief": "The calendar system used by the culture.",
4+
"type": "string",
5+
"pii": {
6+
"key": "maybe"
7+
},
8+
"is_in_otel": false,
9+
"example": "GregorianCalendar"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"key": "culture.display_name",
3+
"brief": "Human readable name of the culture.",
4+
"type": "string",
5+
"pii": {
6+
"key": "maybe"
7+
},
8+
"is_in_otel": false,
9+
"example": "English (United States)"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"key": "culture.is_24_hour_format",
3+
"brief": "Whether the culture uses 24-hour time format.",
4+
"type": "boolean",
5+
"pii": {
6+
"key": "maybe"
7+
},
8+
"is_in_otel": false,
9+
"example": true
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"key": "culture.locale",
3+
"brief": "The locale identifier following RFC 4646.",
4+
"type": "string",
5+
"pii": {
6+
"key": "maybe"
7+
},
8+
"is_in_otel": false,
9+
"example": "en-US"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"key": "culture.timezone",
3+
"brief": "The timezone of the culture, as a geographic timezone identifier.",
4+
"type": "string",
5+
"pii": {
6+
"key": "maybe"
7+
},
8+
"is_in_otel": false,
9+
"example": "Europe/Vienna"
10+
}

python/src/sentry_conventions/attributes.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,58 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
830830
Example: "http.handler"
831831
"""
832832

833+
# Path: model/attributes/culture/culture__calendar.json
834+
CULTURE_CALENDAR: Literal["culture.calendar"] = "culture.calendar"
835+
"""The calendar system used by the culture.
836+
837+
Type: str
838+
Contains PII: maybe
839+
Defined in OTEL: No
840+
Example: "GregorianCalendar"
841+
"""
842+
843+
# Path: model/attributes/culture/culture__display_name.json
844+
CULTURE_DISPLAY_NAME: Literal["culture.display_name"] = "culture.display_name"
845+
"""Human readable name of the culture.
846+
847+
Type: str
848+
Contains PII: maybe
849+
Defined in OTEL: No
850+
Example: "English (United States)"
851+
"""
852+
853+
# Path: model/attributes/culture/culture__is_24_hour_format.json
854+
CULTURE_IS_24_HOUR_FORMAT: Literal["culture.is_24_hour_format"] = (
855+
"culture.is_24_hour_format"
856+
)
857+
"""Whether the culture uses 24-hour time format.
858+
859+
Type: bool
860+
Contains PII: maybe
861+
Defined in OTEL: No
862+
Example: true
863+
"""
864+
865+
# Path: model/attributes/culture/culture__locale.json
866+
CULTURE_LOCALE: Literal["culture.locale"] = "culture.locale"
867+
"""The locale identifier following RFC 4646.
868+
869+
Type: str
870+
Contains PII: maybe
871+
Defined in OTEL: No
872+
Example: "en-US"
873+
"""
874+
875+
# Path: model/attributes/culture/culture__timezone.json
876+
CULTURE_TIMEZONE: Literal["culture.timezone"] = "culture.timezone"
877+
"""The timezone of the culture, as a geographic timezone identifier.
878+
879+
Type: str
880+
Contains PII: maybe
881+
Defined in OTEL: No
882+
Example: "Europe/Vienna"
883+
"""
884+
833885
# Path: model/attributes/db/db__collection__name.json
834886
DB_COLLECTION_NAME: Literal["db.collection.name"] = "db.collection.name"
835887
"""The name of a collection (table, container) within the database.
@@ -5335,6 +5387,41 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
53355387
reason="code.function.name should include the namespace.",
53365388
),
53375389
),
5390+
"culture.calendar": AttributeMetadata(
5391+
brief="The calendar system used by the culture.",
5392+
type=AttributeType.STRING,
5393+
pii=PiiInfo(isPii=IsPii.MAYBE),
5394+
is_in_otel=False,
5395+
example="GregorianCalendar",
5396+
),
5397+
"culture.display_name": AttributeMetadata(
5398+
brief="Human readable name of the culture.",
5399+
type=AttributeType.STRING,
5400+
pii=PiiInfo(isPii=IsPii.MAYBE),
5401+
is_in_otel=False,
5402+
example="English (United States)",
5403+
),
5404+
"culture.is_24_hour_format": AttributeMetadata(
5405+
brief="Whether the culture uses 24-hour time format.",
5406+
type=AttributeType.BOOLEAN,
5407+
pii=PiiInfo(isPii=IsPii.MAYBE),
5408+
is_in_otel=False,
5409+
example=True,
5410+
),
5411+
"culture.locale": AttributeMetadata(
5412+
brief="The locale identifier following RFC 4646.",
5413+
type=AttributeType.STRING,
5414+
pii=PiiInfo(isPii=IsPii.MAYBE),
5415+
is_in_otel=False,
5416+
example="en-US",
5417+
),
5418+
"culture.timezone": AttributeMetadata(
5419+
brief="The timezone of the culture, as a geographic timezone identifier.",
5420+
type=AttributeType.STRING,
5421+
pii=PiiInfo(isPii=IsPii.MAYBE),
5422+
is_in_otel=False,
5423+
example="Europe/Vienna",
5424+
),
53385425
"db.collection.name": AttributeMetadata(
53395426
brief="The name of a collection (table, container) within the database.",
53405427
type=AttributeType.STRING,
@@ -8227,6 +8314,11 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
82278314
"code.line.number": int,
82288315
"code.lineno": int,
82298316
"code.namespace": str,
8317+
"culture.calendar": str,
8318+
"culture.display_name": str,
8319+
"culture.is_24_hour_format": bool,
8320+
"culture.locale": str,
8321+
"culture.timezone": str,
82308322
"db.collection.name": str,
82318323
"db.name": str,
82328324
"db.namespace": str,

0 commit comments

Comments
 (0)