Skip to main content

LoongSuite Microsoft Agent Framework instrumentation

Project description

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.

  • MAFSemanticProcessor remains as a compatibility layer for MAF workflow, MCP, private-prefix attribute normalization, and the in-process ARMS gauges. 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.

ARMS_MAF_METRICS_ENABLED

true

Aggregate ARMS GenAI gauges in-process.

ARMS_MAF_SLOW_THRESHOLD_MS

1000

Slow-call threshold in ms.

Project details


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

File metadata

File hashes

Hashes for loongsuite_instrumentation_microsoft_agent_framework-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc71bbb464caf99e9f952dd3581acb59ebf888b575a7693bab192d9f4166613c
MD5 fa0e5f60751858b75d22f09d060945da
BLAKE2b-256 36d63fa23e774dbfe3b597cc3853fa32b8dfb81629ed9b8c6105d341d0a5cac8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page