Azure Monitor
Overview
Azure Monitor sends logs, metrics and traces to Azure Application Insights as envelope telemetry. Log records land in the traces table, spans in requests and dependencies, and metrics in customMetrics.
Supported platforms
- Linux:
Logs,Metrics,Traces - Windows:
Logs,Metrics,Traces - macOS:
Logs,Metrics,Traces
Authentication
Attach a Connection String credential holding the Application Insights connection string:
InstrumentationKey=<guid>;IngestionEndpoint=https://<region>.in.applicationinsights.azure.com/
Copy it from the Application Insights resource Overview page in the Azure portal. The instrumentation key inside it both identifies the resource and authorizes the write, so no other credential is needed.
Note: The credential type is shared with other Azure services, so the form does not say which one it is for. A connection string for a different service is rejected when the pipeline is saved.
Basic Configuration
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| maxbatchsize | integer | 1024 | No | Telemetry items buffered before a batch is sent. |
| maxbatchinterval | string | 10s | No | Longest wait before sending a partial batch. |
Note: The two batch settings race — whichever is reached first sends the batch.
Telemetry Configuration
These route log records to a different Application Insights table. A record is only re-routed when the setting is on and it carries the matching attribute.
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| spaneventsenabled | boolean | false | No | Export non-exception span events. Exception events are always exported. |
| custom_events_enabled | boolean | false | No | Records with a microsoft.custom_event.name attribute go to customEvents. |
| exception_events_enabled | boolean | false | No | Records with exception.type or exception.message go to exceptions. |
Advanced Configuration
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| timeout | string | 10s | No | Maximum time to wait for an ingestion request. |
| shutdown_timeout | string | 1s | No | How long to wait for queued telemetry to flush on shutdown. |
| trace_http_success_policy | string | none | No | Set to otel to mark 4xx HTTP server spans as Success. Traces only. |
| trace_http_additional_success_status_codes | array | [] | No | Extra HTTP status codes treated as Success, e.g. 404, 409. Traces only. |
| cloud_role_instance | array | [] | No | Sources for the ai.cloud.roleInstance tag, in order. Empty uses the default. |
| application_version | array | [] | No | Sources for the ai.application.ver tag, in order. Empty uses the default. |
| sending_queue | object | — | No | Backpressure queue size, consumers, and optional disk backing. |
Tag Sources
cloud_role_instance and application_version take an ordered list of sources; the first that resolves to a non-empty value wins. An entry containing a dot is read as a resource attribute (host.name); an entry without one is a literal fallback (unknown-instance), so it must come last.
Defaults are service.instance.id and service.version respectively.
Example Configuration
{
"maxbatchsize": 1024, // default: 1024
"maxbatchinterval": "10s", // default: "10s"
"spaneventsenabled": false, // default: false
"custom_events_enabled": false, // default: false
"exception_events_enabled": false, // default: false
"advanced": {
"timeout": "10s", // default: "10s"
"shutdown_timeout": "1s", // default: "1s"
"cloud_role_instance": ["host.name", "service.instance.id", "unknown-instance"],
"sending_queue": {
"queue_size": 1000, // default: 1000
"num_consumers": 10, // default: 10
"enable_disk_backed_queue": true,
},
},
}
Where the data lands
| Signal | Application Insights table | Log Analytics workspace table |
|---|---|---|
| Logs | traces | AppTraces |
| Logs with custom events enabled | customEvents | AppEvents |
| Logs with exception events enabled | exceptions | AppExceptions |
| Traces | requests, dependencies | AppRequests, AppDependencies |
| Metrics | customMetrics | AppMetrics |
TraceId is mapped to the operation_id column and SpanId to operation_parentId.
Note: The table name depends on where you query from. The Application Insights resource uses the classic names; the Log Analytics workspace backing it uses the
App-prefixed names.