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

File metadata

File hashes

Hashes for loongsuite_instrumentation_microsoft_agent_framework-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2696b7bf73065434cd5975cc57f2cbe3a7e273c1a3a07473983876564c3c1b6
MD5 287238a33029dfa484de2635d543df07
BLAKE2b-256 e08747748ae38dedd2e2f16d149af6ae7e819bde6940cc109d2b933068d9e244

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