Skip to content

.NET: Investigation: .NET OTel auto-instrumentation convention for Agent Framework #5852

@rogerbarreto

Description

@rogerbarreto

Objective

Big OTel rock in .NET land. Tribe pattern say: AddXxxInstrumentation() on provider, kill switch env var, separate package. Tribe use ASP.NET Core, Azure SDK, EF Core. Same shape.

Agent Framework today: must wrap each agent by hand with UseOpenTelemetry(). No tribe pattern. No kill switch. No one-line activate.

Need investigate. Not code yet. Lay stone first:

  • Where instrumentation live? Core? New Microsoft.Agents.AI.OpenTelemetry package? Contrib OpenTelemetry.Instrumentation.AgentFramework (open-telemetry tribe own OpenTelemetry.* prefix on nuget, can't take)?
  • How activate? DI auto-decorate AIAgent? Provider builder extension? Both? Idempotent?
  • Kill switch env var name? OTEL_DOTNET_AGENTFRAMEWORK_INSTRUMENTATION_ENABLED?
  • Source name rename? Today Experimental.Microsoft.Agents.AI. Tribe say Microsoft.Agents.AI.
  • Workflows source Microsoft.Agents.AI.Workflows same package?
  • Long term: move emit into base AIAgent BCL ActivitySource listener-driven (like HttpClient)? Skip wrapper?
  • Future: contrib package shim post-GA, post-stable gen-AI semconv?

Land ADR with options + decision before any code. Existing ADR 0003 stay. New ADR add on top.

Outcome

ADR docs/decisions/0026-agent-otel-auto-instrumentation.md proposed, reviewed, accepted. Then implementation issue spin off.

Refs

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions