Skip to main content

This package provides LoongSuite instrumentation for Microsoft Agent Framework (agent-framework-core).

It keeps MAF’s native OTel span lifetime, but routes GenAI span finalization through opentelemetry-util-genai before spans are ended:

  • util_genai_bridge patches MAF’s native span helper functions and calls the shared opentelemetry-util-genai invocation finish helpers for AGENT / LLM / TOOL / EMBEDDING spans while the span is still recording. This ensures exporter snapshots include gen_ai.span.kind, gen_ai.operation.name, normalized provider names, token usage, finish reasons, and streaming TTFT where MAF exposes enough data. Non-streaming spans remain current for the wrapped call, and nested Robin provider instrumentation is suppressed when its optional context key is available.

  • MAFSemanticProcessor remains as a compatibility layer for MAF workflow, MCP, and private-prefix attribute normalization. Metrics come from MAF’s native counter and histogram instruments; this package does not export process-cumulative ObservableGauges. Successful spans keep the OpenTelemetry default UNSET status; failed spans keep MAF’s ERROR status.

  • react_step_patch (opt-in via ARMS_MAF_REACT_STEP_ENABLED=true) wraps FunctionInvocationLayer.get_response so that each LLM round-trip inside the ReAct loop emits one react step span via ExtendedTelemetryHandler.react_step() from opentelemetry-util-genai.

Truncation / PII helpers are reused from opentelemetry.util.genai.utils (gen_ai_json_dumps), aligned with the OpenAI Agents v2 GenAI instrumentation.

Installation

Install the instrumentation package together with Microsoft Agent Framework in the target application environment:

pip install "loongsuite-instrumentation-microsoft-agent-framework[instruments]"

To keep the framework dependency controlled by the application, install the instrumentation package and framework separately:

pip install loongsuite-instrumentation-microsoft-agent-framework
pip install agent-framework-core

Configuration

Env

Default

Description

ARMS_MAF_INSTRUMENTATION_ENABLED

true

Master switch; false disables instrumentation.

ARMS_MAF_SENSITIVE_DATA_ENABLED

false

Capture inputs/outputs (linked to MAF’s sensitive-data option).

ARMS_MAF_REACT_STEP_ENABLED

false

Emit react step spans for non-streaming ReAct tool loops.

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

File metadata

File hashes

Hashes for loongsuite_instrumentation_microsoft_agent_framework-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb3dcc67b33670ea046e87f1211d9454aa07cf9e1eca41fc8d3e1c91699043d2
MD5 122793a97e595e6d5dcc859ec4a1d25e
BLAKE2b-256 ab2bf2748561ae91e8977d78f362a4bef167a1066c955ddf1224306cb9b9a606

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