Official agent skill

Azure Monitor Opentelemetry Exporter Py

by microsoft in microsoft/skills

Azure Monitor OpenTelemetry Exporter for Python. An agent skill from microsoft/skills.

OfficialMITAuto-check passedDevOps & Cloud

Install Azure Monitor Opentelemetry Exporter Py

skills CLI
$ npx skills add microsoft/skills --skill azure-monitor-opentelemetry-exporter-py -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/skills azure-monitor-opentelemetry-exporter-py --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-exporter-py .claude/skills/azure-monitor-opentelemetry-exporter-py && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
azure-monitor-opentelemetry-exporter-py
GitHub stars
3.1k
Token cost
~2.3k tokens
SKILL.md length
326 words
Files
3 (incl. references)
Skills in repo
150
Repo updated
First seen
Licence
MIT

At a glance

Azure Monitor OpenTelemetry Exporter for Python. An agent skill from microsoft/skills.

  • Works in 8 steps: Pick sync OR async and stay consistent.… → Call provider.shutdown() / force_flush()… → Use BatchSpanProcessor for production… → …
  • Low-level OpenTelemetry export to Application Insights
  • SKILL.md covers Installation, Environment Variables, Authentication & Lifecycle and When to Use, plus 13 more sections
  • Calls pip; reaches xxx.in.applicationinsights.azure.com and learn.microsoft.com; needs AZURE_TOKEN_CREDENTIALS

What it does

Azure Monitor Opentelemetry Exporter Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure Monitor OpenTelemetry Exporter for Python. Use for low-level OpenTelemetry export to Application Insights. Triggers: "azure-monitor-opentelemetry-exporter", "AzureMonitorTraceExporter", "AzureMonitorMetricExporter", "AzureMonitorLogExporter".

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/capabilities.md` and `references/non-hero-scenarios.md`).

It sits in DevOps & Cloud, covering Observability. It works with Azure Monitor, OpenTelemetry, Python and Microsoft Azure. The repository describes itself as: Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents. The licence is MIT.

When your agent uses it

  • Low-level OpenTelemetry export to Application Insights
  • Tasks that involve Observability

Example prompts

  • “azure-monitor-opentelemetry-exporter”
  • “AzureMonitorTraceExporter”
  • “AzureMonitorMetricExporter”
  • “/azure-monitor-opentelemetry-exporter-py”

Requirements

  • Python 3

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Pick sync OR async and stay consistent. Do not mix azure.xxx sync clients with azure.xxx.aio async clients in the same call path. Choose…
  2. Call provider.shutdown() / force_flush() at process exit to flush telemetry — providers are not context managers.
  3. Use BatchSpanProcessor for production (not SimpleSpanProcessor)
  4. Use ApplicationInsightsSampler for consistent sampling across services
  5. Enable offline storage for reliability in production
  6. Use Microsoft Entra authentication instead of instrumentation keys
  7. Set export intervals appropriate for your workload
  8. Use the distro (azure-monitor-opentelemetry) unless you need custom pipelines

What it can do on your machine

Read from SKILL.md and the folder at commit d5741a1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • xxx.in.applicationinsights.azure.com
    • learn.microsoft.com
    • xxx.in.applicationinsights.azure.us

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • AZURE_TOKEN_CREDENTIALS

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Azure Monitor Opentelemetry Exporter Py loads about 2.3k tokens when it runs, and up to ~3.6k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 326 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/skills at commit d5741a1, republished under its MIT licence (© microsoft). 326 words, ~2,268 tokens.

Download SKILL.mdSave it as .claude/skills/azure-monitor-opentelemetry-exporter-py/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
azure-monitor-opentelemetry-exporter-py
description
Azure Monitor OpenTelemetry Exporter for Python. Use for low-level OpenTelemetry export to Application Insights. Triggers: "azure-monitor-opentelemetry-exporter", "AzureMonitorTraceExporter", "AzureMonitorMetricExporter", "AzureMonitorLogExporter".
license
MIT
metadata.author
Microsoft
metadata.version
1.0.0
metadata.package
azure-monitor-opentelemetry-exporter

Azure Monitor OpenTelemetry Exporter for Python

Low-level exporter for sending OpenTelemetry traces, metrics, and logs to Application Insights.

Installation

bash
pip install azure-monitor-opentelemetry-exporter

Environment Variables

bash
APPLICATIONINSIGHTS_CONNECTION_STRING=InstrumentationKey=xxx;IngestionEndpoint=https://xxx.in.applicationinsights.azure.com/  # Required for all auth methods
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production

Authentication & Lifecycle

🔑 Two rules apply to every code sample below:

  1. Prefer DefaultAzureCredential for ingestion auth when supported. APPLICATIONINSIGHTS_CONNECTION_STRING identifies the target Application Insights resource, and credential=DefaultAzureCredential(...) provides Microsoft Entra authentication.
    • Local dev: DefaultAzureCredential works as-is.
    • Production: set AZURE_TOKEN_CREDENTIALS=prod (or AZURE_TOKEN_CREDENTIALS=<specific_credential>) to constrain the credential chain to production-safe credentials.
  2. Providers are not context managers. Flush and shut down telemetry providers explicitly at process exit so buffers are exported deterministically.

Snippets may abbreviate this setup, but production code should always follow both rules.

When to Use

ScenarioUse
Quick setup, auto-instrumentationazure-monitor-opentelemetry (distro)
Custom OpenTelemetry pipelineazure-monitor-opentelemetry-exporter (this)
Fine-grained control over telemetryazure-monitor-opentelemetry-exporter (this)

Trace Exporter

python
from azure.identity import DefaultAzureCredential
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter

# Reads APPLICATIONINSIGHTS_CONNECTION_STRING from env to identify the resource;
# DefaultAzureCredential authenticates ingestion via Microsoft Entra ID.
exporter = AzureMonitorTraceExporter(
    credential=DefaultAzureCredential(),
)

# Configure tracer provider
trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(
    BatchSpanProcessor(exporter)
)

# Use tracer
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span("my-span"):
    print("Hello, World!")

Metric Exporter

python
from azure.identity import DefaultAzureCredential
from opentelemetry import metrics
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader
from azure.monitor.opentelemetry.exporter import AzureMonitorMetricExporter

# Reads APPLICATIONINSIGHTS_CONNECTION_STRING from env; AAD-authenticated ingestion via DefaultAzureCredential.
exporter = AzureMonitorMetricExporter(
    credential=DefaultAzureCredential(),
)

# Configure meter provider
reader = PeriodicExportingMetricReader(exporter, export_interval_millis=60000)
metrics.set_meter_provider(MeterProvider(metric_readers=[reader]))

# Use meter
meter = metrics.get_meter(__name__)
counter = meter.create_counter("requests_total")
counter.add(1, {"route": "/api/users"})

Log Exporter

python
import logging
from azure.identity import DefaultAzureCredential
from opentelemetry._logs import set_logger_provider
from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
from azure.monitor.opentelemetry.exporter import AzureMonitorLogExporter

# Reads APPLICATIONINSIGHTS_CONNECTION_STRING from env; AAD-authenticated ingestion via DefaultAzureCredential.
exporter = AzureMonitorLogExporter(
    credential=DefaultAzureCredential(),
)

# Configure logger provider
logger_provider = LoggerProvider()
logger_provider.add_log_record_processor(BatchLogRecordProcessor(exporter))
set_logger_provider(logger_provider)

# Add handler to Python logging
handler = LoggingHandler(level=logging.INFO, logger_provider=logger_provider)
logging.getLogger().addHandler(handler)

# Use logging
logger = logging.getLogger(__name__)
logger.info("This will be sent to Application Insights")

From Environment Variable

Exporters read APPLICATIONINSIGHTS_CONNECTION_STRING automatically:

python
from azure.identity import DefaultAzureCredential
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter

# Connection string from environment; AAD-authenticated ingestion via DefaultAzureCredential.
exporter = AzureMonitorTraceExporter(
    credential=DefaultAzureCredential(),
)

Azure AD Authentication

python
from azure.identity import DefaultAzureCredential, ManagedIdentityCredential
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter

# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
credential = DefaultAzureCredential(require_envvar=True)
# Or use a specific credential directly in production:
# See https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python#credential-classes
# credential = ManagedIdentityCredential()

exporter = AzureMonitorTraceExporter(
    credential=credential
)

Sampling

Use ApplicationInsightsSampler for consistent sampling:

python
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.sampling import ParentBasedTraceIdRatio
from azure.monitor.opentelemetry.exporter import ApplicationInsightsSampler

# Sample 10% of traces
sampler = ApplicationInsightsSampler(sampling_ratio=0.1)

trace.set_tracer_provider(TracerProvider(sampler=sampler))

Offline Storage

Configure offline storage for retry:

python
from azure.identity import DefaultAzureCredential
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter

exporter = AzureMonitorTraceExporter(
    credential=DefaultAzureCredential(),
    storage_directory="/path/to/storage",  # Custom storage path
    disable_offline_storage=False  # Enable retry (default)
)

Disable Offline Storage

python
exporter = AzureMonitorTraceExporter(
    credential=DefaultAzureCredential(),
    disable_offline_storage=True  # No retry on failure
)

Sovereign Clouds

python
from azure.identity import AzureAuthorityHosts, DefaultAzureCredential
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter

# Azure Government
credential = DefaultAzureCredential(authority=AzureAuthorityHosts.AZURE_GOVERNMENT)
exporter = AzureMonitorTraceExporter(
    connection_string="InstrumentationKey=xxx;IngestionEndpoint=https://xxx.in.applicationinsights.azure.us/",
    credential=credential
)

Exporter Types

ExporterTelemetry TypeApplication Insights Table
AzureMonitorTraceExporterTraces/Spansrequests, dependencies, exceptions
AzureMonitorMetricExporterMetricscustomMetrics, performanceCounters
AzureMonitorLogExporterLogstraces, customEvents

Configuration Options

ParameterDescriptionDefault
connection_stringApplication Insights connection stringFrom env var
credentialAzure credential for AAD authNone
disable_offline_storageDisable retry storageFalse
storage_directoryCustom storage pathTemp directory

Best Practices

  1. Pick sync OR async and stay consistent. Do not mix azure.xxx sync clients with azure.xxx.aio async clients in the same call path. Choose one mode per module.
  2. Call provider.shutdown() / force_flush() at process exit to flush telemetry — providers are not context managers.
  3. Use BatchSpanProcessor for production (not SimpleSpanProcessor)
  4. Use ApplicationInsightsSampler for consistent sampling across services
  5. Enable offline storage for reliability in production
  6. Use Microsoft Entra authentication instead of instrumentation keys
  7. Set export intervals appropriate for your workload
  8. Use the distro (azure-monitor-opentelemetry) unless you need custom pipelines

Reference Files

FileContents
references/capabilities.mdAdditional non-hero capabilities, operation-group coverage, and production checklists.
references/non-hero-scenarios.mdDedicated non-hero examples for secondary/advanced scenarios.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-exporter-py of microsoft/skills.

  • SKILL.md
  • references/capabilities.md
  • references/non-hero-scenarios.md

Open the folder on GitHubat commit d5741a1

Compare with similar skills

Azure Monitor Opentelemetry Exporter Py next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Azure Monitor Opentelemetry Exporter Py compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure Monitor Opentelemetry Exporter Py this skillmicrosoft/skills3.1k—~2.3kAutomated safety check: PassMIT
Azure Monitor Opentelemetry Exporter Pyaiskillstore/marketplace4334 repos~1.6kAutomated safety check: PassNone
Azure Microsoft OpentelemetryMicrosoftDocs/Agent-Skills776—~555Automated safety check: PassCC-BY-4.0
Agent Kill Switchvivekchand/clawmetry426—~1.1kAutomated safety check: PassMIT
Clawmetry Selfcheckvivekchand/clawmetry426—~515Automated safety check: PassMIT
Logfire Instrumentationbasicmachines-co/basic-memory4.1k—~2.3kAutomated safety check: PassAGPL-3.0

Similar skills

  • Azure Monitor OpenTelemetry Exporter for Python. An agent skill from aiskillstore/marketplace.

    433 GitHub starsUsed in 4 repos~1.6k tokens
    DevOps & CloudAuto-check passed
  • Azure Microsoft Opentelemetry

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure Microsoft Opentelemetry development including configuration.

    776 GitHub stars~555 tokensUpdated 5 days ago
    DevOps & CloudAuto-check passed
  • Agent Kill Switch

    vivekchand/clawmetry

    Give the human an off switch and a cost meter for the coding agents on this machine, using ClawMetry.

    426 GitHub stars~1.1k tokensUpdated 3 days ago
    DevOps & CloudAuto-check passed
  • Clawmetry Selfcheck

    vivekchand/clawmetry

    Read your own agent telemetry from ClawMetry (waste, progress, cost) and act on it before finishing a task.

    426 GitHub stars~515 tokensUpdated 3 days ago
    DevOps & CloudAuto-check passed
  • Logfire Instrumentation

    basicmachines-co/basic-memory

    Adds Pydantic Logfire tracing, logging and metrics to Python, JavaScript or TypeScript and Rust projects, with the correct setup order and library extras.

    4.1k GitHub stars~2.3k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Clawmetry

    vivekchand/clawmetry

    Real-time observability for OpenClaw agents — local dashboard + optional encrypted cloud sync.

    426 GitHub stars~992 tokensUpdated 3 days ago
    DevOps & CloudAuto-check passed

More from microsoft/skills

All 150 skills in this repo
  • Official

    Covers producer, consumer, and checkpoint-store setup for Azure Event Hubs streaming in Python, with Entra ID auth and partition targeting.

    3.1k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Official

    Builds podcast-style audio narration from text with Azure OpenAI's GPT Realtime Mini over WebSocket, from a Python FastAPI backend to a React player.

    3.1k GitHub starsUsed in 1 repo~947 tokens
    Auto-check passed
  • Frontend UI Dark TS

    microsoft/skills

    Official

    Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations.

    3.1k GitHub starsUsed in 5 repos~3.6k tokens
    Auto-check passed
  • Pydantic Models Py

    microsoft/skills

    Official

    Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants.

    3.1k GitHub starsUsed in 5 repos~496 tokens
    Auto-check passed
  • Official

    Reference for building on Microsoft Foundry with the azure-ai-projects Python SDK: project clients, versioned agents, evaluations, connections, datasets and indexes.

    3.1k GitHub stars~2.8k tokensUpdated yesterday
    Auto-check passed
  • Skill Creator

    microsoft/skills

    Official

    Guide for creating effective skills for AI coding agents working with Azure SDKs and Microsoft Foundry services.

    3.1k GitHub starsUsed in 5 repos~17k tokens
    Auto-check passed

Categories

Questions about Azure Monitor Opentelemetry Exporter Py

What does Azure Monitor Opentelemetry Exporter Py do?

Azure Monitor OpenTelemetry Exporter for Python. An agent skill from microsoft/skills. Azure Monitor Opentelemetry Exporter Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure Monitor OpenTelemetry Exporter for Python.

When should I use Azure Monitor Opentelemetry Exporter Py?

Azure Monitor Opentelemetry Exporter Py fits situations like: low-level OpenTelemetry export to Application Insights; tasks that involve Observability.

How do I install Azure Monitor Opentelemetry Exporter Py in Claude Code?

Run `npx skills add microsoft/skills --skill azure-monitor-opentelemetry-exporter-py -a claude-code`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-exporter-py in microsoft/skills) into .claude/skills/azure-monitor-opentelemetry-exporter-py in your project. Claude Code loads it when a task matches its description.

How do I install Azure Monitor Opentelemetry Exporter Py in Codex?

Run `npx skills add microsoft/skills --skill azure-monitor-opentelemetry-exporter-py -a codex`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-exporter-py in microsoft/skills) into .agents/skills/azure-monitor-opentelemetry-exporter-py in your project. Codex loads it when a task matches its description.

Can I use Azure Monitor Opentelemetry Exporter Py in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/skills --skill azure-monitor-opentelemetry-exporter-py -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/azure-monitor-opentelemetry-exporter-py, .gemini/skills/azure-monitor-opentelemetry-exporter-py, .github/skills/azure-monitor-opentelemetry-exporter-py and .opencode/skills/azure-monitor-opentelemetry-exporter-py in your project.

What does Azure Monitor Opentelemetry Exporter Py need to run?

Going by SKILL.md and its folder, Azure Monitor Opentelemetry Exporter Py needs the command-line tools its instructions call (pip) and credentials named AZURE_TOKEN_CREDENTIALS. Our summary lists: Python 3.

Does Azure Monitor Opentelemetry Exporter Py access the network?

SKILL.md names 3 domains. In commands or code: xxx.in.applicationinsights.azure.com, learn.microsoft.com and xxx.in.applicationinsights.azure.us; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Azure Monitor Opentelemetry Exporter Py safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Azure Monitor Opentelemetry Exporter Py use?

Azure Monitor Opentelemetry Exporter Py is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Azure Monitor Opentelemetry Exporter Py use?

About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.3k tokens, read only when the agent opens those files.

What are the alternatives to Azure Monitor Opentelemetry Exporter Py?

Skills that share tags, products or a category with Azure Monitor Opentelemetry Exporter Py: Azure Monitor Opentelemetry Exporter Py (aiskillstore/marketplace, 433 stars), Azure Microsoft Opentelemetry (MicrosoftDocs/Agent-Skills, 776 stars), Agent Kill Switch (vivekchand/clawmetry, 426 stars) and Clawmetry Selfcheck (vivekchand/clawmetry, 426 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure Monitor Opentelemetry Exporter Py?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/skills, which has 3,097 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on October 9, 2026.

Source: microsoft/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.