From 2104779c8291cd32a9be472cad8f5ebe8fc50ea8 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Fri, 15 May 2026 16:36:04 +0200 Subject: [PATCH] feat(attributes): Add runtime context attributes Add top-level runtime.* attributes mapping to the Sentry runtime context: runtime.name, runtime.version, runtime.build, and runtime.raw_description. Co-Authored-By: Claude Opus 4.6 --- .../sentry-conventions/src/attributes.ts | 133 ++++++++++++++++++ model/attributes/runtime/runtime__build.json | 17 +++ model/attributes/runtime/runtime__name.json | 17 +++ .../runtime/runtime__raw_description.json | 17 +++ .../attributes/runtime/runtime__version.json | 17 +++ python/src/sentry_conventions/attributes.py | 96 +++++++++++++ 6 files changed, 297 insertions(+) create mode 100644 model/attributes/runtime/runtime__build.json create mode 100644 model/attributes/runtime/runtime__name.json create mode 100644 model/attributes/runtime/runtime__raw_description.json create mode 100644 model/attributes/runtime/runtime__version.json diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 8e7aa029..4f8921bd 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -8933,6 +8933,86 @@ export const RPC_SERVICE = 'rpc.service'; */ export type RPC_SERVICE_TYPE = string; +// Path: model/attributes/runtime/runtime__build.json + +/** + * The application build string, when it is separate from the version. `runtime.build` + * + * Attribute Value Type: `string` {@link RUNTIME_BUILD_TYPE} + * + * Contains PII: maybe + * + * Attribute defined in OTEL: No + * + * @example "stable" + */ +export const RUNTIME_BUILD = 'runtime.build'; + +/** + * Type for {@link RUNTIME_BUILD} runtime.build + */ +export type RUNTIME_BUILD_TYPE = string; + +// Path: model/attributes/runtime/runtime__name.json + +/** + * The name of the runtime. For example node, CPython, or rustc. `runtime.name` + * + * Attribute Value Type: `string` {@link RUNTIME_NAME_TYPE} + * + * Contains PII: maybe + * + * Attribute defined in OTEL: No + * + * @example "node" + */ +export const RUNTIME_NAME = 'runtime.name'; + +/** + * Type for {@link RUNTIME_NAME} runtime.name + */ +export type RUNTIME_NAME_TYPE = string; + +// Path: model/attributes/runtime/runtime__raw_description.json + +/** + * Unprocessed description string as obtained from the runtime. Used to extract name and version for well-known runtimes. `runtime.raw_description` + * + * Attribute Value Type: `string` {@link RUNTIME_RAW_DESCRIPTION_TYPE} + * + * Contains PII: maybe + * + * Attribute defined in OTEL: No + * + * @example "Eclipse OpenJ9 VM openj9-0.21.0" + */ +export const RUNTIME_RAW_DESCRIPTION = 'runtime.raw_description'; + +/** + * Type for {@link RUNTIME_RAW_DESCRIPTION} runtime.raw_description + */ +export type RUNTIME_RAW_DESCRIPTION_TYPE = string; + +// Path: model/attributes/runtime/runtime__version.json + +/** + * The version of the runtime. `runtime.version` + * + * Attribute Value Type: `string` {@link RUNTIME_VERSION_TYPE} + * + * Contains PII: maybe + * + * Attribute defined in OTEL: No + * + * @example "18.04.2" + */ +export const RUNTIME_VERSION = 'runtime.version'; + +/** + * Type for {@link RUNTIME_VERSION} runtime.version + */ +export type RUNTIME_VERSION_TYPE = string; + // Path: model/attributes/score/score__[key].json /** @@ -12378,6 +12458,10 @@ export const ATTRIBUTE_TYPE: Record = { [RPC_METHOD]: 'string', [RPC_RESPONSE_STATUS_CODE]: 'string', [RPC_SERVICE]: 'string', + [RUNTIME_BUILD]: 'string', + [RUNTIME_NAME]: 'string', + [RUNTIME_RAW_DESCRIPTION]: 'string', + [RUNTIME_VERSION]: 'string', [SCORE_KEY]: 'double', [SCORE_RATIO_KEY]: 'double', [SCORE_TOTAL]: 'double', @@ -12948,6 +13032,10 @@ export type AttributeName = | typeof RPC_METHOD | typeof RPC_RESPONSE_STATUS_CODE | typeof RPC_SERVICE + | typeof RUNTIME_BUILD + | typeof RUNTIME_NAME + | typeof RUNTIME_RAW_DESCRIPTION + | typeof RUNTIME_VERSION | typeof SCORE_KEY | typeof SCORE_RATIO_KEY | typeof SCORE_TOTAL @@ -18463,6 +18551,47 @@ export const ATTRIBUTE_METADATA: Record = { example: 'myService.BestService', changelog: [{ version: '0.1.0', prs: [127] }, { version: '0.0.0' }], }, + [RUNTIME_BUILD]: { + brief: 'The application build string, when it is separate from the version.', + type: 'string', + pii: { + isPii: 'maybe', + }, + isInOtel: false, + example: 'stable', + changelog: [{ version: 'next', prs: [383], description: 'Added runtime.build attribute' }], + }, + [RUNTIME_NAME]: { + brief: 'The name of the runtime. For example node, CPython, or rustc.', + type: 'string', + pii: { + isPii: 'maybe', + }, + isInOtel: false, + example: 'node', + changelog: [{ version: 'next', prs: [383], description: 'Added runtime.name attribute' }], + }, + [RUNTIME_RAW_DESCRIPTION]: { + brief: + 'Unprocessed description string as obtained from the runtime. Used to extract name and version for well-known runtimes.', + type: 'string', + pii: { + isPii: 'maybe', + }, + isInOtel: false, + example: 'Eclipse OpenJ9 VM openj9-0.21.0', + changelog: [{ version: 'next', prs: [383], description: 'Added runtime.raw_description attribute' }], + }, + [RUNTIME_VERSION]: { + brief: 'The version of the runtime.', + type: 'string', + pii: { + isPii: 'maybe', + }, + isInOtel: false, + example: '18.04.2', + changelog: [{ version: 'next', prs: [383], description: 'Added runtime.version attribute' }], + }, [SCORE_KEY]: { brief: 'The weighted performance score for a web vital. This is defined as `score.weight.` * `score.ratio.`.', @@ -20494,6 +20623,10 @@ export type Attributes = { [RPC_METHOD]?: RPC_METHOD_TYPE; [RPC_RESPONSE_STATUS_CODE]?: RPC_RESPONSE_STATUS_CODE_TYPE; [RPC_SERVICE]?: RPC_SERVICE_TYPE; + [RUNTIME_BUILD]?: RUNTIME_BUILD_TYPE; + [RUNTIME_NAME]?: RUNTIME_NAME_TYPE; + [RUNTIME_RAW_DESCRIPTION]?: RUNTIME_RAW_DESCRIPTION_TYPE; + [RUNTIME_VERSION]?: RUNTIME_VERSION_TYPE; [SCORE_KEY]?: SCORE_KEY_TYPE; [SCORE_RATIO_KEY]?: SCORE_RATIO_KEY_TYPE; [SCORE_TOTAL]?: SCORE_TOTAL_TYPE; diff --git a/model/attributes/runtime/runtime__build.json b/model/attributes/runtime/runtime__build.json new file mode 100644 index 00000000..2659ba79 --- /dev/null +++ b/model/attributes/runtime/runtime__build.json @@ -0,0 +1,17 @@ +{ + "key": "runtime.build", + "brief": "The application build string, when it is separate from the version.", + "type": "string", + "pii": { + "key": "maybe" + }, + "is_in_otel": false, + "example": "stable", + "changelog": [ + { + "version": "next", + "prs": [383], + "description": "Added runtime.build attribute" + } + ] +} diff --git a/model/attributes/runtime/runtime__name.json b/model/attributes/runtime/runtime__name.json new file mode 100644 index 00000000..88b4b7bb --- /dev/null +++ b/model/attributes/runtime/runtime__name.json @@ -0,0 +1,17 @@ +{ + "key": "runtime.name", + "brief": "The name of the runtime. For example node, CPython, or rustc.", + "type": "string", + "pii": { + "key": "maybe" + }, + "is_in_otel": false, + "example": "node", + "changelog": [ + { + "version": "next", + "prs": [383], + "description": "Added runtime.name attribute" + } + ] +} diff --git a/model/attributes/runtime/runtime__raw_description.json b/model/attributes/runtime/runtime__raw_description.json new file mode 100644 index 00000000..1c53433e --- /dev/null +++ b/model/attributes/runtime/runtime__raw_description.json @@ -0,0 +1,17 @@ +{ + "key": "runtime.raw_description", + "brief": "Unprocessed description string as obtained from the runtime. Used to extract name and version for well-known runtimes.", + "type": "string", + "pii": { + "key": "maybe" + }, + "is_in_otel": false, + "example": "Eclipse OpenJ9 VM openj9-0.21.0", + "changelog": [ + { + "version": "next", + "prs": [383], + "description": "Added runtime.raw_description attribute" + } + ] +} diff --git a/model/attributes/runtime/runtime__version.json b/model/attributes/runtime/runtime__version.json new file mode 100644 index 00000000..4f870415 --- /dev/null +++ b/model/attributes/runtime/runtime__version.json @@ -0,0 +1,17 @@ +{ + "key": "runtime.version", + "brief": "The version of the runtime.", + "type": "string", + "pii": { + "key": "maybe" + }, + "is_in_otel": false, + "example": "18.04.2", + "changelog": [ + { + "version": "next", + "prs": [383], + "description": "Added runtime.version attribute" + } + ] +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 4100b101..08d39c11 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -5042,6 +5042,48 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "myService.BestService" """ + # Path: model/attributes/runtime/runtime__build.json + RUNTIME_BUILD: Literal["runtime.build"] = "runtime.build" + """The application build string, when it is separate from the version. + + Type: str + Contains PII: maybe + Defined in OTEL: No + Example: "stable" + """ + + # Path: model/attributes/runtime/runtime__name.json + RUNTIME_NAME: Literal["runtime.name"] = "runtime.name" + """The name of the runtime. For example node, CPython, or rustc. + + Type: str + Contains PII: maybe + Defined in OTEL: No + Example: "node" + """ + + # Path: model/attributes/runtime/runtime__raw_description.json + RUNTIME_RAW_DESCRIPTION: Literal["runtime.raw_description"] = ( + "runtime.raw_description" + ) + """Unprocessed description string as obtained from the runtime. Used to extract name and version for well-known runtimes. + + Type: str + Contains PII: maybe + Defined in OTEL: No + Example: "Eclipse OpenJ9 VM openj9-0.21.0" + """ + + # Path: model/attributes/runtime/runtime__version.json + RUNTIME_VERSION: Literal["runtime.version"] = "runtime.version" + """The version of the runtime. + + Type: str + Contains PII: maybe + Defined in OTEL: No + Example: "18.04.2" + """ + # Path: model/attributes/score/score__[key].json SCORE_KEY: Literal["score."] = "score." """The weighted performance score for a web vital. This is defined as `score.weight.` * `score.ratio.`. @@ -12265,6 +12307,56 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ChangelogEntry(version="0.0.0"), ], ), + "runtime.build": AttributeMetadata( + brief="The application build string, when it is separate from the version.", + type=AttributeType.STRING, + pii=PiiInfo(isPii=IsPii.MAYBE), + is_in_otel=False, + example="stable", + changelog=[ + ChangelogEntry( + version="next", prs=[383], description="Added runtime.build attribute" + ), + ], + ), + "runtime.name": AttributeMetadata( + brief="The name of the runtime. For example node, CPython, or rustc.", + type=AttributeType.STRING, + pii=PiiInfo(isPii=IsPii.MAYBE), + is_in_otel=False, + example="node", + changelog=[ + ChangelogEntry( + version="next", prs=[383], description="Added runtime.name attribute" + ), + ], + ), + "runtime.raw_description": AttributeMetadata( + brief="Unprocessed description string as obtained from the runtime. Used to extract name and version for well-known runtimes.", + type=AttributeType.STRING, + pii=PiiInfo(isPii=IsPii.MAYBE), + is_in_otel=False, + example="Eclipse OpenJ9 VM openj9-0.21.0", + changelog=[ + ChangelogEntry( + version="next", + prs=[383], + description="Added runtime.raw_description attribute", + ), + ], + ), + "runtime.version": AttributeMetadata( + brief="The version of the runtime.", + type=AttributeType.STRING, + pii=PiiInfo(isPii=IsPii.MAYBE), + is_in_otel=False, + example="18.04.2", + changelog=[ + ChangelogEntry( + version="next", prs=[383], description="Added runtime.version attribute" + ), + ], + ), "score.": AttributeMetadata( brief="The weighted performance score for a web vital. This is defined as `score.weight.` * `score.ratio.`.", type=AttributeType.DOUBLE, @@ -14357,6 +14449,10 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "rpc.method": str, "rpc.response.status_code": str, "rpc.service": str, + "runtime.build": str, + "runtime.name": str, + "runtime.raw_description": str, + "runtime.version": str, "score.": float, "score.ratio.": float, "score.total": float,