Skip to content

Docs: agent-framework guides should use gen_ai-emitting instrumentation #2088

Description

@strawgate

Tracks the docs half of pydantic/platform#27699 (agent-framework interop). Relates to #2021.

Problem

Several agent-framework guides instrument the framework in a way that never reaches Logfire's Agents page, even though the framework can emit the OTel-GenAI shape. Verified empirically by capturing each framework's real OTLP:

  • autogen - the guide uses the OpenInference instrumentor, which emits openinference.span.kind=AGENT (no gen_ai.agent.name). autogen-core has native gen_ai runtime tracing (on by default) that emits invoke_agent {name} + gen_ai.agent.name.
  • semantic-kernel (python) - the guide uses raw kernel.invoke_prompt (no agent span). A ChatCompletionAgent + SEMANTICKERNEL_EXPERIMENTAL_GENAI_ENABLE_OTEL_DIAGNOSTICS (and ..._SENSITIVE for message content) emits the invoke_agent span.
  • vercel-ai - v7 dropped auto-spans from experimental_telemetry; needs the new @ai-sdk/otel registerTelemetry(...).
  • mastra - needs @mastra/otel-exporter.

Required

Update those examples to the gen_ai-emitting setup, and note the SK diagnostics flags (incl. SENSITIVE) required for message content.

Acceptance

Following each guide yields an agent on the Logfire Agents page (and, with SK's SENSITIVE flag, a populated transcript). Verified against a local stack.

Effort / dependencies

S. No dependency - ship first; it is the only remediation with zero platform change.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions