Skip to content

[OpenAI Agents Auto-Instrument] GenAISemanticProcessor maps turn and other unrecognized span data types to unknown operation name #133

Description

@fpfp100

Summary

The GenAISemanticProcessor._get_operation_name() returns "unknown" for span data types it doesn't explicitly handle, producing spans named unknown in the trace. The OpenAI Agents SDK's turn span is one such case.

Details

In span_processor.py, _get_operation_name() handles GenerationSpanData, AgentSpanData, FunctionSpanData, ResponseSpanData, TranscriptionSpanData, SpeechSpanData, GuardrailSpanData, and HandoffSpanData — but falls through to return "unknown" for anything else.

The OpenAI Agents SDK emits a turn span (via CustomSpanData) as part of its Agent workflow → invoke_agent → turn → response hierarchy. The distro produces:

Agent workflow → unknown → invoke_agent Assistant → unknown → chat gpt-4o-mini

The base A365 SDK correctly maps these to "chain" operation with the original span name preserved (e.g. turn).

Expected behavior

Unrecognized span data types (including CustomSpanData) should map to a meaningful fallback operation name (e.g. chain) and preserve the original span name from span_data.type, not produce unknown.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions