Google Cloud Run

Overview

Cloud Run is a managed compute platform that enables you to run stateless containers that are invocable using HTTP requests.

Enable this integration to see all of your Cloud Run metrics, traces, and logs in Datadog.

Setup

Metric collection

Installation

If you use the fully managed version of Cloud Run, just set up the Google Cloud Platform integration.

If you set up Cloud Run on GKE, deploy the Datadog Agent on your clusters with the Kubernetes DaemonSet setup after having enabled the Google Cloud Platform integration.

Note: When deploying the Datadog Agent DaemonSet, make sure hostNetwork: true is set within the pod specifications.

Log collection

Google Cloud Run also exposes audit logs. Google Cloud Run logs are collected with Google Cloud Logging and sent to a Cloud Pub/Sub with a HTTP Push forwarder. If you haven’t already, set up the Cloud Pub/sub with a HTTP push forwarder.

Once this is done, export your Google Cloud Run logs from Google Cloud Logging to the pub/sub:

  1. Go to the Google Cloud Logging page and filter Google Cloud Run logs.

  2. Click Create Sink and name the sink accordingly.

  3. Choose “Cloud Pub/Sub” as the destination and select the pub/sub that was created for that purpose. Note: The pub/sub can be located in a different project.

    Export Google Cloud Pub/Sub Logs to Pub Sub
  4. Click Create and wait for the confirmation message to show up.

APM and DogStatsD

Note: This feature is supported for Google Cloud Run for Anthos/GKE (not supported for Cloud Run Fully Managed).

Use the Datadog Admission Controller to configure APM tracers and DogStatsD clients automatically. Inject the environment variables DD_AGENT_HOST and DD_ENTITY_ID by using one of the following:

  • Add the label admission.datadoghq.com/enabled: "true" to your pod.
  • Configure the Cluster Agent admission controller by setting mutateUnlabelled: true.

To prevent pods from receiving environment variables, add the label admission.datadoghq.com/enabled: "false". This works even if you set mutateUnlabelled: true. For more details, see the Datadog Admission Controller documentation.

Data Collected

Metrics

gcp.run.container.billable_instance_time
(rate)
Billable time aggregated from all container instances of the revision (ms/s).
Shown as millisecond
gcp.run.container.cpu.allocation_time
(rate)
Container CPU allocation of the revision in seconds.
Shown as core
gcp.run.container.cpu.utilizations.avg
(gauge)
The average distribution of container CPU utilization distribution across all container instances of the revision.
Shown as percent
gcp.run.container.cpu.utilizations.p95
(gauge)
The 95th percentile distribution of container CPU utilization distribution across all container instances of the revision.
Shown as percent
gcp.run.container.cpu.utilizations.p99
(gauge)
The 99th percentile distribution of container CPU utilization distribution across all container instances of the revision.
Shown as percent
gcp.run.container.cpu.utilizations.samplecount
(count)
Sample count of the distribution of service request times in milliseconds.
Shown as percent
gcp.run.container.instance_count
(gauge)
The number of container instances that exist, broken down by state.
Shown as container
gcp.run.container.max_request_concurrencies.avg
(gauge)
Average of the maximum number of concurrent requests being served by each container instance over a minute.
Shown as request
gcp.run.container.max_request_concurrencies.p95
(gauge)
95th percentile distribution of the maximum number of concurrent requests being served by each container instance over a minute.
Shown as request
gcp.run.container.max_request_concurrencies.p99
(gauge)
99th percentile distribution of the maximum number of concurrent requests being served by each container instance over a minute.
Shown as request
gcp.run.container.max_request_concurrencies.samplecount
(count)
Sample count of the distribution of the maximum number of concurrent requests being served by each container instance over a minute.
Shown as request
gcp.run.container.memory.allocation_time
(rate)
Container memory allocation of the revision in Gigabytes-seconds.
Shown as gibibyte
gcp.run.container.memory.utilizations.avg
(gauge)
Average of the container memory utilization distribution across all container instances of the revision.
Shown as percent
gcp.run.container.memory.utilizations.p95
(gauge)
95th percentile distribution of the container memory utilization distribution across all container instances of the revision.
Shown as percent
gcp.run.container.memory.utilizations.p99
(gauge)
99th percentile distribution of the container memory utilization distribution across all container instances of the revision.
Shown as percent
gcp.run.container.memory.utilizations.samplecount
(count)
Sample count of the container memory utilization distribution across all container instances of the revision.
Shown as percent
gcp.run.container.network.received_bytes_count
(count)
The incoming socket and HTTP response traffic of revision, in bytes.
Shown as byte
gcp.run.container.network.sent_bytes_count
(count)
The outgoing socket and HTTP response traffic of revision, in bytes.
Shown as byte
gcp.run.request_count
(count)
The number of service requests.
Shown as request
gcp.run.request_latencies.avg
(gauge)
Average distribution of service request times in milliseconds.
Shown as millisecond
gcp.run.request_latencies.p95
(gauge)
The 95th percentile distribution of service request times in milliseconds.
Shown as millisecond
gcp.run.request_latencies.p99
(gauge)
The 99th percentile distribution of service request times in milliseconds.
Shown as millisecond
gcp.run.request_latencies.samplecount
(count)
Sample count of the distribution of service request times in milliseconds.
Shown as millisecond
gcp.run.request_latencies.sumsqdev
(gauge)
Sum of squared deviation of the distribution of service request times in milliseconds.
Shown as millisecond

Events

The Google Cloud Functions integration does not include any events.

Service Checks

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

Troubleshooting

Need help? Contact Datadog support.

Further Reading

Additional helpful documentation, links, and articles: