• Home
  • Deploy Dynatrace
  • Set up Dynatrace on cloud platforms
  • Microsoft Azure
  • Integrations
  • Monitor Azure Functions
  • Monitor Azure Functions on Consumption Plans
  • Set up OpenTelemetry monitoring for Azure Functions on Consumption Plan

Set up OpenTelemetry monitoring for Azure Functions on Consumption Plan

Dynatrace uses OpenTelemetry to monitor Azure Functions invocations. For that purpose, Dynatrace provides language-specific packages, such as Dynatrace.OpenTelemetry.Instrumentation.AzureFunctions.Core for .NET, that can be used in combination with default OpenTelemetry SDKs and APIs.

Prerequisites

  • Dynatrace version 1.240+
  • OneAgent version 1.193+ for all OneAgents participating in a trace
  • In the Dynatrace menu, go to Settings > Preferences > OneAgent features and activate the Forward Tag 4 trace context extension OneAgent feature.

Installation

Select a configuration method

Specify a Dynatrace API endpoint

Apply the configuration to your function app

Instrument the function code

Select a configuration method

  1. In the Dynatrace menu, go to Deploy Dynatrace and select Start installation.
  2. On the Install OneAgent page, select Azure Functions.
  3. On Enable Monitoring for Azure Functions, under How will you configure your Azure Functions?, select your preferred configuration method from the dropdown menu.

Specify a Dynatrace API endpoint optional

If you don't want to use the default public Dynatrace endpoint, specify a custom Dynatrace API endpoint where you want to receive monitoring data.

Note: To reduce network latency, you typically deploy a Dynatrace ActiveGate close to (in the same region as) the Azure Function that you want to monitor.

Apply the configuration to your function app

To apply the configuration, select one of the options below, depending on your configuration method.

Copy the JSON snippet into a file named dtconfig.json located in the root folder of your Azure Functions deployment.

On Enable Monitoring for Azure Functions, under Use the following values to configure your monitored Azure Functions, there's a snippet with all required environment variables. Be sure to add these environment variables and their values to your function app configuration:

  1. In Azure Portal, go to your function app.
  2. In Settings, select Configuration.
  3. Edit any existing environment variables so that the names and values match those in the Dynatrace web UI, or, if your function app doesn't have any existing variables, select New application setting and add the names and values for all the variables in the Dynatrace web UI.

Note: Leave the settings not listed by Dynatrace unchanged.

Instrument the function code

Adding the required API calls to monitor function invocations via OpenTelemetry is specific to languages and their respective OpenTelemetry distribution:

  • .NET (C#): Trace Azure Functions written in .NET
  • Node.js (Javascript): Trace Azure Functions written in Node.js
  • Python: Trace Azure Functions written in Python

Known limitations

The Dynatrace Azure Functions integration doesn't capture the IP addresses of outgoing HTTP requests. If the called service isn't monitored with Dynatrace OneAgent, this results in unmonitored hosts.

Related topics
  • Monitor Azure Functions on App Service Plan for Windows

    Learn how to install, configure, update, and uninstall OneAgent for monitoring Azure Functions using an Azure site extension.

  • Set up Dynatrace on Microsoft Azure

    Set up and configure monitoring for Microsoft Azure.

  • OneAgent platform and capability support matrix

    Learn which capabilities are supported by OneAgent on different operating systems and platforms.