LoongSuite Microsoft Agent Framework Instrumentation
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. |
Metadata
Release files for loongsuite-instrumentation-microsoft-agent-framework 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| loongsuite_instrumentation_microsoft_agent_framework-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for loongsuite_instrumentation_microsoft_agent_framework-0.9.0-py3-none-any.whl |
Release files / loongsuite_instrumentation_microsoft_agent_framework-0.9.0-py3-none-any.whl
| Download URL | loongsuite_instrumentation_microsoft_agent_framework-0.9.0-py3-none-any.whl |
|---|---|
| Size | 35.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb3dcc67b33670ea046e87f1211d9454aa07cf9e1eca41fc8d3e1c91699043d2
|
|
BLAKE2b-256 checksum How to use checksums |
ab2bf2748561ae91e8977d78f362a4bef167a1066c955ddf1224306cb9b9a606
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for loongsuite-instrumentation-microsoft-agent-framework 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.