Skip to main content

LoongSuite Microsoft AutoGen Instrumentation

This package instruments Microsoft AutoGen 0.7.x AgentChat flows.

It follows the AutoGen 0.7 native telemetry boundary:

  • AutoGen core already emits native GenAI-style spans for invoke_agent, create_agent, and execute_tool.
  • This instrumentation registers a span processor that converts those native spans to LoongSuite GenAI attributes by setting gen_ai.span.kind, replacing gen_ai.system=autogen with gen_ai.provider.name=autogen, and normalizing span kinds.
  • AgentChat AssistantAgent.on_messages_stream is wrapped with ExtendedTelemetryHandler.invoke_agent() when no native AutoGen agent span is already active.
  • AgentChat AssistantAgent._call_llm is wrapped with ExtendedTelemetryHandler.llm() so model calls produce LoongSuite LLM spans for any AutoGen ChatCompletionClient.

Usage

from opentelemetry.instrumentation.autogen import AutoGenInstrumentor

AutoGenInstrumentor().instrument()

Environment switches:

  • ARMS_AUTOGEN_INSTRUMENTATION_ENABLED=false disables the instrumentation.
  • ARMS_AUTOGEN_AGENT_SPAN_ENABLED=false disables the AgentChat agent wrapper.
  • ARMS_AUTOGEN_LLM_SPAN_ENABLED=false disables the AgentChat LLM wrapper.
  • ARMS_AUTOGEN_NATIVE_SPAN_PROCESSOR_ENABLED=false disables native span normalization.

The package uses opentelemetry-util-genai and respects the shared GenAI content-capture environment variables.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file loongsuite_instrumentation_autogen-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for loongsuite_instrumentation_autogen-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8138ecce6c805a37b906840339e6a61c5ed17105efb62477dcd308df13342360
MD5 f1d494ec41cbeab0aa22a837733ed6a9
BLAKE2b-256 19f99ff4a705eee574fee8b466762d7d56286c9f4ff38ee83c74e702c420632b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.9.0 This release

1 file

0.8.0

1 file

0.7.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page