---
title: Google Cloud Functions
description: >-
  An event-based asynchronous compute solution allowing creation of small,
  single-purpose functions.
breadcrumbs: Docs > Integrations > Google Cloud Functions
---

# Google Cloud Functions

## Overview{% #overview %}

Google Cloud Functions is a lightweight, event-based, asynchronous compute solution that allows you to create small, single-purpose functions.

Get metrics from Google Functions to:

- Visualize the performance of your Functions.
- Correlate the performance of your Functions with your applications.

## Setup{% #setup %}

### Metric collection{% #metric-collection %}

#### Installation{% #installation %}

If you haven't already, set up the [Google Cloud Platform integration](https://docs.datadoghq.com/integrations/google-cloud-platform.md) first. There are no other installation steps.

### Log collection{% #log-collection %}

Google Cloud Function logs are collected with Google Cloud Logging and sent to a Dataflow job through a Cloud Pub/Sub topic. If you haven't already, [set up logging with the Datadog Dataflow template](https://docs.datadoghq.com/integrations/google-cloud-platform.md#log-collection).

Once this is done, export your Google Cloud Function logs from Google Cloud Logging to the Pub/Sub topic:

1. Go to the [Google Cloud Logging page](https://console.cloud.google.com/logs/viewer) and filter the Google Cloud Function logs.
1. Click **Create Sink** and name the sink accordingly.
1. Choose "Cloud Pub/Sub" as the destination and select the Pub/Sub topic that was created for that purpose. **Note**: The Pub/Sub topic can be located in a different project.
1. Click **Create** and wait for the confirmation message to show up.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **gcp.cloudfunctions.function.active\_instances**(gauge)               | The number of active function instances.*Shown as instance*                   |
| **gcp.cloudfunctions.function.execution\_count**(count)                | The number of function executions.*Shown as occurrence*                       |
| **gcp.cloudfunctions.function.execution\_times.avg**(gauge)            | Average of functions execution times.*Shown as nanosecond*                    |
| **gcp.cloudfunctions.function.execution\_times.p95**(gauge)            | 95th percentile of functions execution times.*Shown as nanosecond*            |
| **gcp.cloudfunctions.function.execution\_times.p99**(gauge)            | 99th percentile of functions execution times.*Shown as nanosecond*            |
| **gcp.cloudfunctions.function.execution\_times.samplecount**(count)    | Sample count for functions execution times.*Shown as occurrence*              |
| **gcp.cloudfunctions.function.execution\_times.sumsqdev**(gauge)       | Sum of squared deviation for functions execution times.*Shown as nanosecond*  |
| **gcp.cloudfunctions.function.instance\_count**(gauge)                 | The number of function instances broken down by state.*Shown as instance*     |
| **gcp.cloudfunctions.function.network\_egress**(gauge)                 | The outgoing network traffic of a function.*Shown as byte*                    |
| **gcp.cloudfunctions.function.user\_memory\_bytes.avg**(gauge)         | The average function memory usage during execution.*Shown as byte*            |
| **gcp.cloudfunctions.function.user\_memory\_bytes.p95**(gauge)         | The 95th percentile of function memory usage during execution.*Shown as byte* |
| **gcp.cloudfunctions.function.user\_memory\_bytes.p99**(gauge)         | The 99th percentile of function memory usage during execution.*Shown as byte* |
| **gcp.cloudfunctions.function.user\_memory\_bytes.samplecount**(count) | The sample count for a function's memory usage.*Shown as occurrence*          |
| **gcp.cloudfunctions.function.user\_memory\_bytes.sumsqdev**(gauge)    | The sum of squared deviation for function's memory usage.*Shown as byte*      |
| **gcp.cloudfunctions.pending\_queue.pending\_requests**(gauge)         | Number of pending requests.                                                   |

### Events{% #events %}

The Google Cloud Functions integration does not include any events.

### Service Checks{% #service-checks %}

The Google Cloud Functions integration does not include any service checks.

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
