From c84859656b22bceb330ecd8cf055590816d39b89 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 27 Jul 2026 09:32:50 +0200 Subject: [PATCH 1/4] feat(attributes): Add code, deprecated in favor of rpc.response.status_code --- .../sentry-conventions/src/attributes.ts | 52 +++++++++++++++++-- model/attributes/code.json | 23 ++++++++ .../rpc/rpc__grpc__status_code.json | 2 +- .../rpc/rpc__response__status_code.json | 2 +- python/src/sentry_conventions/attributes.py | 41 +++++++++++++-- 5 files changed, 110 insertions(+), 10 deletions(-) create mode 100644 model/attributes/code.json diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 3916ccec..8ae09bb0 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -4130,6 +4130,30 @@ export const CLS_SOURCE_KEY_BASE = 'cls.source'; */ export type CLS_SOURCE_KEY_TYPE = string; +// Path: model/attributes/code.json + +/** + * Status code of the RPC returned by the RPC server or generated by the client. `code` + * + * Attribute Value Type: `number` {@link CODE_TYPE} + * + * Apply Scrubbing: manual + * + * Attribute defined in OTEL: No + * Visibility: public + * + * Aliases: {@link RPC_GRPC_STATUS_CODE} `rpc.grpc.status_code`, {@link RPC_RESPONSE_STATUS_CODE} `rpc.response.status_code` + * + * @deprecated Use {@link RPC_RESPONSE_STATUS_CODE} (rpc.response.status_code) instead + * @example 2 + */ +export const CODE = 'code'; + +/** + * Type for {@link CODE} code + */ +export type CODE_TYPE = number; + // Path: model/attributes/code/code__filepath.json /** @@ -12991,7 +13015,7 @@ export type ROUTE_TYPE = string; * Attribute defined in OTEL: Yes * Visibility: public * - * Aliases: {@link RPC_RESPONSE_STATUS_CODE} `rpc.response.status_code` + * Aliases: {@link CODE} `code`, {@link RPC_RESPONSE_STATUS_CODE} `rpc.response.status_code` * * @deprecated Use {@link RPC_RESPONSE_STATUS_CODE} (rpc.response.status_code) instead - Cannot be automatically backfilled due to type mismatch (integer vs string); rpc.grpc.status_code is a numeric gRPC status code while rpc.response.status_code is the string status name. * @example 2 @@ -13036,7 +13060,7 @@ export type RPC_METHOD_TYPE = string; * Attribute defined in OTEL: Yes * Visibility: public * - * Aliases: {@link RPC_GRPC_STATUS_CODE} `rpc.grpc.status_code` + * Aliases: {@link CODE} `code`, {@link RPC_GRPC_STATUS_CODE} `rpc.grpc.status_code` * * @example "DEADLINE_EXCEEDED" */ @@ -17420,6 +17444,7 @@ export const ATTRIBUTE_TYPE: Record = { 'cloud.resource_id': 'string', cls: 'double', 'cls.source.': 'string', + code: 'integer', 'code.filepath': 'string', 'code.file.path': 'string', 'code.function': 'string', @@ -18196,6 +18221,7 @@ export type AttributeName = | typeof CLOUD_RESOURCE_ID | typeof CLS | typeof CLS_SOURCE_KEY + | typeof CODE | typeof CODE_FILEPATH | typeof CODE_FILE_PATH | typeof CODE_FUNCTION @@ -21327,6 +21353,23 @@ export const ATTRIBUTE_METADATA: Record = { aliases: ['browser.web_vital.cls.source.'], changelog: [{ version: '0.5.0', prs: [234] }], }, + code: { + brief: 'Status code of the RPC returned by the RPC server or generated by the client.', + type: 'integer', + applyScrubbing: { + key: 'manual', + }, + isInOtel: false, + visibility: 'public', + example: 2, + examples: [2], + deprecation: { + replacement: 'rpc.response.status_code', + status: 'backfill', + }, + aliases: ['rpc.grpc.status_code', 'rpc.response.status_code'], + changelog: [{ version: 'next', prs: [529], description: 'Added code attribute' }], + }, 'code.filepath': { brief: 'The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).', @@ -26960,7 +27003,7 @@ export const ATTRIBUTE_METADATA: Record = { reason: 'Cannot be automatically backfilled due to type mismatch (integer vs string); rpc.grpc.status_code is a numeric gRPC status code while rpc.response.status_code is the string status name.', }, - aliases: ['rpc.response.status_code'], + aliases: ['code', 'rpc.response.status_code'], changelog: [ { version: 'next', description: 'Deprecated rpc.grpc.status_code in favor of rpc.response.status_code' }, { version: '0.4.0', prs: [228] }, @@ -26987,7 +27030,7 @@ export const ATTRIBUTE_METADATA: Record = { isInOtel: true, visibility: 'public', example: 'DEADLINE_EXCEEDED', - aliases: ['rpc.grpc.status_code'], + aliases: ['code', 'rpc.grpc.status_code'], changelog: [ { version: 'next', description: 'Added rpc.grpc.status_code as an alias' }, { version: '0.7.0', prs: [352], description: 'Added rpc.response.status_code attribute' }, @@ -29615,6 +29658,7 @@ export type Attributes = { [CLOUD_RESOURCE_ID]?: CLOUD_RESOURCE_ID_TYPE; [CLS]?: CLS_TYPE; [CLS_SOURCE_KEY]?: CLS_SOURCE_KEY_TYPE; + [CODE]?: CODE_TYPE; [CODE_FILEPATH]?: CODE_FILEPATH_TYPE; [CODE_FILE_PATH]?: CODE_FILE_PATH_TYPE; [CODE_FUNCTION]?: CODE_FUNCTION_TYPE; diff --git a/model/attributes/code.json b/model/attributes/code.json new file mode 100644 index 00000000..4bf6466e --- /dev/null +++ b/model/attributes/code.json @@ -0,0 +1,23 @@ +{ + "key": "code", + "brief": "Status code of the RPC returned by the RPC server or generated by the client.", + "type": "integer", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": false, + "visibility": "public", + "examples": [2], + "alias": ["rpc.grpc.status_code", "rpc.response.status_code"], + "deprecation": { + "_status": "backfill", + "replacement": "rpc.response.status_code" + }, + "changelog": [ + { + "version": "next", + "prs": [529], + "description": "Added code attribute" + } + ] +} diff --git a/model/attributes/rpc/rpc__grpc__status_code.json b/model/attributes/rpc/rpc__grpc__status_code.json index 40407457..41225ba5 100644 --- a/model/attributes/rpc/rpc__grpc__status_code.json +++ b/model/attributes/rpc/rpc__grpc__status_code.json @@ -7,7 +7,7 @@ }, "is_in_otel": true, "example": 2, - "alias": ["rpc.response.status_code"], + "alias": ["code", "rpc.response.status_code"], "deprecation": { "_status": null, "replacement": "rpc.response.status_code", diff --git a/model/attributes/rpc/rpc__response__status_code.json b/model/attributes/rpc/rpc__response__status_code.json index 9580ea34..3da42bf6 100644 --- a/model/attributes/rpc/rpc__response__status_code.json +++ b/model/attributes/rpc/rpc__response__status_code.json @@ -7,7 +7,7 @@ }, "is_in_otel": true, "example": "DEADLINE_EXCEEDED", - "alias": ["rpc.grpc.status_code"], + "alias": ["code", "rpc.grpc.status_code"], "visibility": "public", "changelog": [ { diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 49a20210..dad33fdf 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -175,6 +175,7 @@ class _AttributeNamesMeta(type): "CLS", "CODE_FILEPATH", "CODE_LINENO", + "CODE", "CONNECTION_RTT", "CONNECTIONTYPE", "DB_MONGODB_COLLECTION", @@ -2775,6 +2776,19 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "http.handler" """ + # Path: model/attributes/code.json + CODE: Literal["code"] = "code" + """Status code of the RPC returned by the RPC server or generated by the client. + + Type: int + Apply Scrubbing: manual + Defined in OTEL: No + Visibility: public + Aliases: rpc.grpc.status_code, rpc.response.status_code + DEPRECATED: Use rpc.response.status_code instead + Example: 2 + """ + # Path: model/attributes/connection/connection__rtt.json CONNECTION_RTT: Literal["connection.rtt"] = "connection.rtt" """Specifies the estimated effective round-trip time of the current connection, in milliseconds. @@ -7633,7 +7647,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Apply Scrubbing: manual Defined in OTEL: Yes Visibility: public - Aliases: rpc.response.status_code + Aliases: code, rpc.response.status_code DEPRECATED: Use rpc.response.status_code instead - Cannot be automatically backfilled due to type mismatch (integer vs string); rpc.grpc.status_code is a numeric gRPC status code while rpc.response.status_code is the string status name. Example: 2 """ @@ -7659,7 +7673,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Apply Scrubbing: manual Defined in OTEL: Yes Visibility: public - Aliases: rpc.grpc.status_code + Aliases: code, rpc.grpc.status_code Example: "DEADLINE_EXCEEDED" """ @@ -12853,6 +12867,24 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ChangelogEntry(version="0.0.0"), ], ), + "code": AttributeMetadata( + brief="Status code of the RPC returned by the RPC server or generated by the client.", + type=AttributeType.INTEGER, + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example=2, + examples=[2], + deprecation=DeprecationInfo( + replacement="rpc.response.status_code", status=DeprecationStatus.BACKFILL + ), + aliases=["rpc.grpc.status_code", "rpc.response.status_code"], + changelog=[ + ChangelogEntry( + version="next", prs=[529], description="Added code attribute" + ), + ], + ), "connection.rtt": AttributeMetadata( brief="Specifies the estimated effective round-trip time of the current connection, in milliseconds.", type=AttributeType.INTEGER, @@ -18745,7 +18777,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): replacement="rpc.response.status_code", reason="Cannot be automatically backfilled due to type mismatch (integer vs string); rpc.grpc.status_code is a numeric gRPC status code while rpc.response.status_code is the string status name.", ), - aliases=["rpc.response.status_code"], + aliases=["code", "rpc.response.status_code"], changelog=[ ChangelogEntry( version="next", @@ -18775,7 +18807,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): is_in_otel=True, visibility=Visibility.PUBLIC, example="DEADLINE_EXCEEDED", - aliases=["rpc.grpc.status_code"], + aliases=["code", "rpc.grpc.status_code"], changelog=[ ChangelogEntry( version="next", description="Added rpc.grpc.status_code as an alias" @@ -21515,6 +21547,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "code.line.number": int, "code.lineno": int, "code.namespace": str, + "code": int, "connection.rtt": int, "connectionType": str, "culture.calendar": str, From a6b7e55e1fa989cb4bf1639c24380b9e0311c524 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 27 Jul 2026 09:38:33 +0200 Subject: [PATCH 2/4] change type to string --- javascript/sentry-conventions/src/attributes.ts | 8 ++++---- model/attributes/code.json | 2 +- python/src/sentry_conventions/attributes.py | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 8ae09bb0..ddeb4f99 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -4135,7 +4135,7 @@ export type CLS_SOURCE_KEY_TYPE = string; /** * Status code of the RPC returned by the RPC server or generated by the client. `code` * - * Attribute Value Type: `number` {@link CODE_TYPE} + * Attribute Value Type: `string` {@link CODE_TYPE} * * Apply Scrubbing: manual * @@ -4152,7 +4152,7 @@ export const CODE = 'code'; /** * Type for {@link CODE} code */ -export type CODE_TYPE = number; +export type CODE_TYPE = string; // Path: model/attributes/code/code__filepath.json @@ -17444,7 +17444,7 @@ export const ATTRIBUTE_TYPE: Record = { 'cloud.resource_id': 'string', cls: 'double', 'cls.source.': 'string', - code: 'integer', + code: 'string', 'code.filepath': 'string', 'code.file.path': 'string', 'code.function': 'string', @@ -21355,7 +21355,7 @@ export const ATTRIBUTE_METADATA: Record = { }, code: { brief: 'Status code of the RPC returned by the RPC server or generated by the client.', - type: 'integer', + type: 'string', applyScrubbing: { key: 'manual', }, diff --git a/model/attributes/code.json b/model/attributes/code.json index 4bf6466e..e7ce4d3c 100644 --- a/model/attributes/code.json +++ b/model/attributes/code.json @@ -1,7 +1,7 @@ { "key": "code", "brief": "Status code of the RPC returned by the RPC server or generated by the client.", - "type": "integer", + "type": "string", "apply_scrubbing": { "key": "manual" }, diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index dad33fdf..face49b4 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -2780,7 +2780,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): CODE: Literal["code"] = "code" """Status code of the RPC returned by the RPC server or generated by the client. - Type: int + Type: str Apply Scrubbing: manual Defined in OTEL: No Visibility: public @@ -12869,7 +12869,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ), "code": AttributeMetadata( brief="Status code of the RPC returned by the RPC server or generated by the client.", - type=AttributeType.INTEGER, + type=AttributeType.STRING, apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=False, visibility=Visibility.PUBLIC, @@ -21547,7 +21547,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "code.line.number": int, "code.lineno": int, "code.namespace": str, - "code": int, + "code": str, "connection.rtt": int, "connectionType": str, "culture.calendar": str, From 7989c93f5f500afcb7da11fbf4c48136570ebdc2 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 27 Jul 2026 09:45:59 +0200 Subject: [PATCH 3/4] fix example and add changelog --- javascript/sentry-conventions/src/attributes.ts | 8 ++++---- model/attributes/code.json | 2 +- model/attributes/rpc/rpc__response__status_code.json | 2 +- python/src/sentry_conventions/attributes.py | 9 +++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index ddeb4f99..dc30f0e3 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -4145,7 +4145,7 @@ export type CLS_SOURCE_KEY_TYPE = string; * Aliases: {@link RPC_GRPC_STATUS_CODE} `rpc.grpc.status_code`, {@link RPC_RESPONSE_STATUS_CODE} `rpc.response.status_code` * * @deprecated Use {@link RPC_RESPONSE_STATUS_CODE} (rpc.response.status_code) instead - * @example 2 + * @example "DEADLINE_EXCEEDED" */ export const CODE = 'code'; @@ -21361,8 +21361,8 @@ export const ATTRIBUTE_METADATA: Record = { }, isInOtel: false, visibility: 'public', - example: 2, - examples: [2], + example: 'DEADLINE_EXCEEDED', + examples: ['DEADLINE_EXCEEDED'], deprecation: { replacement: 'rpc.response.status_code', status: 'backfill', @@ -27032,7 +27032,7 @@ export const ATTRIBUTE_METADATA: Record = { example: 'DEADLINE_EXCEEDED', aliases: ['code', 'rpc.grpc.status_code'], changelog: [ - { version: 'next', description: 'Added rpc.grpc.status_code as an alias' }, + { version: 'next', description: 'Added code and rpc.grpc.status_code as aliases' }, { version: '0.7.0', prs: [352], description: 'Added rpc.response.status_code attribute' }, ], }, diff --git a/model/attributes/code.json b/model/attributes/code.json index e7ce4d3c..e222bd61 100644 --- a/model/attributes/code.json +++ b/model/attributes/code.json @@ -7,7 +7,7 @@ }, "is_in_otel": false, "visibility": "public", - "examples": [2], + "examples": ["DEADLINE_EXCEEDED"], "alias": ["rpc.grpc.status_code", "rpc.response.status_code"], "deprecation": { "_status": "backfill", diff --git a/model/attributes/rpc/rpc__response__status_code.json b/model/attributes/rpc/rpc__response__status_code.json index 3da42bf6..ce059172 100644 --- a/model/attributes/rpc/rpc__response__status_code.json +++ b/model/attributes/rpc/rpc__response__status_code.json @@ -12,7 +12,7 @@ "changelog": [ { "version": "next", - "description": "Added rpc.grpc.status_code as an alias" + "description": "Added code and rpc.grpc.status_code as aliases" }, { "version": "0.7.0", diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index face49b4..3149ed0e 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -2786,7 +2786,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Visibility: public Aliases: rpc.grpc.status_code, rpc.response.status_code DEPRECATED: Use rpc.response.status_code instead - Example: 2 + Example: "DEADLINE_EXCEEDED" """ # Path: model/attributes/connection/connection__rtt.json @@ -12873,8 +12873,8 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=False, visibility=Visibility.PUBLIC, - example=2, - examples=[2], + example="DEADLINE_EXCEEDED", + examples=["DEADLINE_EXCEEDED"], deprecation=DeprecationInfo( replacement="rpc.response.status_code", status=DeprecationStatus.BACKFILL ), @@ -18810,7 +18810,8 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): aliases=["code", "rpc.grpc.status_code"], changelog=[ ChangelogEntry( - version="next", description="Added rpc.grpc.status_code as an alias" + version="next", + description="Added code and rpc.grpc.status_code as aliases", ), ChangelogEntry( version="0.7.0", From 54c535f904284a0c62786315b4a46fd2b1e15c7f Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 27 Jul 2026 12:56:55 +0200 Subject: [PATCH 4/4] update pr number --- javascript/sentry-conventions/src/attributes.ts | 2 +- model/attributes/code.json | 2 +- python/src/sentry_conventions/attributes.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index dc30f0e3..7ee05297 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -21368,7 +21368,7 @@ export const ATTRIBUTE_METADATA: Record = { status: 'backfill', }, aliases: ['rpc.grpc.status_code', 'rpc.response.status_code'], - changelog: [{ version: 'next', prs: [529], description: 'Added code attribute' }], + changelog: [{ version: 'next', prs: [533], description: 'Added code attribute' }], }, 'code.filepath': { brief: diff --git a/model/attributes/code.json b/model/attributes/code.json index e222bd61..85004a57 100644 --- a/model/attributes/code.json +++ b/model/attributes/code.json @@ -16,7 +16,7 @@ "changelog": [ { "version": "next", - "prs": [529], + "prs": [533], "description": "Added code attribute" } ] diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 3149ed0e..34122b4a 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -12881,7 +12881,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): aliases=["rpc.grpc.status_code", "rpc.response.status_code"], changelog=[ ChangelogEntry( - version="next", prs=[529], description="Added code attribute" + version="next", prs=[533], description="Added code attribute" ), ], ),