Steps to Reproduce
- Configure an OTEL exporter (e.g. Langfuse via
OTEL_EXPORTER_OTLP_ENDPOINT)
- Enable latest GenAI semantic conventions (
OTEL_SEMCONV_STABILITY_OPT_IN=semconv_stability_opt_in_latest_genai)
- Run an agent and inspect the exported spans
- Observe that
execute_event_loop_cycle spans carry gen_ai.input.messages as a span attribute but lack gen_ai.system / gen_ai.provider.name / gen_ai.operation.name
Expected Behavior
execute_event_loop_cycle spans should include the same common gen_ai.* attributes (gen_ai.system or gen_ai.provider.name, and gen_ai.operation.name) that are present on start_model_invoke_span, start_tool_call_span, start_agent_span, and start_multiagent_span spans. All four of those span types call _get_common_attributes(); start_event_loop_cycle_span does not.
Actual Behavior
start_event_loop_cycle_span() (tracer.py ~line 500) initializes its attributes dict with only event_loop.cycle_id and optional parent/custom attributes, then calls _add_event_messages() which (since #1768 / v1.29.0) promotes gen_ai.input.messages to span-level attributes when Langfuse is detected. The result is spans that carry gen_ai.-namespaced content attributes but lack the common identification attributes that downstream OTEL tooling (collectors, exporters, redaction processors) may rely on for filtering or policy decisions.
Possible Solution
Add a call to _get_common_attributes() in start_event_loop_cycle_span(), consistent with the other span start methods. An appropriate operation_name would need to be chosen (e.g. "execute_event_loop_cycle").
Related Issues
#1768
Steps to Reproduce
OTEL_EXPORTER_OTLP_ENDPOINT)OTEL_SEMCONV_STABILITY_OPT_IN=semconv_stability_opt_in_latest_genai)execute_event_loop_cyclespans carrygen_ai.input.messagesas a span attribute but lackgen_ai.system/gen_ai.provider.name/gen_ai.operation.nameExpected Behavior
execute_event_loop_cyclespans should include the same commongen_ai.*attributes (gen_ai.systemorgen_ai.provider.name, andgen_ai.operation.name) that are present onstart_model_invoke_span,start_tool_call_span,start_agent_span, andstart_multiagent_spanspans. All four of those span types call_get_common_attributes();start_event_loop_cycle_spandoes not.Actual Behavior
start_event_loop_cycle_span()(tracer.py ~line 500) initializes its attributes dict with onlyevent_loop.cycle_idand optional parent/custom attributes, then calls_add_event_messages()which (since #1768 / v1.29.0) promotesgen_ai.input.messagesto span-level attributes when Langfuse is detected. The result is spans that carrygen_ai.-namespaced content attributes but lack the common identification attributes that downstream OTEL tooling (collectors, exporters, redaction processors) may rely on for filtering or policy decisions.Possible Solution
Add a call to
_get_common_attributes()instart_event_loop_cycle_span(), consistent with the other span start methods. An appropriateoperation_namewould need to be chosen (e.g."execute_event_loop_cycle").Related Issues
#1768