Skip to content

Python: Use more meaningful names in observability traces #2467

@SuperKenVery

Description

@SuperKenVery

Currently, all executors in a workflow appear the same in a trace:

Image

This makes the trace unreadable, and the generated graph totally meaningless.

I suggest that we use something more meaningful, like the executor_id, when creating spans.

return workflow_tracer().start_as_current_span(
OtelAttr.EXECUTOR_PROCESS_SPAN,
kind=trace.SpanKind.INTERNAL,
attributes={
OtelAttr.EXECUTOR_ID: executor_id,
OtelAttr.EXECUTOR_TYPE: executor_type,
OtelAttr.MESSAGE_TYPE: message_type,
OtelAttr.MESSAGE_PAYLOAD_TYPE: payload_type,
},
links=links,
)

Here, the span name is hardcoded as OtelAttr.EXECUTOR_PROCESS_SPAN, which is an alias of "executor.process". I think changing it to executor_id could produce much more meaningful traces. The same goes for edge group.

Metadata

Metadata

Assignees

Labels

observabilityIssues related to observability or telemetrypythonworkflowsRelated to Workflows in agent-framework

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions