---
title: Choosing an Instrumentation Method for Containers
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Serverless > Google Cloud Run > Choosing an Instrumentation Method for
  Containers
---

# Choosing an Instrumentation Method for Containers

To instrument your Google Cloud Run containers with Datadog, choose one of two options:

- [](https://docs.datadoghq.com/serverless/google_cloud_run/containers/in_container)
- [](https://docs.datadoghq.com/serverless/google_cloud_run/containers/sidecar)

- [**In-Container**](https://docs.datadoghq.com/serverless/google_cloud_run/containers/in_container.md): Wraps your application container with the Datadog Agent. Choose this option for a simpler setup, lower cost overhead, and direct log piping.
- [**Sidecar**](https://docs.datadoghq.com/serverless/google_cloud_run/containers/sidecar.md): Deploys the Datadog Agent in a separate container alongside your app container. Choose this option if you have multiple containers in a single service, if you prefer strict isolation of the Datadog Agent, or if you have performance-sensitive workloads.

## Comparison: In-Container versus sidecar instrumentation{% #comparison-in-container-versus-sidecar-instrumentation %}

| Aspect            | In-Container                                             | Sidecar                                                                                                                                                      |
| ----------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Deployment        | One container (your app, wrapped with the Datadog Agent) | Two containers (your app, Datadog Agent)                                                                                                                     |
| Image changes     | Increases app image size.                                | No change to app image.                                                                                                                                      |
| Cost overhead     | Less than sidecar (no extra container).                  | Extra vCPU/memory. Overallocating the sidecar wastes cost; underallocating leads to premature scaling.                                                       |
| Logging           | Direct stdout/stderr access.                             | Shared volume + log library routing to a log file. Uncaught errors require extra handling, since they are not automatically handled by your logging library. |
| Failure isolation | In rare cases, Datadog Agent bugs can affect your app.   | Datadog Agent faults are isolated.                                                                                                                           |

## Use the Datadog MCP server{% #use-the-datadog-mcp-server %}

Use the Datadog MCP server's [`serverless_onboarding`](https://docs.datadoghq.com/bits_ai/mcp_server/tools.md#serverless_onboarding) tool to set up monitoring for your Cloud Run containers with AI assistance. After you connect, try a prompt like:

```shell
Help me monitor my GCP Cloud Run services with Datadog using Terraform.
```

## Further reading{% #further-reading %}

- [Google Cloud Run Integration](https://docs.datadoghq.com/integrations/google-cloud-run.md)
- [Collect traces, logs, and custom metrics from Cloud Run services](https://www.datadoghq.com/blog/collect-traces-logs-from-cloud-run-with-datadog/)
- [Instrument your container with the in-container approach](https://docs.datadoghq.com/serverless/google_cloud_run/containers/in_container.md)
- [Instrument your container with the sidecar approach](https://docs.datadoghq.com/serverless/google_cloud_run/containers/sidecar.md)
- [Instrument Google Cloud Run applications with the new Datadog Agent sidecar](https://www.datadoghq.com/blog/instrument-cloud-run-with-datadog-sidecar/)
- [Datadog MCP Server: serverless_onboarding tool](https://docs.datadoghq.com/bits_ai/mcp_server/tools.md#serverless_onboarding)
