diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index f5a668e7..ce26c8ae 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -5114,6 +5114,71 @@ export const CONNECTION_RTT = 'connection.rtt'; */ export type CONNECTION_RTT_TYPE = number; +// Path: model/attributes/cpython/cpython__gc__collected_objects.json + +/** + * The number of unreachable objects collected during a run of the CPython garbage collector. `cpython.gc.collected_objects` + * + * Attribute Value Type: `number` {@link CPYTHON_GC_COLLECTED_OBJECTS_TYPE} + * + * Apply Scrubbing: manual + * + * Attribute defined in OTEL: No + * Visibility: public + * + * @example 42 + */ +export const CPYTHON_GC_COLLECTED_OBJECTS = 'cpython.gc.collected_objects'; + +/** + * Type for {@link CPYTHON_GC_COLLECTED_OBJECTS} cpython.gc.collected_objects + */ +export type CPYTHON_GC_COLLECTED_OBJECTS_TYPE = number; + +// Path: model/attributes/cpython/cpython__gc__generation.json + +/** + * The generation of objects that a run of the CPython garbage collector collected. A collection of a generation also collects all younger generations, so 2 is a full collection. `cpython.gc.generation` + * + * Attribute Value Type: `number` {@link CPYTHON_GC_GENERATION_TYPE} + * + * Apply Scrubbing: manual + * + * Attribute defined in OTEL: Yes + * Visibility: public + * + * @example 0 + * @example 1 + * @example 2 + */ +export const CPYTHON_GC_GENERATION = 'cpython.gc.generation'; + +/** + * Type for {@link CPYTHON_GC_GENERATION} cpython.gc.generation + */ +export type CPYTHON_GC_GENERATION_TYPE = number; + +// Path: model/attributes/cpython/cpython__gc__uncollectable_objects.json + +/** + * The number of unreachable objects that couldn't be collected during a run of the CPython garbage collector. These objects are moved to gc.garbage. `cpython.gc.uncollectable_objects` + * + * Attribute Value Type: `number` {@link CPYTHON_GC_UNCOLLECTABLE_OBJECTS_TYPE} + * + * Apply Scrubbing: manual + * + * Attribute defined in OTEL: No + * Visibility: public + * + * @example 0 + */ +export const CPYTHON_GC_UNCOLLECTABLE_OBJECTS = 'cpython.gc.uncollectable_objects'; + +/** + * Type for {@link CPYTHON_GC_UNCOLLECTABLE_OBJECTS} cpython.gc.uncollectable_objects + */ +export type CPYTHON_GC_UNCOLLECTABLE_OBJECTS_TYPE = number; + // Path: model/attributes/culture/culture__calendar.json /** @@ -20670,6 +20735,9 @@ export const ATTRIBUTE_TYPE: Record = { 'code.namespace': 'string', connectionType: 'string', 'connection.rtt': 'integer', + 'cpython.gc.collected_objects': 'integer', + 'cpython.gc.generation': 'integer', + 'cpython.gc.uncollectable_objects': 'integer', 'culture.calendar': 'string', 'culture.display_name': 'string', 'culture.is_24_hour_format': 'boolean', @@ -21579,6 +21647,9 @@ export type AttributeName = | typeof CODE_NAMESPACE | typeof CONNECTIONTYPE | typeof CONNECTION_RTT + | typeof CPYTHON_GC_COLLECTED_OBJECTS + | typeof CPYTHON_GC_GENERATION + | typeof CPYTHON_GC_UNCOLLECTABLE_OBJECTS | typeof CULTURE_CALENDAR | typeof CULTURE_DISPLAY_NAME | typeof CULTURE_IS_24_HOUR_FORMAT @@ -25870,6 +25941,56 @@ export const ATTRIBUTE_METADATA: Record = { }, ], }, + 'cpython.gc.collected_objects': { + brief: 'The number of unreachable objects collected during a run of the CPython garbage collector.', + type: 'integer', + keys: ['cpython.gc.collected_objects'], + applyScrubbing: { + key: 'manual', + }, + isInOtel: false, + visibility: 'public', + example: 42, + examples: [42], + changelog: [{ version: 'next', prs: [718], description: 'Added cpython.gc.collected_objects attribute' }], + additionalContext: [ + "This is the count for a single garbage collection run. It's not the same as the OpenTelemetry `cpython.gc.collected_objects` metric, which is a counter of the total since interpreter start.", + ], + }, + 'cpython.gc.generation': { + brief: + 'The generation of objects that a run of the CPython garbage collector collected. A collection of a generation also collects all younger generations, so 2 is a full collection.', + type: 'integer', + keys: ['cpython.gc.generation'], + applyScrubbing: { + key: 'manual', + }, + isInOtel: true, + visibility: 'public', + example: 0, + examples: [0, 1, 2], + changelog: [{ version: 'next', prs: [718], description: 'Added cpython.gc.generation attribute' }], + additionalContext: [ + "On free-threaded builds of CPython (3.13+), the garbage collector isn't generational: every collection scans all objects. Automatic collections report generation 0, and explicit collections report the generation that was requested, but all of them are full collections.", + ], + }, + 'cpython.gc.uncollectable_objects': { + brief: + "The number of unreachable objects that couldn't be collected during a run of the CPython garbage collector. These objects are moved to gc.garbage.", + type: 'integer', + keys: ['cpython.gc.uncollectable_objects'], + applyScrubbing: { + key: 'manual', + }, + isInOtel: false, + visibility: 'public', + example: 0, + examples: [0], + changelog: [{ version: 'next', prs: [718], description: 'Added cpython.gc.uncollectable_objects attribute' }], + additionalContext: [ + "This is the count for a single garbage collection run. It's not the same as the OpenTelemetry `cpython.gc.uncollectable_objects` metric, which is a counter of the total since interpreter start.", + ], + }, 'culture.calendar': { brief: 'The calendar system used by the culture.', type: 'string', @@ -37436,6 +37557,9 @@ export type Attributes = { [CODE_NAMESPACE]?: CODE_NAMESPACE_TYPE; [CONNECTIONTYPE]?: CONNECTIONTYPE_TYPE; [CONNECTION_RTT]?: CONNECTION_RTT_TYPE; + [CPYTHON_GC_COLLECTED_OBJECTS]?: CPYTHON_GC_COLLECTED_OBJECTS_TYPE; + [CPYTHON_GC_GENERATION]?: CPYTHON_GC_GENERATION_TYPE; + [CPYTHON_GC_UNCOLLECTABLE_OBJECTS]?: CPYTHON_GC_UNCOLLECTABLE_OBJECTS_TYPE; [CULTURE_CALENDAR]?: CULTURE_CALENDAR_TYPE; [CULTURE_DISPLAY_NAME]?: CULTURE_DISPLAY_NAME_TYPE; [CULTURE_IS_24_HOUR_FORMAT]?: CULTURE_IS_24_HOUR_FORMAT_TYPE; diff --git a/javascript/sentry-conventions/src/op.ts b/javascript/sentry-conventions/src/op.ts index e82b9341..375d4d70 100644 --- a/javascript/sentry-conventions/src/op.ts +++ b/javascript/sentry-conventions/src/op.ts @@ -615,6 +615,16 @@ export const OBJECT_MULTIPART_UPLOAD_COMPLETE = 'object.multipart_upload.complet */ export const ROUTER = 'router'; +// Path: model/op/runtime.json +// Name: runtime + +// Description: Operations of the language runtime itself, as opposed to the application code running on it. + +/** + * A run of the runtime's garbage collector. + */ +export const GC = 'gc'; + // Path: model/op/web_server.json // Name: web_server diff --git a/javascript/sentry-conventions/src/search.ts b/javascript/sentry-conventions/src/search.ts index 663e145e..29ed531e 100644 --- a/javascript/sentry-conventions/src/search.ts +++ b/javascript/sentry-conventions/src/search.ts @@ -1330,6 +1330,21 @@ export const SEARCH_CONNECTION__RTT = 'connection.rtt'; */ export const SEARCH_CONNECTIONTYPE = 'connectionType'; +/** + * Search name for {@link attributes.CPYTHON_GC_COLLECTED_OBJECTS}. `cpython.gc.collected_objects` + */ +export const SEARCH_CPYTHON__GC__COLLECTED_OBJECTS = 'cpython.gc.collected_objects'; + +/** + * Search name for {@link attributes.CPYTHON_GC_GENERATION}. `cpython.gc.generation` + */ +export const SEARCH_CPYTHON__GC__GENERATION = 'cpython.gc.generation'; + +/** + * Search name for {@link attributes.CPYTHON_GC_UNCOLLECTABLE_OBJECTS}. `cpython.gc.uncollectable_objects` + */ +export const SEARCH_CPYTHON__GC__UNCOLLECTABLE_OBJECTS = 'cpython.gc.uncollectable_objects'; + /** * Search name for {@link attributes.CULTURE_CALENDAR}. `culture.calendar` */ @@ -5485,6 +5500,9 @@ export type AttributeSearchName = | typeof SEARCH_CODE__NAMESPACE | typeof SEARCH_CONNECTION__RTT | typeof SEARCH_CONNECTIONTYPE + | typeof SEARCH_CPYTHON__GC__COLLECTED_OBJECTS + | typeof SEARCH_CPYTHON__GC__GENERATION + | typeof SEARCH_CPYTHON__GC__UNCOLLECTABLE_OBJECTS | typeof SEARCH_CULTURE__CALENDAR | typeof SEARCH_CULTURE__DISPLAY_NAME | typeof SEARCH_CULTURE__IS_24_HOUR_FORMAT @@ -7698,6 +7716,26 @@ export const ATTRIBUTE_SEARCH_METADATA: Record brief: 'Specifies the type of the current connection (e.g. wifi, ethernet, cellular , etc).', deprecationChain: ['network.connection.type', 'connectionType', 'device.connection_type'], }, + 'cpython.gc.collected_objects': { + canonicalName: 'cpython.gc.collected_objects', + type: 'integer', + brief: 'The number of unreachable objects collected during a run of the CPython garbage collector.', + deprecationChain: ['cpython.gc.collected_objects'], + }, + 'cpython.gc.generation': { + canonicalName: 'cpython.gc.generation', + type: 'integer', + brief: + 'The generation of objects that a run of the CPython garbage collector collected. A collection of a generation also collects all younger generations, so 2 is a full collection.', + deprecationChain: ['cpython.gc.generation'], + }, + 'cpython.gc.uncollectable_objects': { + canonicalName: 'cpython.gc.uncollectable_objects', + type: 'integer', + brief: + "The number of unreachable objects that couldn't be collected during a run of the CPython garbage collector. These objects are moved to gc.garbage.", + deprecationChain: ['cpython.gc.uncollectable_objects'], + }, 'culture.calendar': { canonicalName: 'culture.calendar', type: 'string', diff --git a/model/attributes/cpython/cpython__gc__collected_objects.json b/model/attributes/cpython/cpython__gc__collected_objects.json new file mode 100644 index 00000000..14cd2e37 --- /dev/null +++ b/model/attributes/cpython/cpython__gc__collected_objects.json @@ -0,0 +1,21 @@ +{ + "key": "cpython.gc.collected_objects", + "brief": "The number of unreachable objects collected during a run of the CPython garbage collector.", + "type": "integer", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": false, + "visibility": "public", + "examples": [42], + "additional_context": [ + "This is the count for a single garbage collection run. It's not the same as the OpenTelemetry `cpython.gc.collected_objects` metric, which is a counter of the total since interpreter start." + ], + "changelog": [ + { + "version": "next", + "prs": [718], + "description": "Added cpython.gc.collected_objects attribute" + } + ] +} diff --git a/model/attributes/cpython/cpython__gc__generation.json b/model/attributes/cpython/cpython__gc__generation.json new file mode 100644 index 00000000..6e729b34 --- /dev/null +++ b/model/attributes/cpython/cpython__gc__generation.json @@ -0,0 +1,21 @@ +{ + "key": "cpython.gc.generation", + "brief": "The generation of objects that a run of the CPython garbage collector collected. A collection of a generation also collects all younger generations, so 2 is a full collection.", + "type": "integer", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": true, + "visibility": "public", + "examples": [0, 1, 2], + "additional_context": [ + "On free-threaded builds of CPython (3.13+), the garbage collector isn't generational: every collection scans all objects. Automatic collections report generation 0, and explicit collections report the generation that was requested, but all of them are full collections." + ], + "changelog": [ + { + "version": "next", + "prs": [718], + "description": "Added cpython.gc.generation attribute" + } + ] +} diff --git a/model/attributes/cpython/cpython__gc__uncollectable_objects.json b/model/attributes/cpython/cpython__gc__uncollectable_objects.json new file mode 100644 index 00000000..3f9a4904 --- /dev/null +++ b/model/attributes/cpython/cpython__gc__uncollectable_objects.json @@ -0,0 +1,21 @@ +{ + "key": "cpython.gc.uncollectable_objects", + "brief": "The number of unreachable objects that couldn't be collected during a run of the CPython garbage collector. These objects are moved to gc.garbage.", + "type": "integer", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": false, + "visibility": "public", + "examples": [0], + "additional_context": [ + "This is the count for a single garbage collection run. It's not the same as the OpenTelemetry `cpython.gc.uncollectable_objects` metric, which is a counter of the total since interpreter start." + ], + "changelog": [ + { + "version": "next", + "prs": [718], + "description": "Added cpython.gc.uncollectable_objects attribute" + } + ] +} diff --git a/model/name/runtime.json b/model/name/runtime.json new file mode 100644 index 00000000..bd8c340b --- /dev/null +++ b/model/name/runtime.json @@ -0,0 +1,13 @@ +{ + "brief": "Runtime", + "operations": [ + { + "name": "Garbage collection", + "brief": "A run of the runtime's garbage collector.", + "is_in_otel": false, + "ops": ["gc"], + "templates": ["Garbage collection"], + "examples": ["Garbage collection"] + } + ] +} diff --git a/model/op/runtime.json b/model/op/runtime.json new file mode 100644 index 00000000..4a7f953f --- /dev/null +++ b/model/op/runtime.json @@ -0,0 +1,10 @@ +{ + "name": "runtime", + "description": "Operations of the language runtime itself, as opposed to the application code running on it.", + "fields": [ + { + "name": "gc", + "description": "A run of the runtime's garbage collector." + } + ] +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index bc1cf32c..82b27721 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -3353,6 +3353,45 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "wifi" """ + # Path: model/attributes/cpython/cpython__gc__collected_objects.json + CPYTHON_GC_COLLECTED_OBJECTS: Literal["cpython.gc.collected_objects"] = ( + "cpython.gc.collected_objects" + ) + """The number of unreachable objects collected during a run of the CPython garbage collector. + + Type: int + Apply Scrubbing: manual + Defined in OTEL: No + Visibility: public + Example: 42 + """ + + # Path: model/attributes/cpython/cpython__gc__generation.json + CPYTHON_GC_GENERATION: Literal["cpython.gc.generation"] = "cpython.gc.generation" + """The generation of objects that a run of the CPython garbage collector collected. A collection of a generation also collects all younger generations, so 2 is a full collection. + + Type: int + Apply Scrubbing: manual + Defined in OTEL: Yes + Visibility: public + Example: 0 + Example: 1 + Example: 2 + """ + + # Path: model/attributes/cpython/cpython__gc__uncollectable_objects.json + CPYTHON_GC_UNCOLLECTABLE_OBJECTS: Literal["cpython.gc.uncollectable_objects"] = ( + "cpython.gc.uncollectable_objects" + ) + """The number of unreachable objects that couldn't be collected during a run of the CPython garbage collector. These objects are moved to gc.garbage. + + Type: int + Apply Scrubbing: manual + Defined in OTEL: No + Visibility: public + Example: 0 + """ + # Path: model/attributes/culture/culture__calendar.json CULTURE_CALENDAR: Literal["culture.calendar"] = "culture.calendar" """The calendar system used by the culture. @@ -16326,6 +16365,66 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ), ], ), + "cpython.gc.collected_objects": AttributeMetadata( + brief="The number of unreachable objects collected during a run of the CPython garbage collector.", + type=AttributeType.INTEGER, + keys=("cpython.gc.collected_objects",), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example=42, + examples=[42], + changelog=[ + ChangelogEntry( + version="next", + prs=[718], + description="Added cpython.gc.collected_objects attribute", + ), + ], + additional_context=[ + "This is the count for a single garbage collection run. It's not the same as the OpenTelemetry `cpython.gc.collected_objects` metric, which is a counter of the total since interpreter start." + ], + ), + "cpython.gc.generation": AttributeMetadata( + brief="The generation of objects that a run of the CPython garbage collector collected. A collection of a generation also collects all younger generations, so 2 is a full collection.", + type=AttributeType.INTEGER, + keys=("cpython.gc.generation",), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=True, + visibility=Visibility.PUBLIC, + example=0, + examples=[0, 1, 2], + changelog=[ + ChangelogEntry( + version="next", + prs=[718], + description="Added cpython.gc.generation attribute", + ), + ], + additional_context=[ + "On free-threaded builds of CPython (3.13+), the garbage collector isn't generational: every collection scans all objects. Automatic collections report generation 0, and explicit collections report the generation that was requested, but all of them are full collections." + ], + ), + "cpython.gc.uncollectable_objects": AttributeMetadata( + brief="The number of unreachable objects that couldn't be collected during a run of the CPython garbage collector. These objects are moved to gc.garbage.", + type=AttributeType.INTEGER, + keys=("cpython.gc.uncollectable_objects",), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example=0, + examples=[0], + changelog=[ + ChangelogEntry( + version="next", + prs=[718], + description="Added cpython.gc.uncollectable_objects attribute", + ), + ], + additional_context=[ + "This is the count for a single garbage collection run. It's not the same as the OpenTelemetry `cpython.gc.uncollectable_objects` metric, which is a counter of the total since interpreter start." + ], + ), "culture.calendar": AttributeMetadata( brief="The calendar system used by the culture.", type=AttributeType.STRING, @@ -29469,6 +29568,9 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "code": str, "connection.rtt": int, "connectionType": str, + "cpython.gc.collected_objects": int, + "cpython.gc.generation": int, + "cpython.gc.uncollectable_objects": int, "culture.calendar": str, "culture.display_name": str, "culture.is_24_hour_format": bool, diff --git a/rust/src/op.rs b/rust/src/op.rs index 9c6aefec..c942e00e 100644 --- a/rust/src/op.rs +++ b/rust/src/op.rs @@ -393,6 +393,13 @@ pub const OBJECT_MULTIPART_UPLOAD_COMPLETE: &str = "object.multipart_upload.comp /// A framework-neutral operation for work performed by an application router. pub const ROUTER: &str = "router"; +// Path: model/op/runtime.json +// Name: runtime + +// Description: Operations of the language runtime itself, as opposed to the application code running on it. +/// A run of the runtime's garbage collector. +pub const GC: &str = "gc"; + // Path: model/op/web_server.json // Name: web_server