This guide explains how to configure OpenTelemetry (OTel) in Azure Monitor Application Insights. For .NET, Node.js, and Python, use the Microsoft OpenTelemetry Distro. For Java, use the Azure Monitor OpenTelemetry Distro and its existing agent or native-image integrations.
First, enable OpenTelemetry for your language.
The Microsoft OpenTelemetry Distro package identifiers and install commands are:
| Language |
Package |
Install command |
| Python |
microsoft-opentelemetry |
pip install microsoft-opentelemetry |
| Node.js |
@microsoft/opentelemetry |
npm install @microsoft/opentelemetry |
| .NET |
Microsoft.OpenTelemetry |
dotnet add package Microsoft.OpenTelemetry |
Don't initialize the Microsoft OpenTelemetry Distro and Azure Monitor OpenTelemetry Distro together. Azure Monitor remains the telemetry destination; standalone Azure Monitor exporters retain their existing names.
The .NET examples use Microsoft.OpenTelemetry and OpenTelemetry namespaces. Initialize Node.js instrumentation before application libraries load. ESM applications must preload the Microsoft OpenTelemetry Distro loader. Set APPLICATIONINSIGHTS_CONNECTION_STRING before starting the application unless an example sets the connection string in code.
Connection string
In Application Insights, a connection string defines the target location for sending telemetry data.
Use one of the following three ways to configure the connection string:
Configure UseMicrosoftOpenTelemetry() in Program.cs.
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
// Create the application builder.
var builder = WebApplication.CreateBuilder(args);
// Configure the Microsoft OpenTelemetry Distro.
builder.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
// Set the connection string for Azure Monitor export.
options.AzureMonitor.ConnectionString = "<ConnectionString>";
});
// Build the application with the configured telemetry services.
var app = builder.Build();
// Run the application and its telemetry providers.
app.Run();
Set an environment variable.
export APPLICATIONINSIGHTS_CONNECTION_STRING="<ConnectionString>"
Add the following section to appsettings.json, and then read it when initializing the distro.
{
"AzureMonitor": {
"ConnectionString": "<ConnectionString>"
}
}
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
// Create the application builder.
var builder = WebApplication.CreateBuilder(args);
// Configure the Microsoft OpenTelemetry Distro.
builder.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
// Read the environment setting before the application configuration.
options.AzureMonitor.ConnectionString =
builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"] ??
builder.Configuration["AzureMonitor:ConnectionString"];
});
// Build the application with the configured telemetry services.
var app = builder.Build();
// Run the application and its telemetry providers.
app.Run();
Note
An explicit options.AzureMonitor.ConnectionString value takes precedence. The configuration-file example checks the environment-variable key before the AzureMonitor section. Reading the section explicitly avoids relying on implicit configuration binding.
Use one of the following two methods to configure the connection string:
Configure the Microsoft OpenTelemetry Distro for all signals in application startup:
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
using OpenTelemetry;
// Create the SDK and keep its providers alive until application shutdown.
using var sdk = OpenTelemetrySdk.Create(telemetry =>
{
// Configure the Microsoft OpenTelemetry Distro.
telemetry.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
// Set the connection string for Azure Monitor export.
options.AzureMonitor.ConnectionString = "<ConnectionString>";
});
});
Keep sdk alive for the application lifetime. Dispose it only at shutdown to flush pending telemetry.
Set an environment variable.
export APPLICATIONINSIGHTS_CONNECTION_STRING="<ConnectionString>"
Note
If you set the connection string in more than one place, the following precedence order applies:
- Code
- Environment variable
Use one of the following three ways to configure the connection string:
Add the following section to your applicationinsights.json config file.
{
"connectionString": "<ConnectionString>"
}
You can also set the connection string by specifying a file to load it from. The file should contain only the connection string and nothing else. If you specify a relative path, it resolves relative to the directory where applicationinsights-agent-3.7.9.jar is located.
{
"connectionString": "${file:connection-string-file.txt}"
}
Set an environment variable.
APPLICATIONINSIGHTS_CONNECTION_STRING
Add applicationinsights.connection.string as a system property.
java -javaagent:"<AgentDirectory>/applicationinsights-agent-3.7.9.jar" \
-Dapplicationinsights.connection.string="<ConnectionString>" \
-jar "<AppJarPath>"
Note
If you set the connection string in more than one place, the following precedence order applies:
- System property
- Environment variable
- Configuration file
If you deploy multiple applications in the same Java Virtual Machine (JVM) and want them to send telemetry to different connection strings, see Connection string overrides (preview).
Use one of the following two ways to configure the connection string:
Set an environment variable.
export APPLICATIONINSIGHTS_CONNECTION_STRING="<ConnectionString>"
For Spring Boot, set the property in application.properties.
applicationinsights.connection.string=<ConnectionString>
Tip
For Microsoft OpenTelemetry Distro configuration examples, see the Node.js samples.
Use one of the following two ways to configure the connection string:
Set an environment variable.
export APPLICATIONINSIGHTS_CONNECTION_STRING="<ConnectionString>"
Use a configuration object.
export class BasicConnectionSample {
static async run() {
// Import the Microsoft OpenTelemetry Distro.
const { useMicrosoftOpenTelemetry } = await import("@microsoft/opentelemetry");
// Configure Azure Monitor export and the options used by this sample.
const options = {
azureMonitor: {
azureMonitorExporterOptions: {
connectionString:
process.env.APPLICATIONINSIGHTS_CONNECTION_STRING ||
"<ConnectionString>",
},
},
};
// Initialize the Microsoft OpenTelemetry Distro.
const monitor = useMicrosoftOpenTelemetry(options);
console.log("Azure Monitor initialized");
}
}
Use one of the following two ways to configure the connection string:
Set an environment variable.
export APPLICATIONINSIGHTS_CONNECTION_STRING="<ConnectionString>"
Use the use_microsoft_opentelemetry function and enable Azure Monitor export.
# Import the `use_microsoft_opentelemetry()` function from the
# `microsoft.opentelemetry` package.
from microsoft.opentelemetry import use_microsoft_opentelemetry
# Configure OpenTelemetry to use Azure Monitor with the specified connection string.
use_microsoft_opentelemetry(
enable_azure_monitor=True,
azure_monitor_connection_string="<ConnectionString>",
)
Set the Cloud Role Name and the Cloud Role Instance
The Microsoft OpenTelemetry Distro for .NET, Node.js, and Python, and Azure Monitor OpenTelemetry for Java, detect resource context where supported and provide default values for the Cloud Role Name and Cloud Role Instance. You can override those values for your application. The cloud role name appears on the Application Map as the name under a node.
Set the Cloud Role Name and the Cloud Role Instance through Resource attributes. Cloud Role Name uses service.namespace and service.name attributes, but it falls back to service.name if service.namespace isn't set. Cloud Role Instance uses the service.instance.id attribute value. For information on standard attributes for resources, see OpenTelemetry Semantic Conventions.
Set the Cloud Role Name and the Cloud Role Instance
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
using OpenTelemetry;
using OpenTelemetry.Resources;
// Define the service attributes used for cloud role name and instance.
var resourceAttributes = new Dictionary<string, object>
{
["service.name"] = "<ServiceName>",
["service.namespace"] = "<ServiceNamespace>",
["service.instance.id"] = "<ServiceInstanceId>"
};
// Create the application builder.
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenTelemetry()
// Configure the Microsoft OpenTelemetry Distro.
.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
})
// Apply the resource attributes to traces, metrics, and logs.
.ConfigureResource(resourceBuilder => resourceBuilder.AddAttributes(
resourceAttributes));
// Build the application with the configured telemetry services.
var app = builder.Build();
// Run the application and its telemetry providers.
app.Run();
Set the Cloud Role Name and the Cloud Role Instance through Resource attributes. Cloud Role Name uses service.namespace and service.name attributes, but it falls back to service.name if service.namespace isn't set. Cloud Role Instance uses the service.instance.id attribute value. For information on standard attributes for resources, see OpenTelemetry Semantic Conventions.
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
using OpenTelemetry;
using OpenTelemetry.Resources;
// Define the service attributes used for cloud role name and instance.
var resourceAttributes = new Dictionary<string, object>
{
["service.name"] = "<ServiceName>",
["service.namespace"] = "<ServiceNamespace>",
["service.instance.id"] = "<ServiceInstanceId>"
};
// Create the SDK and keep its providers alive until application shutdown.
using var sdk = OpenTelemetrySdk.Create(telemetry =>
{
// Configure the Microsoft OpenTelemetry Distro.
telemetry.UseMicrosoftOpenTelemetry(options =>
options.Exporters = ExportTarget.AzureMonitor)
// Apply the resource attributes to traces, metrics, and logs.
.ConfigureResource(resourceBuilder =>
resourceBuilder.AddAttributes(resourceAttributes));
});
Note
If you don't set the cloud role name and cloud role instance, the cloud role name defaults to the name of your Application Insights resource, and the cloud role instance defaults to the machine name.
Use one of the following three ways to configure the cloud role name and cloud role instance:
Add the following section to your applicationinsights.json config file.
Set role.name to the cloud role name and role.instance to the cloud role instance:
{
"role": {
"name": "<CloudRoleName>",
"instance": "<CloudRoleInstance>"
}
}
Set environment variables.
APPLICATIONINSIGHTS_ROLE_NAME
APPLICATIONINSIGHTS_ROLE_INSTANCE
Add applicationinsights.role.name and applicationinsights.role.instance as system properties.
java -javaagent:"<AgentDirectory>/applicationinsights-agent-3.7.9.jar" \
-Dapplicationinsights.role.name="<CloudRoleName>" \
-Dapplicationinsights.role.instance="<CloudRoleInstance>" \
-jar "<AppJarPath>"
Note
If you set the cloud role name and cloud role instance in more than one place, the following precedence order applies:
- System property
- Environment variable
- Configuration file
If you deploy multiple applications in the same JVM and want them to send telemetry to different cloud role names, see Cloud role name overrides (preview).
To set the cloud role name:
- Use the
spring.application.name for Spring Boot native image applications.
- Use the
quarkus.application.name for Quarkus native image applications.
Note
The Quarkus community supports and maintains Quarkus extensions. For help, use Quarkus community support channels. Microsoft doesn't provide technical support for this integration.
Set the Cloud Role Name and the Cloud Role Instance through Resource attributes. Cloud Role Name uses service.namespace and service.name attributes, but it falls back to service.name if service.namespace isn't set. Cloud Role Instance uses the service.instance.id attribute value. For information on standard attributes for resources, see OpenTelemetry Semantic Conventions.
Set the Cloud Role Name and the Cloud Role Instance
export class CloudRoleSample {
static async run() {
// Import the Microsoft OpenTelemetry Distro.
const { useMicrosoftOpenTelemetry } = await import("@microsoft/opentelemetry");
const { resourceFromAttributes } = await import("@opentelemetry/resources");
const { ATTR_SERVICE_NAME } = await import("@opentelemetry/semantic-conventions");
const { ATTR_SERVICE_NAMESPACE, ATTR_SERVICE_INSTANCE_ID } = await import(
"@opentelemetry/semantic-conventions/incubating"
);
// Set the service attributes used for cloud role name and instance.
const customResource = resourceFromAttributes({
[ATTR_SERVICE_NAME]: process.env.OTEL_SERVICE_NAME || "<ServiceName>",
[ATTR_SERVICE_NAMESPACE]:
process.env.OTEL_SERVICE_NAMESPACE || "<ServiceNamespace>",
[ATTR_SERVICE_INSTANCE_ID]:
process.env.OTEL_SERVICE_INSTANCE_ID || "<ServiceInstanceId>",
});
// Configure Azure Monitor export and the options used by this sample.
const options = {
azureMonitor: {
azureMonitorExporterOptions: {
connectionString:
process.env.APPLICATIONINSIGHTS_CONNECTION_STRING ||
"<ConnectionString>",
},
},
resource: customResource,
};
// Initialize the Microsoft OpenTelemetry Distro.
const monitor = useMicrosoftOpenTelemetry(options);
console.log("Azure Monitor initialized (custom resource)");
}
}
Set the Cloud Role Name and the Cloud Role Instance via Resource attributes. Cloud Role Name uses service.namespace and service.name attributes, although it falls back to service.name if service.namespace isn't set. Cloud Role Instance uses the service.instance.id attribute value. For information on standard attributes for resources, see OpenTelemetry Semantic Conventions.
Set Resource attributes using the OTEL_RESOURCE_ATTRIBUTES and/or OTEL_SERVICE_NAME environment variables. OTEL_RESOURCE_ATTRIBUTES takes a series of comma-separated key-value pairs. You can combine the service namespace and service name to set the Cloud Role Name, and use the service instance ID to set the Cloud Role Instance:
serviceName="<ServiceName>"
serviceNamespace="<ServiceNamespace>"
serviceInstanceId="<ServiceInstanceId>"
resourceAttributes="service.namespace=$serviceNamespace"
resourceAttributes+=",service.instance.id=$serviceInstanceId"
export OTEL_RESOURCE_ATTRIBUTES="$resourceAttributes"
export OTEL_SERVICE_NAME="$serviceName"
If you don't set the service.namespace Resource attribute, you can alternatively set the Cloud Role Name with only the OTEL_SERVICE_NAME environment variable or the service.name Resource attribute:
export OTEL_RESOURCE_ATTRIBUTES="service.instance.id=<ServiceInstanceId>"
export OTEL_SERVICE_NAME="<ServiceName>"
Set resource attributes
The Microsoft OpenTelemetry Distro for .NET, Node.js, and Python, and Azure Monitor OpenTelemetry for Java, enable resource detection in supported Azure environments. For more information, see Automatic data collection and resource detectors.
For manual setups, set resource attributes directly by using standard OpenTelemetry options:
# Set variables
serviceName="<ServiceName>"
location="<Location>"
subscriptionId="<SubscriptionId>"
resourceGroupName="<ResourceGroupName>"
appName="<AppName>"
# Build App Service resource ID
path="/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName"
provider="/providers/Microsoft.Web/sites/$appName"
resourceId="$path$provider"
resourceAttributes="cloud.provider=azure,cloud.region=$location"
resourceAttributes+=",cloud.resource_id=$resourceId"
export OTEL_SERVICE_NAME="$serviceName"
export OTEL_RESOURCE_ATTRIBUTES="$resourceAttributes"
On Windows PowerShell:
# Set variables
$serviceName = "<ServiceName>"
$location = "<Location>"
$subscriptionId = "<SubscriptionId>"
$resourceGroupName = "<ResourceGroupName>"
$appName = "<AppName>"
# Build App Service resource ID
$path = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName"
$provider = "/providers/Microsoft.Web/sites/$appName"
$resourceId = "$path$provider"
$resourceAttributes = "cloud.provider=azure,cloud.region=$location"
$resourceAttributes += ",cloud.resource_id=$resourceId"
$env:OTEL_SERVICE_NAME = $serviceName
$env:OTEL_RESOURCE_ATTRIBUTES = $resourceAttributes
Enable sampling
Sampling reduces telemetry ingestion volume and cost. The distros support fixed-percentage and rate-limited sampling for Azure Monitor export. You can also align application logs with trace sampling decisions. The sampler attaches sampling information to exported spans so Application Insights can adjust experience counts. For a conceptual overview, see Learn more about sampling.
Important
- Sampling decisions apply to traces (spans).
- Logs can follow trace sampling decisions. This behavior is enabled by default in the Microsoft OpenTelemetry Distro for .NET and disabled by default in the Node.js and Python versions of the Microsoft OpenTelemetry Distro. See trace-based sampling for logs.
- Metrics are never sampled.
Use standard OpenTelemetry environment variables to select the sampler and provide its argument where your distro reads them. Choose one configuration method; you don't need to configure the same sampling settings in both code and environment variables. Follow the version-specific guidance in the .NET tabs. For more information about sampler names, see OTEL_TRACES_SAMPLER.
For Microsoft.OpenTelemetry 1.1.0, use the code examples to set sampling in UseMicrosoftOpenTelemetry(). You don't also need to set OTEL_TRACES_SAMPLER or OTEL_TRACES_SAMPLER_ARG.
For Microsoft.OpenTelemetry 1.1.0, use the code examples inside OpenTelemetrySdk.Create(). Configure sampling through the distro options once; you don't also need to set sampler environment variables.
Note
Starting with Java agent version 3.4.0, rate-limited sampling is available and is now the default.
Sampling only applies to logs inside of a request. Logs that aren't inside of a request (for example, startup logs) are always collected by default. If you want to sample those logs, use sampling overrides.
Fixed-percentage sampling
APPLICATIONINSIGHTS_SAMPLING_PERCENTAGE — sampling percentage
- Value is a percentage (for example,
33.333 = ~33.333%).
Rate-limited sampling
APPLICATIONINSIGHTS_SAMPLING_REQUESTS_PER_SECOND — maximum requests per second
For configuration options and examples, see Configure sampling overrides.
The following examples set the sampling environment variables for Node.js and Python. For the .NET version covered in the preceding tabs, use code-based configuration instead.
Note
The following examples aren't valid for Java. For the correct environment variables, see the previous Java tab.
Fixed-percentage sampling (~10%)
export OTEL_TRACES_SAMPLER="microsoft.fixed_percentage"
export OTEL_TRACES_SAMPLER_ARG=0.1
Rate-limited sampling (~1.5 traces/sec)
export OTEL_TRACES_SAMPLER="microsoft.rate_limited"
export OTEL_TRACES_SAMPLER_ARG=1.5
Note
Sampler configuration and precedence depend on the language. The .NET examples set distro options explicitly. Python uses the sampler environment variables. For Node.js, avoid conflicting settings in code and the environment.
Fixed percentage sampling
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
// Create the application builder.
var builder = WebApplication.CreateBuilder(args);
// Configure the Microsoft OpenTelemetry Distro.
builder.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
// Select fixed-percentage sampling instead of rate-limited sampling.
options.AzureMonitor.TracesPerSecond = null;
// Keep approximately 10% of traces.
options.AzureMonitor.SamplingRatio = 0.1F;
});
// Build the application with the configured telemetry services.
var app = builder.Build();
// Run the application and its telemetry providers.
app.Run();
Rate-limited sampling
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
// Create the application builder.
var builder = WebApplication.CreateBuilder(args);
// Configure the Microsoft OpenTelemetry Distro.
builder.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
// Limit sampling to approximately 1.5 traces per second.
options.AzureMonitor.TracesPerSecond = 1.5;
});
// Build the application with the configured telemetry services.
var app = builder.Build();
// Run the application and its telemetry providers.
app.Run();
Note
The Microsoft OpenTelemetry Distro for .NET defaults to rate-limited sampling at five traces per second. Set TracesPerSecond to null when selecting fixed-percentage sampling in code.
Fixed percentage sampling
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
using OpenTelemetry;
// Create the SDK and keep its providers alive until application shutdown.
using var sdk = OpenTelemetrySdk.Create(telemetry =>
{
// Configure the Microsoft OpenTelemetry Distro.
telemetry.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
// Select fixed-percentage sampling instead of rate-limited sampling.
options.AzureMonitor.TracesPerSecond = null;
// Keep approximately 10% of traces.
options.AzureMonitor.SamplingRatio = 0.1F;
});
});
Rate-limited sampling
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
using OpenTelemetry;
// Create the SDK and keep its providers alive until application shutdown.
using var sdk = OpenTelemetrySdk.Create(telemetry =>
{
// Configure the Microsoft OpenTelemetry Distro.
telemetry.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
// Limit sampling to approximately 1.5 traces per second.
options.AzureMonitor.TracesPerSecond = 1.5;
});
});
Note
The Microsoft OpenTelemetry Distro for .NET defaults to rate-limited sampling at five traces per second. Keep the SDK alive for the application lifetime.
For Java, you can't configure sampling in code.
The Microsoft OpenTelemetry Distro for Node.js defaults to rate-limited sampling at five traces per second. Set tracesPerSecond: 0 to use samplingRatio instead.
Fixed percentage sampling
// Import the Microsoft OpenTelemetry Distro.
const { useMicrosoftOpenTelemetry } = await import("@microsoft/opentelemetry");
// Initialize the Microsoft OpenTelemetry Distro.
const monitor = useMicrosoftOpenTelemetry({
azureMonitor: {
azureMonitorExporterOptions: {
connectionString:
process.env.APPLICATIONINSIGHTS_CONNECTION_STRING || "<ConnectionString>",
},
},
// Keep approximately 10% of traces.
samplingRatio: 0.1,
// Use the sampling ratio instead of a rate limit.
tracesPerSecond: 0,
});
Rate-limited sampling
// Import the Microsoft OpenTelemetry Distro.
const { useMicrosoftOpenTelemetry } = await import("@microsoft/opentelemetry");
// Initialize the Microsoft OpenTelemetry Distro.
const monitor = useMicrosoftOpenTelemetry({
azureMonitor: {
azureMonitorExporterOptions: {
connectionString:
process.env.APPLICATIONINSIGHTS_CONNECTION_STRING || "<ConnectionString>",
},
},
// Limit sampling to approximately 1.5 traces per second.
tracesPerSecond: 1.5,
});
Note
If you don't set a sampler in code or through environment variables, Azure Monitor uses RateLimitedSampler by default.
The Microsoft OpenTelemetry Distro for Python defaults to rate-limited sampling at five traces per second. Configure the sampler through environment variables before initializing the distro.
Fixed percentage sampling
import os
from microsoft.opentelemetry import use_microsoft_opentelemetry
# Select the sampler before initializing the distro.
os.environ["OTEL_TRACES_SAMPLER"] = "microsoft.fixed_percentage"
# Keep approximately 10% of traces.
os.environ["OTEL_TRACES_SAMPLER_ARG"] = "0.1"
# Initialize the Microsoft OpenTelemetry Distro with Azure Monitor export.
use_microsoft_opentelemetry(
enable_azure_monitor=True,
azure_monitor_connection_string="<ConnectionString>",
)
Rate-limited sampling
import os
from microsoft.opentelemetry import use_microsoft_opentelemetry
# Select the sampler before initializing the distro.
os.environ["OTEL_TRACES_SAMPLER"] = "microsoft.rate_limited"
# Limit sampling to approximately 1.5 traces per second.
os.environ["OTEL_TRACES_SAMPLER_ARG"] = "1.5"
# Initialize the Microsoft OpenTelemetry Distro with Azure Monitor export.
use_microsoft_opentelemetry(
enable_azure_monitor=True,
azure_monitor_connection_string="<ConnectionString>",
)
Note
Use OTEL_TRACES_SAMPLER and OTEL_TRACES_SAMPLER_ARG for Python sampling. Don't carry over the older Azure Monitor distro's sampling_ratio and traces_per_second arguments.
Tip
When using fixed-percentage sampling and you're not sure what value to set for the sampling rate, start at 5% (0.05). Adjust the rate based on the accuracy of the operations shown in the failures and performance panes. Any sampling reduces accuracy, so alert on OpenTelemetry metrics, which are unaffected by sampling.
Read your sampling settings from builder.Configuration and assign them to options.AzureMonitor.SamplingRatio or options.AzureMonitor.TracesPerSecond when initializing the Microsoft OpenTelemetry Distro. If you select percentage sampling, also set TracesPerSecond = null. Validate ratios from 0 through 1 and nonnegative rate limits. You don't also need sampler environment variables for this configuration.
Load your application's configuration and pass the validated values to UseMicrosoftOpenTelemetry() inside OpenTelemetrySdk.Create(). Use the same sampling properties as the code examples; the distro doesn't need a second provider or a separate exporter.
Note
Starting with Java agent version 3.4.0, rate-limited sampling is available and is now the default.
Sampling only applies to logs inside of a request. Logs that aren't inside of a request (for example, startup logs) are always collected by default. If you want to sample those logs, use sampling overrides.
If you don't configure sampling, the default is now rate-limited sampling configured to capture at most (approximately) five requests per second, along with all the dependencies and logs on those requests.
This configuration replaces the prior default, which was to capture all requests. If you still want to capture all requests, use fixed-percentage sampling and set the sampling percentage to 100.
Fixed percentage sampling
This example shows how to set the sampling to capture approximately a third of all requests:
{
"sampling": {
"percentage": 33.333
}
}
Set the sampling percentage by using the environment variable. It takes precedence over the sampling percentage specified in the JSON configuration.
Tip
For the sampling percentage, choose a percentage that's close to 100/N, where N is an integer. Currently, sampling doesn't support other values.
Rate-limited sampling
Note
The rate-limited sampling is approximate because internally it must adapt a "fixed" sampling percentage over time to emit accurate item counts on each telemetry record. Internally, the rate-limited sampling is tuned to adapt quickly (0.1 seconds) to new application loads. For this reason, you shouldn't see it exceed the configured rate by much, or for very long.
This example shows how to set the sampling to capture at most (approximately) one request per second:
{
"sampling": {
"requestsPerSecond": 1
}
}
The requestsPerSecond value can be a decimal, so you can configure it to capture less than one request per second if you want. For example, a value of 0.5 means capture at most one request every 2 seconds.
Set the rate limit by using the environment variable. It takes precedence over the rate limit specified in the JSON configuration.
Java native doesn't support configuring sampling in a configuration file. To configure sampling, use code or environment variables.
Configure Microsoft OpenTelemetry Distro sampling in the useMicrosoftOpenTelemetry() options or through environment variables. Don't edit an applicationinsights.json file inside the installed package. The Microsoft OpenTelemetry Distro configuration reference describes the supported options.
Python doesn't support configuring sampling in a configuration file. To configure sampling, use code or environment variables.
When you enable this feature, the system drops log records that belong to unsampled traces so your logs stay aligned with trace sampling.
- A log record is part of a trace when it has a valid
SpanId.
- If the associated trace's
TraceFlags indicate not sampled, the feature drops the log record.
- Log records without any trace context aren't affected.
- The default depends on the language and distro version. See the per-language settings that follow.
Use the following settings to configure trace-based log sampling:
The distro enables trace-based log sampling by default. Set EnableTraceBasedLogsSampler to false to disable it.
// Configure the Microsoft OpenTelemetry Distro.
builder.Services.AddOpenTelemetry().UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
});
The distro enables trace-based log sampling by default, including non-hosted applications. Set EnableTraceBasedLogsSampler to false to disable it.
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
using OpenTelemetry;
// Create the SDK and keep its providers alive until application shutdown.
using var sdk = OpenTelemetrySdk.Create(telemetry =>
{
// Configure the Microsoft OpenTelemetry Distro.
telemetry.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
});
});
For Java applications, trace-based sampling is enabled by default.
For Spring Boot native and Quarkus native applications, trace-based sampling is enabled by default.
Note
The Quarkus community supports and maintains Quarkus extensions. For help, use Quarkus community support channels. Microsoft doesn't provide technical support for this integration.
// Import the Microsoft OpenTelemetry Distro.
const { useMicrosoftOpenTelemetry } = await import("@microsoft/opentelemetry");
// Initialize the Microsoft OpenTelemetry Distro.
const monitor = useMicrosoftOpenTelemetry({
azureMonitor: {
// Drop logs associated with unsampled traces.
enableTraceBasedSamplingForLogs: true,
azureMonitorExporterOptions: {
connectionString:
process.env.APPLICATIONINSIGHTS_CONNECTION_STRING || "<ConnectionString>",
},
},
});
from microsoft.opentelemetry import use_microsoft_opentelemetry
# Initialize the Microsoft OpenTelemetry Distro with Azure Monitor export.
use_microsoft_opentelemetry(
enable_azure_monitor=True,
azure_monitor_connection_string="<ConnectionString>",
# Drop logs associated with unsampled traces.
enable_trace_based_sampling_for_logs=True,
)
Live metrics
Live metrics provides a real-time analytics dashboard for insight into application activity and performance.
This feature is enabled by default.
You can disable Live Metrics when you configure the Microsoft OpenTelemetry Distro.
// Configure the Microsoft OpenTelemetry Distro.
builder.Services.AddOpenTelemetry().UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
// Disable Live Metrics.
options.AzureMonitor.EnableLiveMetrics = false;
});
Live Metrics is enabled by default in the Microsoft OpenTelemetry Distro for .NET, including non-hosted applications. To disable it, set options.AzureMonitor.EnableLiveMetrics to false:
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
using OpenTelemetry;
// Create the SDK and keep its providers alive until application shutdown.
using var sdk = OpenTelemetrySdk.Create(telemetry =>
{
// Configure the Microsoft OpenTelemetry Distro.
telemetry.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
// Disable Live Metrics.
options.AzureMonitor.EnableLiveMetrics = false;
});
});
The standalone Azure Monitor OpenTelemetry Exporter doesn't include Live Metrics.
Live Metrics isn't available for GraalVM native applications.
Live Metrics is enabled by default. You can enable or disable it with azureMonitor.enableLiveMetrics when configuring the Microsoft OpenTelemetry Distro.
export class LiveMetricsSample {
static async run() {
// Import the Microsoft OpenTelemetry Distro.
const { useMicrosoftOpenTelemetry } = await import("@microsoft/opentelemetry");
// Configure Azure Monitor export and the options used by this sample.
const options = {
azureMonitor: {
azureMonitorExporterOptions: {
connectionString:
process.env.APPLICATIONINSIGHTS_CONNECTION_STRING ||
"<ConnectionString>",
},
enableLiveMetrics: true,
},
};
// Initialize the Microsoft OpenTelemetry Distro.
const monitor = useMicrosoftOpenTelemetry(options);
console.log("Azure Monitor initialized (live metrics enabled)");
}
}
Live Metrics is enabled by default. You can disable Live Metrics when you configure the Distro.
...
# Initialize the Microsoft OpenTelemetry Distro with Azure Monitor export.
use_microsoft_opentelemetry(
enable_azure_monitor=True,
azure_monitor_enable_live_metrics=False, # To disable live metrics
)
...
To create a more secure connection to Azure, enable Microsoft Entra authentication. This authentication method prevents unauthorized telemetry from being ingested into your subscription.
For more information, see the dedicated Microsoft Entra authentication page linked for each supported language.
Microsoft Entra ID authentication isn't available for GraalVM Native applications.
Offline storage and automatic retries
Azure Monitor OpenTelemetry-based offerings cache telemetry when an application disconnects from Application Insights and retry sending for up to 48 hours. For data handling recommendations, see Export and delete private data. High-load applications occasionally drop telemetry for two reasons: exceeding the allowable time or exceeding the maximum file size. When necessary, the product prioritizes recent events over old ones.
The Microsoft OpenTelemetry Distro includes the AzureMonitorExporter, which by default uses one of the following locations for offline storage (listed in order of precedence):
Windows
- %LOCALAPPDATA%\Microsoft\AzureMonitor
- %TEMP%\Microsoft\AzureMonitor
Non-Windows
- %TMPDIR%/Microsoft/AzureMonitor
- /var/tmp/Microsoft/AzureMonitor
- /tmp/Microsoft/AzureMonitor
To override the default directory, set options.AzureMonitor.StorageDirectory when configuring the Microsoft OpenTelemetry Distro.
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
// Create the application builder.
var builder = WebApplication.CreateBuilder(args);
// Configure the Microsoft OpenTelemetry Distro.
builder.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
// Store telemetry here when the exporter cannot send it immediately.
options.AzureMonitor.StorageDirectory = "<StorageDirectory>";
});
// Build the application with the configured telemetry services.
var app = builder.Build();
// Run the application and its telemetry providers.
app.Run();
To disable this feature, set options.AzureMonitor.DisableOfflineStorage = true.
By default, the AzureMonitorExporter uses one of the following locations for offline storage, listed in order of precedence:
Windows
- %LOCALAPPDATA%\Microsoft\AzureMonitor
- %TEMP%\Microsoft\AzureMonitor
Non-Windows
- %TMPDIR%/Microsoft/AzureMonitor
- /var/tmp/Microsoft/AzureMonitor
- /tmp/Microsoft/AzureMonitor
To override the default directory for the Microsoft OpenTelemetry Distro, set options.AzureMonitor.StorageDirectory.
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
using OpenTelemetry;
// Create the SDK and keep its providers alive until application shutdown.
using var sdk = OpenTelemetrySdk.Create(telemetry =>
{
// Configure the Microsoft OpenTelemetry Distro.
telemetry.UseMicrosoftOpenTelemetry(options =>
{
options.Exporters = ExportTarget.AzureMonitor;
// Store telemetry here when the exporter cannot send it immediately.
options.AzureMonitor.StorageDirectory = "<StorageDirectory>";
});
});
To disable this feature, set options.AzureMonitor.DisableOfflineStorage = true.
When the agent can't send telemetry to Azure Monitor, it stores telemetry files on disk. The files are saved in a telemetry folder under the directory specified by the java.io.tmpdir system property. Each file name starts with a timestamp and ends with the .trn extension. This offline storage mechanism helps ensure telemetry is retained during temporary network outages or ingestion failures.
The agent stores up to 50 MB of telemetry data by default and allows configuration of the storage limit. The agent periodically attempts to send stored telemetry. Telemetry files older than 48 hours are deleted, and the oldest events are discarded when the storage limit is reached.
For a full list of available configurations, see Configuration options.
When the agent can't send telemetry to Azure Monitor, it stores telemetry files on disk. The files are saved in a telemetry folder under the directory specified by the java.io.tmpdir system property. Each file name starts with a timestamp and ends with the .trn extension. This offline storage mechanism helps ensure telemetry is retained during temporary network outages or ingestion failures.
The agent stores up to 50 MB of telemetry data by default. Attempts to send stored telemetry are made periodically. Telemetry files older than 48 hours are deleted and the oldest events are discarded when the storage limit is reached.
By default, the AzureMonitorExporter uses one of the following locations for offline storage.
- Windows
- %TEMP%\Microsoft-AzureMonitor-
<unique-identifier>\opentelemetry-nodejs-<your-instrumentation-key>
- Non-Windows
- %TMPDIR%/Microsoft/Microsoft-AzureMonitor-
<unique-identifier>/opentelemetry-nodejs-<your-instrumentation-key>
- /var/tmp/Microsoft/Microsoft-AzureMonitor-
<unique-identifier>/opentelemetry-nodejs-<your-instrumentation-key>
The <unique-identifier> is a hash created from user environment attributes like instrumentation key, process name, username, and application directory. This identifier solves a common multi-user system problem: when the first user creates the storage directory, their file permissions (umask settings) might block other users from accessing the same path. A unique directory for each user context ensures every user gets their own storage location with proper access permissions.
To override the default directory, set azureMonitor.azureMonitorExporterOptions.storageDirectory.
For example:
export class OfflineStorageSample {
static async run() {
// Import the Microsoft OpenTelemetry Distro.
const { useMicrosoftOpenTelemetry } = await import("@microsoft/opentelemetry");
// Configure Azure Monitor export and the options used by this sample.
const options = {
azureMonitor: {
azureMonitorExporterOptions: {
connectionString:
process.env.APPLICATIONINSIGHTS_CONNECTION_STRING ||
"<ConnectionString>",
// Store telemetry here when the exporter cannot send it immediately.
storageDirectory: "<StorageDirectory>",
disableOfflineStorage: false, // set to true to disable
},
},
};
// Initialize the Microsoft OpenTelemetry Distro.
const monitor = useMicrosoftOpenTelemetry(options);
console.log("Azure Monitor initialized (offline storage configured)");
}
}
To disable this feature, set azureMonitor.azureMonitorExporterOptions.disableOfflineStorage = true.
By default, Azure Monitor exporters use the following path:
<tempfile.gettempdir()>/Microsoft-AzureMonitor-<unique-identifier>/opentelemetry-python-<your-instrumentation-key>
The <unique-identifier> is a hash created from user environment attributes like instrumentation key, process name, username, and application directory. This identifier solves a common multi-user system problem: when the first user creates the storage directory, their file permissions (umask settings) might block other users from accessing the same path. A unique directory for each user context ensures every user gets their own storage location with proper access permissions.
To override the default directory, set azure_monitor_exporter_storage_directory to the directory you want.
For example:
...
# Configure OpenTelemetry to use Azure Monitor with the specified connection string and
# storage directory.
use_microsoft_opentelemetry(
enable_azure_monitor=True,
azure_monitor_connection_string="<ConnectionString>",
azure_monitor_exporter_storage_directory="<StorageDirectory>",
)
...
To disable this feature, set azure_monitor_exporter_disable_offline_storage to True. The default is False.
For example:
...
# Configure OpenTelemetry to use Azure Monitor with the specified connection string and
# disable offline storage.
use_microsoft_opentelemetry(
enable_azure_monitor=True,
azure_monitor_connection_string="<ConnectionString>",
azure_monitor_exporter_disable_offline_storage=True,
)
...
Enable the OTLP Exporter
You might want to enable the OpenTelemetry Protocol (OTLP) Exporter alongside the Azure Monitor Exporter to send your telemetry to two locations.
Note
The OTLP Exporter is shown for convenience only. Microsoft doesn't officially support the OTLP Exporter or any components or third-party experiences downstream of it.
The Microsoft OpenTelemetry Distro includes OTLP export. Configure your collector endpoint with OTEL_EXPORTER_OTLP_ENDPOINT, and select both destinations:
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
// Create the application builder.
var builder = WebApplication.CreateBuilder(args);
// Configure the Microsoft OpenTelemetry Distro.
builder.UseMicrosoftOpenTelemetry(options =>
{
// Send telemetry to Azure Monitor and the configured OTLP collector.
options.Exporters = ExportTarget.AzureMonitor | ExportTarget.Otlp;
});
// Build the application with the configured telemetry services.
var app = builder.Build();
// Run the application and its telemetry providers.
app.Run();
Configure your collector endpoint with OTEL_EXPORTER_OTLP_ENDPOINT, and select both destinations. Keep the SDK alive until application shutdown:
// Import the Microsoft OpenTelemetry Distro and supporting APIs.
using Microsoft.OpenTelemetry;
using OpenTelemetry;
// Create the SDK and keep its providers alive until application shutdown.
using var sdk = OpenTelemetrySdk.Create(telemetry =>
{
// Configure the Microsoft OpenTelemetry Distro.
telemetry.UseMicrosoftOpenTelemetry(options =>
{
// Send telemetry to Azure Monitor and the configured OTLP collector.
options.Exporters = ExportTarget.AzureMonitor | ExportTarget.Otlp;
});
});
You can't enable the OpenTelemetry Protocol (OTLP) Exporter alongside the Azure Monitor Exporter to send your telemetry to two locations.
Install the OpenTelemetry Collector Trace Exporter and other OpenTelemetry packages in your project.
npm install @opentelemetry/api
npm install @opentelemetry/exporter-trace-otlp-http
npm install @opentelemetry/sdk-trace-base
npm install @opentelemetry/sdk-trace-node
Add the following code snippet. This example assumes you have an OpenTelemetry Collector with an OTLP receiver running. For details, see the example on GitHub.
Enable the OTLP Exporter
export class OtlpExporterSample {
static async run() {
// Import the Microsoft OpenTelemetry Distro.
const { useMicrosoftOpenTelemetry } = await import("@microsoft/opentelemetry");
const { BatchSpanProcessor } = await import("@opentelemetry/sdk-trace-base");
const { OTLPTraceExporter } = await import(
"@opentelemetry/exporter-trace-otlp-http"
);
// Create an OTLP trace exporter (set 'url' if your collector isn't on the default
// endpoint).
const otlpExporter = new OTLPTraceExporter({
// url: "http://localhost:4318/v1/traces",
});
// Configure Azure Monitor and add the OTLP exporter as an additional span
// processor.
const options = {
azureMonitor: {
azureMonitorExporterOptions: {
connectionString:
process.env.APPLICATIONINSIGHTS_CONNECTION_STRING ||
"<ConnectionString>",
},
},
spanProcessors: [new BatchSpanProcessor(otlpExporter)],
};
// Initialize the Microsoft OpenTelemetry Distro.
const monitor = useMicrosoftOpenTelemetry(options);
console.log("Azure Monitor initialized (OTLP exporter added)");
}
}
Install the opentelemetry-exporter-otlp package.
Add the following code snippet. This example assumes you have an OpenTelemetry Collector with an OTLP receiver running. For details, see this README.
Enable the OTLP Exporter
# Import the `use_microsoft_opentelemetry()`, `trace`, `OTLPSpanExporter`, and
# `BatchSpanProcessor` classes from the appropriate packages.
from microsoft.opentelemetry import use_microsoft_opentelemetry
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace.export import BatchSpanProcessor
# Configure OpenTelemetry to use Azure Monitor with the specified connection string.
use_microsoft_opentelemetry(
enable_azure_monitor=True,
azure_monitor_connection_string="<ConnectionString>",
)
# Get the tracer for the current module.
tracer = trace.get_tracer(__name__)
# Create an OTLP span exporter that sends spans to the specified endpoint.
# Replace `http://localhost:4317` with the endpoint of your OTLP collector.
otlpExporter = OTLPSpanExporter(endpoint="http://localhost:4317")
# Create a batch span processor that uses the OTLP span exporter.
spanProcessor = BatchSpanProcessor(otlpExporter)
# Add the batch span processor to the tracer provider.
trace.get_tracer_provider().add_span_processor(spanProcessor)
# Start a new span with the name "test".
with tracer.start_as_current_span("test"):
print("Hello world!")
OpenTelemetry configurations
You can configure the following settings through environment variables. Use the tab for your language and distro.
| Environment variable |
Description |
APPLICATIONINSIGHTS_CONNECTION_STRING |
Set this variable to the connection string for your Application Insights resource. |
APPLICATIONINSIGHTS_STATSBEAT_DISABLED |
Set this variable to true to opt out of internal metrics collection. |
OTEL_RESOURCE_ATTRIBUTES |
Key-value pairs to use as resource attributes. For more information about resource attributes, see the Resource SDK specification. |
OTEL_SERVICE_NAME |
Sets the value of the service.name resource attribute. If service.name is also provided in OTEL_RESOURCE_ATTRIBUTES, OTEL_SERVICE_NAME takes precedence. |
| Environment variable |
Description |
APPLICATIONINSIGHTS_CONNECTION_STRING |
Set this variable to the connection string for your Application Insights resource. |
APPLICATIONINSIGHTS_STATSBEAT_DISABLED |
Set this variable to true to opt out of internal metrics collection. |
OTEL_RESOURCE_ATTRIBUTES |
Key-value pairs to use as resource attributes. For more information about resource attributes, see the Resource SDK specification. |
OTEL_SERVICE_NAME |
Sets the value of the service.name resource attribute. If service.name is also provided in OTEL_RESOURCE_ATTRIBUTES, OTEL_SERVICE_NAME takes precedence. |
Redact URL query strings
To redact URL query strings, turn off query string collection. This setting is recommended if you call Azure storage by using a SAS token.
The Microsoft.OpenTelemetry distro includes ASP.NET Core and HttpClient instrumentation. For applications that handle sensitive query strings, explicitly enable query redaction before initializing the distro:
- Set
OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_DISABLE_URL_QUERY_REDACTION to false for ASP.NET Core instrumentation.
- Set
OTEL_DOTNET_EXPERIMENTAL_HTTPCLIENT_DISABLE_URL_QUERY_REDACTION to false for HttpClient instrumentation.
Setting either variable to true disables that instrumentation's query-string redaction.
The Microsoft OpenTelemetry Distro for .NET includes HttpClient instrumentation. Set OTEL_DOTNET_EXPERIMENTAL_HTTPCLIENT_DISABLE_URL_QUERY_REDACTION to false before initialization to enable query-string redaction. For ASP.NET Core hosting, also set OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_DISABLE_URL_QUERY_REDACTION to false.
If you use the standalone Azure.Monitor.OpenTelemetry.Exporter package instead, add and configure the relevant instrumentation library separately.
Add the following to the applicationinsights.json configuration file:
Redact URL query strings
{
"preview": {
"processors": [
{
"type": "attribute",
"actions": [
{
"key": "url.query",
"pattern": "^.*$",
"replace": "REDACTED",
"action": "mask"
}
]
},
{
"type": "attribute",
"actions": [
{
"key": "url.full",
"pattern": "[?].*$",
"replace": "?REDACTED",
"action": "mask"
}
]
}
]
}
}
The OpenTelemetry community is actively working to support redaction.
When you use the Microsoft OpenTelemetry Distro, you can redact query strings by adding a span processor to the distro configuration.
Redact URL query strings
export class RedactQueryStringsSample {
static async run() {
// Import the Microsoft OpenTelemetry Distro.
const { useMicrosoftOpenTelemetry } = await import("@microsoft/opentelemetry");
const { SEMATTRS_HTTP_ROUTE, SEMATTRS_HTTP_TARGET, SEMATTRS_HTTP_URL } =
await import("@opentelemetry/semantic-conventions");
class RedactQueryStringProcessor {
forceFlush() {
return Promise.resolve();
}
onStart() {}
shutdown() {
return Promise.resolve();
}
onEnd(span: any) {
const route = String(span.attributes[SEMATTRS_HTTP_ROUTE] ?? "");
const url = String(span.attributes[SEMATTRS_HTTP_URL] ?? "");
const target = String(span.attributes[SEMATTRS_HTTP_TARGET] ?? "");
const strip = (s: string) => {
const i = s.indexOf("?");
return i === -1 ? s : s.substring(0, i);
};
if (route)
span.attributes[SEMATTRS_HTTP_ROUTE] = strip(route);
if (url)
span.attributes[SEMATTRS_HTTP_URL] = strip(url);
if (target)
span.attributes[SEMATTRS_HTTP_TARGET] = strip(target);
}
}
// Configure Azure Monitor export and the options used by this sample.
const options = {
azureMonitor: {
azureMonitorExporterOptions: {
connectionString:
process.env.APPLICATIONINSIGHTS_CONNECTION_STRING ||
"<ConnectionString>",
},
},
spanProcessors: [new RedactQueryStringProcessor()],
};
// Initialize the Microsoft OpenTelemetry Distro.
const monitor = useMicrosoftOpenTelemetry(options);
console.log("Azure Monitor initialized (query strings redacted)");
}
}
The OpenTelemetry community is actively working on supporting redaction.
Metric export interval
You can configure the metric export interval by using the OTEL_METRIC_EXPORT_INTERVAL environment variable.
export OTEL_METRIC_EXPORT_INTERVAL="60000"
The default value is 60000 milliseconds (60 seconds). This setting controls how often the OpenTelemetry SDK exports metrics.
Tip
Azure Monitor Metrics and Azure Monitor Workspace ingest custom metrics at a fixed 60-second interval. Metrics sent more frequently are buffered and processed once every 60 seconds. Log Analytics records metrics at the interval they’re sent, which can increase cost at shorter intervals and delay visibility at longer ones.
For reference, see the following OpenTelemetry specifications:
Troubleshooting, feedback, and support
Tip
The following sections are available across all OpenTelemetry Distro articles.
Troubleshooting
OpenTelemetry Feedback
To provide feedback:
Support
Select a tab for the language of your choice to discover support options.
Note
The Quarkus community supports and maintains Quarkus extensions. For help, use Quarkus community support channels. Microsoft doesn't provide technical support for this integration.
Next steps