microsoft/promptflow/maf-tracing
Claude Code and agent skill by microsoft/promptflow
- vendor
Checking that the SKILL.md file is still in the repository.
Enable tracing and logging for Microsoft Agent Framework (MAF) workflows. Configures OpenTelemetry export to Azure Application Insights and/or a generic OTLP endpoint using environment variables. Adds required packages to requirements.txt. WHEN: enable tracing, add tracing, enable logging, add logging, configure telemetry, Application Insights for MAF, OTLP export, observe workflow, monitor agent workflow, trace agent framework, instrument MAF, add observability, trace workflow executions, debug workflow.
Install
npx vskill@latest install microsoft/promptflow/maf-tracingSKILL.md
The same SKILL.md was published earlier as microsoft/promptflow/maf-tracing.
Enable Tracing & Logging for MAF Workflows
Configure OpenTelemetry-based tracing for Microsoft Agent Framework workflows, exporting to Azure Application Insights and/or a generic OTLP endpoint.
Triggers
Activate this skill when the user wants to:
- Enable tracing or logging for a MAF workflow
- Export telemetry to Azure Application Insights
- Export traces to an OTLP-compatible endpoint (Jaeger, Zipkin, Grafana Tempo, etc.)
- Add observability or monitoring to an
agent-frameworkproject - Debug or inspect executor/agent/LLM spans in a MAF workflow
Background
MAF automatically emits OpenTelemetry spans for every executor invocation, agent call, and LLM request. No instrumentation changes are needed inside Executor classes. You only need to:
- Configure an exporter — where spans are sent (Application Insights, OTLP endpoint, or both)
- Call `configure_otel_providers()` — activates MAF's built-in instrumentation
This must happen once at application startup, before any workflow.run() calls.
Rules
- Read the user's project first — Check for an existing
requirements.txt,.env, and entry-point script (e.g.,main.py,app.py,run_*.py). - Ask what export destination(s) are needed — Application Insights, OTLP endpoint, or both. If unclear, default to both.
- Do not modify Executor classes — MAF tracing is automatic. Never add manual
tracer.start_span()calls inside@handlermethods unless the user explicitly asks for custom spans. - Call order matters — Exporter configuration must happen BEFORE
configure_otel_providers(), and both must happen BEFORE anyworkflow.run(). - Add packages to `requirements.txt` — Append only the packages the user needs (see Packages section). Do not duplicate existing entries.
- Use environment variables — Never hardcode connection strings or endpoints. Always read from
os.environor.env. - Generate `.env.example` — Provide a template showing which environment variables are required.
- Python logging integration — When the user asks for logging (not just tracing), also configure the Python
loggingmodule to export via OpenTelemetry usingopentelemetry-sdklog handler.
Environment Variables
| Variable | Required For | Description | |
|---|---|---|---|
APPLICATIONINSIGHTS_CONNECTION_STRING | Application Insights | Connection string from Azure Portal → App Insights → Overview | |
OTEL_EXPORTER_OTLP_ENDPOINT | OTLP export | Base URL of the OTLP collector (e.g., http://localhost:4318) | |
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT | OTLP export (traces only) | Overrides the base endpoint for trace signals only | |
OTEL_EXPORTER_OTLP_PROTOCOL | OTLP export | Protocol: http/protobuf (default) or grpc | |
OTEL_SERVICE_NAME | Optional | Service name shown in trace backends (defaults to Python process name) |
OTEL_EXPORTER_OTLP_TRACES_ENDPOINTtakes precedence overOTEL_EXPORTER_OTLP_ENDPOINTfor traces.
Packages
| Package | Version | When Needed | |
|---|---|---|---|
agent-framework | >=1.0.1 | Always (provides configure_otel_providers) | |
azure-monitor-opentelemetry | >=1.6.4 | Application Insights export | |
opentelemetry-exporter-otlp-proto-http | >=1.25.0 | OTLP/HTTP export | |
opentelemetry-exporter-otlp-proto-grpc | >=1.25.0 | OTLP/gRPC export (only if OTEL_EXPORTER_OTLP_PROTOCOL=grpc) | |
opentelemetry-sdk | >=1.25.0 | Custom spans or Python logging integration | |
python-dotenv | any | Loading .env files |
Setup Patterns
Pattern A: Application Insights Only
Use when the user wants to send traces to Azure Application Insights.
Required env var: APPLICATIONINSIGHTS_CONNECTION_STRING
Required packages:
Setup code (add at the top of the entry-point script, before workflow.run()):
Pattern B: OTLP Endpoint Only
Use when the user wants to send traces to a generic OTLP-compatible backend (Jaeger, Grafana Tempo, Aspire Dashboard, etc.).
Required env var: OTEL_EXPORTER_OTLP_ENDPOINT
Required packages:
Setup code:
Pattern C: Both Application Insights and OTLP
Use when the user wants dual export — Application Insights for Azure-native monitoring plus an OTLP backend for local/third-party observability.
Required env vars: APPLICATIONINSIGHTS_CONNECTION_STRING, OTEL_EXPORTER_OTLP_ENDPOINT
Required packages:
Setup code:
Pattern D: Python Logging via OpenTelemetry
Use when the user also wants Python logging calls to be exported alongside traces.
Additional packages (on top of Pattern A, B, or C):
Setup code (add after the exporter setup, before configure_otel_providers()):
Note: When usingazure-monitor-opentelemetry(Pattern A/C),configure_azure_monitor()already captures Python logs by default. The above is only needed for OTLP-only setups.
Implementation Steps
Step 1: Determine export destination(s)
Ask the user or infer from context:
- Application Insights → Pattern A
- OTLP endpoint → Pattern B
- Both → Pattern C
If the user says "tracing" without specifying a destination, default to Pattern C (both).
Step 2: Update requirements.txt
Append the required packages. Do not duplicate existing entries. Example additions for Pattern C:
Step 3: Create or update .env.example
Add the environment variables relevant to the chosen pattern:
Step 4: Add tracing setup to entry-point script
Insert the setup code from the appropriate pattern at the top of the entry-point script (after imports, before any workflow.run() call). The setup must execute once at module load / application startup.
Placement rules:
- If the entry point uses
asyncio.run(main()), place setup code insidemain()beforeworkflow.run(). - If the entry point is a module-level script, place setup code after imports and
load_dotenv(). - If the entry point is a web server (FastAPI, Flask), place setup code in the application factory or startup event.
Step 5: Verify
- Run the workflow and check that traces appear in the configured destination.
- For Application Insights: Azure Portal → Application Insights → Transaction Search → filter by "Dependency" or "Request".
- For OTLP: Check the collector backend UI (e.g., Jaeger UI at
http://localhost:16686).
Gotchas
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 22 May 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/maf-tracing/SKILL.md
Popularity
- Repository stars
- 11,145
- Repository forks
- 1,101
- 7-day trend score
- 47
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 13 Jun 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/promptflow/maf-tracing)