diff --git a/agentops/sdk/attributes.py b/agentops/sdk/attributes.py index bf77db7ce..a4e4b5697 100644 --- a/agentops/sdk/attributes.py +++ b/agentops/sdk/attributes.py @@ -60,8 +60,8 @@ def get_global_resource_attributes( """ Get all global resource attributes for telemetry. - Combines service metadata, system information, and imported libraries - into a complete resource attributes dictionary. + Combines service metadata and imported libraries into a complete + resource attributes dictionary. Args: service_name: Name of the service @@ -73,7 +73,6 @@ def get_global_resource_attributes( # Start with service attributes attributes: dict[str, Any] = { ResourceAttributes.SERVICE_NAME: service_name, - **get_system_resource_attributes(), } if project_id: diff --git a/agentops/sdk/core.py b/agentops/sdk/core.py index f4c09f23e..92afd0a52 100644 --- a/agentops/sdk/core.py +++ b/agentops/sdk/core.py @@ -23,6 +23,7 @@ get_trace_attributes, get_span_attributes, get_session_end_attributes, + get_system_resource_attributes, ) from agentops.semconv import SpanKind from agentops.helpers.dashboard import log_trace_url @@ -352,8 +353,9 @@ def start_trace( logger.warning("Global tracer not initialized. Cannot start trace.") return None - # Build trace attributes + # Build trace attributes and include system metadata only for session spans attributes = get_trace_attributes(tags=tags) + attributes.update(get_system_resource_attributes()) # make_span creates and starts the span, and activates it in the current context # It returns: span, context_object, context_token