diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 9341649d..1af5a2e5 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -4180,6 +4180,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: `string` {@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 "DEADLINE_EXCEEDED" + */ +export const CODE = 'code'; + +/** + * Type for {@link CODE} code + */ +export type CODE_TYPE = string; + // Path: model/attributes/code/code__filepath.json /** @@ -13137,7 +13161,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 @@ -13182,7 +13206,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" */ @@ -17566,6 +17590,7 @@ export const ATTRIBUTE_TYPE: Record = { 'cloud.resource_id': 'string', cls: 'double', 'cls.source.': 'string', + code: 'string', 'code.filepath': 'string', 'code.file.path': 'string', 'code.function': 'string', @@ -18348,6 +18373,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 @@ -21525,6 +21551,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: 'string', + applyScrubbing: { + key: 'manual', + }, + isInOtel: false, + visibility: 'public', + example: 'DEADLINE_EXCEEDED', + examples: ['DEADLINE_EXCEEDED'], + deprecation: { + replacement: 'rpc.response.status_code', + status: 'backfill', + }, + aliases: ['rpc.grpc.status_code', 'rpc.response.status_code'], + changelog: [{ version: 'next', prs: [533], 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).', @@ -27271,7 +27314,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] }, @@ -27298,9 +27341,9 @@ 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: 'next', description: 'Added code and rpc.grpc.status_code as aliases' }, { version: '0.7.0', prs: [352], description: 'Added rpc.response.status_code attribute' }, ], }, @@ -29944,6 +29987,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..85004a57 --- /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": "string", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": false, + "visibility": "public", + "examples": ["DEADLINE_EXCEEDED"], + "alias": ["rpc.grpc.status_code", "rpc.response.status_code"], + "deprecation": { + "_status": "backfill", + "replacement": "rpc.response.status_code" + }, + "changelog": [ + { + "version": "next", + "prs": [533], + "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..ce059172 100644 --- a/model/attributes/rpc/rpc__response__status_code.json +++ b/model/attributes/rpc/rpc__response__status_code.json @@ -7,12 +7,12 @@ }, "is_in_otel": true, "example": "DEADLINE_EXCEEDED", - "alias": ["rpc.grpc.status_code"], + "alias": ["code", "rpc.grpc.status_code"], "visibility": "public", "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 b132d5ca..f10ded38 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -177,6 +177,7 @@ class _AttributeNamesMeta(type): "CLS", "CODE_FILEPATH", "CODE_LINENO", + "CODE", "CONNECTION_RTT", "CONNECTIONTYPE", "DB_MONGODB_COLLECTION", @@ -2808,6 +2809,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: str + 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: "DEADLINE_EXCEEDED" + """ + # 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. @@ -7718,7 +7732,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 """ @@ -7744,7 +7758,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" """ @@ -12994,6 +13008,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.STRING, + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example="DEADLINE_EXCEEDED", + examples=["DEADLINE_EXCEEDED"], + deprecation=DeprecationInfo( + replacement="rpc.response.status_code", status=DeprecationStatus.BACKFILL + ), + aliases=["rpc.grpc.status_code", "rpc.response.status_code"], + changelog=[ + ChangelogEntry( + version="next", prs=[533], description="Added code attribute" + ), + ], + ), "connection.rtt": AttributeMetadata( brief="Specifies the estimated effective round-trip time of the current connection, in milliseconds.", type=AttributeType.INTEGER, @@ -18993,7 +19025,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", @@ -19023,10 +19055,11 @@ 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" + version="next", + description="Added code and rpc.grpc.status_code as aliases", ), ChangelogEntry( version="0.7.0", @@ -21785,6 +21818,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "code.line.number": int, "code.lineno": int, "code.namespace": str, + "code": str, "connection.rtt": int, "connectionType": str, "culture.calendar": str,