• Home
  • Deploy Dynatrace
  • Set up Dynatrace on cloud platforms
  • Google Cloud Platform
  • Integrations
  • Monitor Google Cloud Functions
  • Set up OpenTelemetry monitoring for Google Cloud Functions

Set up OpenTelemetry monitoring for Google Cloud Functions

Dynatrace uses OpenTelemetry to monitor Google Cloud Functions invocations. For that purpose, Dynatrace provides language-specific packages, such as @dynatrace/opentelemetry-gcf for Node.js and dynatrace-opentelemetry-gcf for Python, 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 Google Cloud function

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 Google Cloud Functions.
  3. On Enable Monitoring for Google Cloud Functions, under How will you configure your Google Cloud Functions?, select your preferred method from the dropdown menu. Make sure you set all properties for the selected method before copying the generated configuration snippets.

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 Google Cloud function that you want to monitor.

Apply the configuration to your Google Cloud function

Configure with JSON file

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

Configure with environment variables

On Enable Monitoring for Google Cloud Functions, under Use the following values to configure your monitored Google Cloud Functions, there's a snippet with all required environment variables. Be sure to add these environment variables and their values to your Google Cloud function configuration. For details, see Using environment variables.

Instrument the function code

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

  • Node.js: Integrate on Google Cloud Functions Node.js
  • Python: Integrate on Google Cloud Functions Python
  • Go: Integrate on Google Cloud Functions GoLang

Known limitations

The Dynatrace Google Cloud 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
  • Set up Dynatrace on Google Cloud Platform

    Monitor Google Cloud Platform with Dynatrace.

  • OneAgent platform and capability support matrix

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

  • Google Cloud monitoring