-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCS-9496 - adding gcr guides #26347
Conversation
Preview links (active after the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Also if possible can we add in a section for a yaml deploy using this code example |
993a152
to
d9ad6e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates!
added DOCS-9819 to review |
|
||
To get full instrumentation, ensure you are calling `datadog-init` as the first command that runs inside your Docker container. You can do this through by setting it as the entrypoint, or by setting it as the first argument in CMD. | ||
In your main application, add the `dd-trace-py` library. See [Tracing Python applications][1] for instructions. You can also use [Tutorial - Enabling tracing for a Python application and Datadog Agent in containers][5]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize the two doc titles as they're capitalized on the linked page?
|
||
{{% svl-init-java %}} | ||
In your main application, add the `dd-trace-java` library. Follow the instructions in [Tracing Java applications][1] or use the following example Dockerfile to add and start the tracing library with automatic instrumentation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't keep flagging these, but use title case for Tracing Java Applications, since it's a doc?
Co-authored-by: Jen Gilbert <[email protected]>
- `DD_TRACE_ENABLED`: Set to `true` to enable tracing. | ||
- `DD_TRACE_PROPAGATION_STYLE`: Set this to `datadog` to use context propagation and log trace correlation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of these are set by default. I would remove them from the doc to simplify the setup.
The following command deploys the service and allows any external connection to reach it. Set `DD_API_KEY` as an environment variable, and set your service listening to port 8080. | ||
|
||
``` | ||
shell | ||
gcloud run deploy <APP_NAME> --image=gcr.io/<YOUR_PROJECT>/<APP_NAME> \ | ||
--port=8080 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Customers may not be using this port. I believe it is dependent on their app and it would be better to clarify this as an example. @nina9753 can you confirm if this is correct and help clarify this a bit more since you have more context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a link to Google Public doc here with all possible env vars. Can we also add a note that the exposed port inside of their docker file should match the port specified in the command. When deploying through the UI the port defaults to 8080 for the main container.
| `DD_SITE` | [Datadog site][5] - **Required** | | ||
| `DD_LOGS_ENABLED` | When true, send logs (stdout and stderr) to Datadog. Defaults to false. | | ||
| `DD_LOGS_INJECTION`| When true, enrich all logs with trace data for supported loggers in [Java][19], [Node][20], [.NET][21], and [PHP][22]. See additional docs for [Python][23], [Go][24], and [Ruby][25]. | | ||
| `DD_TRACE_SAMPLE_RATE`| Controls the trace ingestion sample rate `0.0` and `1.0`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove this env var as it is an optional setting. It should be 1 by default and this will probably lead to support cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry just a couple more comments
The following command deploys the service and allows any external connection to reach it. Set `DD_API_KEY` as an environment variable, and set your service listening to port 8080. | ||
|
||
``` | ||
shell | ||
gcloud run deploy <APP_NAME> --image=gcr.io/<YOUR_PROJECT>/<APP_NAME> \ | ||
--port=8080 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a link to Google Public doc here with all possible env vars. Can we also add a note that the exposed port inside of their docker file should match the port specified in the command. When deploying through the UI the port defaults to 8080 for the main container.
|
||
Images are tagged based on semantic versioning, with each new version receiving three relevant tags: | ||
#### Logs | ||
The Datadog sidecar collects logs through a shared volume. To forward logs from your main container to the sidecar, configure your application to write all logs to a location such as `shared-volume/logs/*.log`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update this to point to Shared-volume creation in the section below but also say that its only necessary if they want logs? I notice we tell them here configure your application to write all logs to a location such as `shared-volume/logs/*.log
but we do not tell them or point them to how to configure this setup. Can we add the section about setting the environment var DD_SERVERLESS_LOG_PATH=shared-volume/logs/*.log
on both containers and to setup the in-memory volume mount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we potentially update this to say :
The Datadog sidecar collects logs through a shared volume. To forward logs from your main container to the sidecar, configure your application to write all logs to a location such as shared-volume/logs/*.log using the steps below. You must follow the setups in the GCP UI to add the env var DD_SERVERLESS_LOG_PATH and a shared Volume Mount to both the main and sidecar container. If you decide to deploy using YAML or Terraform the environment variables, health check, and volume mount are already added.
{{% tab "YAML deploy" %}} | ||
To deploy your Cloud Run service with a YAML service specification: | ||
|
||
1. Create a YAML file that contains the following: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we explain the shared-volume mount, Container start-up, order, and health check automatically? Can we do the same for Terraform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly should this say?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could say something like this under To deploy your Cloud Run service with a YAML service specification:
If you decide to deploy using YAML or Terraform, the environment variables, startup health check, and volume mount are already added. If you don't want to enable logs, you can remove the shared volume from the example below. Make sure the container port for the main container is the same as the one exposed in your Dockerfile/service.
An additional note for Terraform should also say
We also added an IAM policy google_cloud_run_service_iam_member to the terraform example. If you do not want to allow public access, please remove that section at the bottom of the example
/merge |
Devflow running:
|
* adding gcr guides * addressing feedback * updates * Apply suggestions from code review Co-authored-by: Jen Gilbert <[email protected]> * applying updates * removing default line * adding note about logs setup to all language sections * add container image example * more updates * removing last envvar * final changes --------- Co-authored-by: Jen Gilbert <[email protected]>
What does this PR do? What is the motivation?
Merge instructions
Merge queue is enabled in this repo. To have it automatically merged after it receives the required reviews, create the PR (from a branch that follows the
<yourname>/description
naming convention) and then add the following PR comment:Additional notes