Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions agentops/sdk/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion agentops/sdk/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading