Skip to content

Chat span emitted even when MAF instrumentation is disabled #100

@singankit

Description

@singankit

Summary

When using microsoft-opentelemetry distro with MAF (Microsoft Agent Framework) instrumentation disabled, a chat gpt-4.1 span is still being emitted. This span should not appear when MAF instrumentation is turned off.

Repro Steps

  1. Use microsoft-opentelemetry distro
  2. Disable MAF instrumentation
  3. Invoke an agent
  4. Observe that a chat span still shows up under the invoke_agent trace

Expected Behavior

No chat span should appear when MAF instrumentation is disabled.

Actual Behavior

A chat gpt-4.1 span (7.2s, 69 tokens) is emitted with full gen_ai attributes (input/output messages, token usage, cost, agent name/id). The span includes attributes like:

  • gen_ai.agent.name
  • gen_ai.agent.id
  • microsoft.gen_ai.cost.input
  • microsoft.gen_ai.cost.output
  • gen_ai.usage.input_tokens
  • gen_ai.usage.output_tokens
  • gen_ai.response.model: gpt-4.1

Screenshot

Image

(See attached image showing the chat span with metadata appearing under invoke_agent trace even with MAF instrumentation disabled)

Environment

  • Distro: microsoft-opentelemetry (Python)
  • Agent Framework: MAF (Microsoft Agent Framework)
  • Model: gpt-4.1

Related

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions