Azure Functions monitoring from trigger to dependency
by Obseria · Cloud platforms- OpenTelemetry
- Application Observability
- Cloud platforms
- Category
- Cloud platforms
- Key metrics
- 9
- Ready-made
- 5 dashboards & alerts
- Setup
- 3 steps
- Standard
- OTLP
Switch the Functions host to OpenTelemetry, add the worker package and Obseria traces every invocation, with execution counts and errors from Azure Monitor alongside.
OpenTelemetry built into the host
With telemetryMode set to OpenTelemetry in host.json, the Functions host exports its own traces and logs via OTLP, not only your code.
Platform metrics included
The Collector's azuremonitor receiver pulls execution counts, execution units, HTTP errors and response times for your function apps.
From failed execution to cause
Obseria Intelligence links failing executions with the deploy, the slow dependency or the exception that caused them and shows the evidence.
Obseria interface



Ready the moment data arrives
- Function app overview: executions, errors, duration
- Slowest functions and their dependencies
- Alert on rising Http5xx per function app
- Alert on failed executions for queue triggers
- Execution units per app over time
What Obseria monitors in Azure Functions
Function invocations
A span per execution with trigger type, function name, duration and outcome, including the host's own spans.
Triggers and bindings
HTTP, Service Bus, Event Hubs, Storage Queue and Timer triggers, with trace context carried through messages where supported.
Outbound dependencies
HTTP calls, database queries and Azure SDK calls as child spans, instrumented by the language worker's OpenTelemetry setup.
Function app metrics
Execution count, execution units, requests, HTTP 4xx and 5xx and response time from Azure Monitor.
Logs
Host and worker logs exported over OTLP with trace and span IDs attached.
Hosting plans
Function apps on Consumption, Flex Consumption, Premium and Dedicated plans, as far as the platform publishes the metric.
The Azure Functions signals that matter
Obseria collects these values automatically and shows them in ready-made dashboards and alerts.
| Metric | Unit | What it tells you |
|---|---|---|
FunctionExecutionCount | Count | Number of function executions per app, the baseline for error rates. |
FunctionExecutionUnits | MB-ms | Memory multiplied by execution time, the consumption measure for Consumption plan billing. |
Requests | Count | HTTP requests handled by the function app. |
Http5xx | Count | Server errors returned by HTTP-triggered functions. |
Http4xx | Count | Client errors, useful to catch broken callers or authentication problems. |
HttpResponseTime | Seconds | Time the app takes to respond to HTTP requests. |
MemoryWorkingSet | Bytes | Memory used by the function app, to spot leaks across warm executions. |
faas.invoke_duration | s | OpenTelemetry semantic convention histogram for invocation duration, where the runtime or your instrumentation records it. |
faas.coldstarts | {coldstart} | OpenTelemetry semantic convention counter for cold starts, where recorded by the instrumentation. |
Set up Azure Functions monitoring in minutes
- 1
Enable OpenTelemetry in the host
Set telemetryMode to OpenTelemetry in host.json and add OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADERS as app settings.
- 2
Instrument the worker
For .NET isolated, add Microsoft.Azure.Functions.Worker.OpenTelemetry and call UseFunctionsWorkerDefaults and UseOtlpExporter; other languages follow Microsoft's guide.
- 3
Add platform metrics
Run the OpenTelemetry Collector with the azuremonitor receiver, a service principal with Monitoring Reader and services set to Microsoft.Web/sites.
# host.json: let the Functions host emit OpenTelemetry instead of
# Application Insights telemetry
# { "version": "2.0", "telemetryMode": "OpenTelemetry" }
# App settings: OTLP export to Obseria for host and worker
az functionapp config appsettings set \
--name orders-func --resource-group rg-prod \
--settings \
OTEL_SERVICE_NAME=orders-func \
OTEL_EXPORTER_OTLP_ENDPOINT=${OBSERIA_OTLP_ENDPOINT} \
"OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer%20${OBSERIA_TOKEN}"
# .NET isolated worker: add the packages ...
dotnet add package Microsoft.Azure.Functions.Worker.OpenTelemetry
dotnet add package OpenTelemetry.Extensions.Hosting
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
# ... and register them in Program.cs:
# builder.Services.AddOpenTelemetry()
# .UseFunctionsWorkerDefaults()
# .UseOtlpExporter();Why Azure Functions monitoring needs traces and platform metrics
Azure Functions lets teams run event-driven code without managing servers, but the operational questions remain. Why did a Service Bus message take minutes to process? Which dependency made an HTTP function slow after the last release? Did executions fail because of the code, a downstream service or a scaling limit? Azure Functions monitoring answers these questions only when you combine two views: traces from inside each execution, and platform metrics for the function app as a whole.
Microsoft has added native OpenTelemetry support to Azure Functions. When you set telemetryMode to OpenTelemetry in host.json, the Functions host emits its traces and logs in OpenTelemetry format and exports them to any OTLP endpoint configured through the standard OTEL_EXPORTER_OTLP_* app settings. Your language worker adds spans for your own code and its dependencies. That makes vendor-neutral Azure Functions tracing possible without the Application Insights SDK.
How the setup fits together
- Functions host:
telemetryModeinhost.jsonswitches the host to OpenTelemetry. It then sends spans for triggers and executions to the configured OTLP endpoint. - Language worker: for the .NET isolated worker, the package
Microsoft.Azure.Functions.Worker.OpenTelemetrywithUseFunctionsWorkerDefaults()connects worker spans with the host's trace context, andUseOtlpExporter()sends them over OTLP. Java, JavaScript, Python and PowerShell have their own steps in Microsoft's documentation. - Platform metrics: the OpenTelemetry Collector's
azuremonitorreceiver reads Azure Monitor metrics forMicrosoft.Web/siteswith a service principal that has the Monitoring Reader role. Limitingservicesto function apps keeps the number of API calls small.
Signals that matter for Azure serverless monitoring
- Executions and failures:
FunctionExecutionCounttogether with failed execution spans gives an error rate per function, also for non-HTTP triggers. - HTTP health:
Requests,Http5xx,Http4xxandHttpResponseTimedescribe the user-facing side of HTTP-triggered functions. - Consumption:
FunctionExecutionUnitscombines memory and execution time, which is how the Consumption plan is billed. A jump after a release usually means slower or more memory-hungry code. - Memory:
MemoryWorkingSetshows whether warm instances keep growing between executions. - Cold starts: the OpenTelemetry semantic conventions define
faas.coldstartas a span attribute andfaas.coldstartsas a metric. Whether they are populated depends on the runtime and instrumentation, so check the spans you receive before alerting on them.
Common Azure Functions problems and how to detect them
Slow dependencies
Most slow functions wait on something: a database, a storage account or another API. Child spans for each dependency show exactly where the time goes and whether the slowdown started with a deploy.
Growing queue backlogs
If a queue- or Service Bus-triggered function fails or slows down, messages pile up and are retried. Failed execution spans with the exception and the message's trace context reveal the cause, while the backlog itself is visible in the Service Bus or Storage metrics through the Azure integration.
Timeouts
Each hosting plan has a maximum execution time. Executions that approach it show up as long spans, often with one dependency call dominating. Alerting on duration close to the configured timeout catches them before they fail.
Cold starts on the Consumption plan
Functions that scale from zero start new instances, which adds latency to the first requests. Comparing response time after idle periods with steady-state traffic shows whether a Premium plan or always-ready instances are worth it.
Best practices for Function App monitoring
- Set
OTEL_SERVICE_NAMEper function app so each app appears as its own service. - Store the Obseria token in Azure Key Vault and reference it from the app setting instead of entering it in plain text.
- Propagate trace context through messages so producer and consumer appear in one trace.
- Restrict the
azuremonitorreceiver to the resource types you need. - Track
service.versionso regressions can be traced to a specific deployment.
How Obseria helps with Azure Functions monitoring
Obseria receives traces and logs from the Functions host and worker over OTLP and platform metrics through the OpenTelemetry Collector. TopoGraph places function apps next to the services, queues and databases they call. When errors or latency rise, Obseria Intelligence checks deploys, failing dependencies and exceptions and presents the root cause with its chain of evidence. Dashboards, alerts and SLOs are included, EU hosting is available, and all data stays exportable via OTLP.
Learn more
What is APM (application performance monitoring)?
What is APM? Learn how application performance monitoring measures latency, throughput and errors, how distributed tracing works, and which metrics matter.
What is OpenTelemetry?
What is OpenTelemetry? Learn how OTel's APIs, SDKs, Collector, OTLP and semantic conventions produce vendor-neutral traces, metrics, logs and profiles.
Azure Functions monitoring FAQ
No. With telemetryMode set to OpenTelemetry, the Functions host and the worker export over OTLP to the endpoint you configure. You can keep Application Insights in parallel if other teams rely on it.
Microsoft documents OpenTelemetry for the .NET isolated worker, Java, JavaScript and TypeScript, Python and PowerShell. The setup differs per language, so follow the current Azure Functions OpenTelemetry guide for your runtime.
Run the OpenTelemetry Collector with the azuremonitor receiver and a service principal with Monitoring Reader. It reads Azure Monitor metrics such as FunctionExecutionCount and Http5xx for all function apps in the subscription.
Yes, as long as the trace context travels with the message. Service Bus and Event Hubs carry W3C trace context through the Azure SDKs, so the producer and the triggered function appear in one trace.
OpenTelemetry export works on Consumption, Flex Consumption, Premium and Dedicated plans. The set of Azure Monitor metrics differs slightly per plan, so check which ones your plan publishes.
Start monitoring Azure Functions today
Connect Azure Functions in minutes with OpenTelemetry or the Obseria Agent. Free for 14 days.