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.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for loongsuite_instrumentation_autogen-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b82486362b03e38eff466f9a19d4d877ca99c96e91e247cc752f8fd92818145b
MD5 c67d6cc1e15d9bf0a74bafea1d468bfb
BLAKE2b-256 b8c0f60e1f44d452a79a2d4673d06b58e3a59d2025d6b3e2c8b92d028898efe8

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.0

1 file

This release

0.8.0 This release

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