|
| 1 | +After the container is built and pushed to your registry, set the required environment variables for the Datadog Agent: |
| 2 | + |
| 3 | +- `DD_API_KEY`: Datadog API key, used to send data to your Datadog account. It should be configured as a Google Cloud Secret for privacy and safety. |
| 4 | +- `DD_SITE`: Datadog endpoint and website. Select your site on the right side of this page. Your site is: {{< region-param key="dd_site" code="true" >}}. |
| 5 | + |
| 6 | +For more environment variables and their function, see [Environment Variables](#environment-variables). |
| 7 | + |
| 8 | +The following command deploys the service and allows any external connection to reach it. In this example, your service listening is set to port 8080. Ensure that this port number matches the exposed port inside of your Dockerfile. |
| 9 | + |
| 10 | +```shell |
| 11 | +gcloud run deploy <APP_NAME> |
| 12 | + --image=gcr.io/<YOUR_PROJECT>/<APP_NAME> \ |
| 13 | + --port=8080 \ |
| 14 | + --update-env-vars=DD_API_KEY=$DD_API_KEY \ |
| 15 | + --update-env-vars=DD_SITE=$DD_SITE \ |
| 16 | +``` |
| 17 | + |
| 18 | +### Environment variables |
| 19 | + |
| 20 | +| Variable | Description | |
| 21 | +| -------- | ----------- | |
| 22 | +| `DD_API_KEY` | [Datadog API key][1] - **Required**| |
| 23 | +| `DD_SITE` | [Datadog site][2] - **Required** | |
| 24 | +| `DD_LOGS_ENABLED` | When true, send logs (stdout and stderr) to Datadog. Defaults to false. | |
| 25 | +| `DD_SERVICE` | See [Unified Service Tagging][3]. | |
| 26 | +| `DD_VERSION` | See [Unified Service Tagging][3]. | |
| 27 | +| `DD_ENV` | See [Unified Service Tagging][3]. | |
| 28 | +| `DD_SOURCE` | See [Unified Service Tagging][3]. | |
| 29 | +| `DD_TAGS` | See [Unified Service Tagging][3]. | |
| 30 | + |
| 31 | + |
| 32 | +[1]: /account_management/api-app-keys/#api-keys |
| 33 | +[2]: /getting_started/site/ |
| 34 | +[3]: /getting_started/tagging/unified_service_tagging/ |
0 commit comments