Skip to main content

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​

ParameterTypeDefaultRequiredDescription
maxbatchsizeinteger1024NoTelemetry items buffered before a batch is sent.
maxbatchintervalstring10sNoLongest 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.

ParameterTypeDefaultRequiredDescription
spaneventsenabledbooleanfalseNoExport non-exception span events. Exception events are always exported.
custom_events_enabledbooleanfalseNoRecords with a microsoft.custom_event.name attribute go to customEvents.
exception_events_enabledbooleanfalseNoRecords with exception.type or exception.message go to exceptions.

Advanced Configuration​

ParameterTypeDefaultRequiredDescription
timeoutstring10sNoMaximum time to wait for an ingestion request.
shutdown_timeoutstring1sNoHow long to wait for queued telemetry to flush on shutdown.
trace_http_success_policystringnoneNoSet to otel to mark 4xx HTTP server spans as Success. Traces only.
trace_http_additional_success_status_codesarray[]NoExtra HTTP status codes treated as Success, e.g. 404, 409. Traces only.
cloud_role_instancearray[]NoSources for the ai.cloud.roleInstance tag, in order. Empty uses the default.
application_versionarray[]NoSources for the ai.application.ver tag, in order. Empty uses the default.
sending_queueobject—NoBackpressure 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​

SignalApplication Insights tableLog Analytics workspace table
LogstracesAppTraces
Logs with custom events enabledcustomEventsAppEvents
Logs with exception events enabledexceptionsAppExceptions
Tracesrequests, dependenciesAppRequests, AppDependencies
MetricscustomMetricsAppMetrics

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.