From 11093fc2ed2b2d6261dec2e65c5b761581dc9b2e Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Fri, 12 Jun 2026 11:58:15 -0400 Subject: [PATCH] feat(scope): Add process runtime attributes to span context Set process.runtime.name, process.runtime.version, and process.runtime.description attributes on the scope to include Python runtime information in spans and events. This allows better runtime identification across different Python implementations (CPython, PyPy, etc.) and versions. --- sentry_sdk/scope.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sentry_sdk/scope.py b/sentry_sdk/scope.py index 5cf48ffc48..9e1b1f4b9d 100644 --- a/sentry_sdk/scope.py +++ b/sentry_sdk/scope.py @@ -1,4 +1,5 @@ import os +import platform import sys import warnings from collections import deque @@ -379,6 +380,16 @@ def set_global_attributes(self) -> None: self.set_attribute(SPANDATA.SENTRY_SDK_NAME, SDK_INFO["name"]) self.set_attribute(SPANDATA.SENTRY_SDK_VERSION, SDK_INFO["version"]) + self.set_attribute( + "process.runtime.name", + platform.python_implementation(), + ) + self.set_attribute( + "process.runtime.version", + f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}", + ) + self.set_attribute("process.runtime.description", sys.version) + options = sentry_sdk.get_client().options server_name = options.get("server_name")