-
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
add opentelemetry env specific setup #9529
add opentelemetry env specific setup #9529
Conversation
@@ -51,7 +51,7 @@ On each OpenTelemetry-instrumented application, set the resource attributes `dev | |||
|
|||
### Ingesting OpenTelemetry Traces with the Collector | |||
|
|||
The OpenTelemetry Collector is configured by adding a [pipeline][8] to your `otel-collector-configuration.yml` file. Supply the relative path to this configuration file when you start the collector by passing it in via the `--config=<path/to/configuration_file>` command line argument. For examples of supplying a configuration file, see the [OpenTelemetry Collector documentation][9]. | |||
The OpenTelemetry Collector is configured by adding a [pipeline][8] to your `otel-collector-configuration.yml` file. Supply the relative path to this configuration file when you start the collector by passing it in via the `--config=<path/to/configuration_file>` command line argument. For examples of supplying a configuration file, see the [environment specific setup](#environent-specific-setup) section below or the [OpenTelemetry Collector documentation][9]. |
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.
The OpenTelemetry Collector is configured by adding a [pipeline][8] to your `otel-collector-configuration.yml` file. Supply the relative path to this configuration file when you start the collector by passing it in via the `--config=<path/to/configuration_file>` command line argument. For examples of supplying a configuration file, see the [environment specific setup](#environent-specific-setup) section below or the [OpenTelemetry Collector documentation][9]. | |
The OpenTelemetry Collector is configured by adding a [pipeline][8] to your `otel-collector-configuration.yml` file. Supply the relative path to this configuration file when you start the collector by passing it in via the `--config=<path/to/configuration_file>` command line argument. For examples of supplying a configuration file, see the [environment specific setup](#environment-specific-setup) section below or the [OpenTelemetry Collector documentation][9]. |
Unrelated to changes in this PR, but would it be worth adding one more item to the partials for Otel Collector (Language Agnostic) or something similar? The first paragraph is great but if I don't read it I end up clicking a language and not realizing there is a collector option. |
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.
An initial docs review for you. Feel free to chat with me in Slack if you want to discuss any of these or want pointers on fixing them.
@@ -93,6 +93,371 @@ service: | |||
exporters: [datadog/api] | |||
``` | |||
|
|||
### Environment Specific Setup |
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.
### Environment Specific Setup | |
### Environment specific setup |
All the headings (except the H1/page title) should be sentence-case. We probably aren't consistent on this, but any new headings and changed pages should be sentence-case.
@@ -93,6 +93,371 @@ service: | |||
exporters: [datadog/api] | |||
``` | |||
|
|||
### Environment Specific Setup | |||
|
|||
#### Host: |
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.
#### Host: | |
#### Host |
|
||
- Download the appropriate binary from [the project repository latest release](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/latest). | ||
|
||
- Create a `otel_collector_config.yaml` file. Here is an example template to get started. It enables the collector's otlp receiver and datadog exporter. |
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.
"Here is an example" Should we have a link to a sample? Which sample do you have in mind?
- Create a `otel_collector_config.yaml` file. Here is an example template to get started. It enables the collector's otlp receiver and datadog exporter. | |
- Create a `otel_collector_config.yaml` file. Here is an example template to get started. It enables the collector's `otlp` receiver and the Datadog exporter. |
or OTLP? are you using "otlp" as a code keyword or as an adjective?
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.
it should be, i believe OTLP
which stands for OpenTelemetry Protocol
will update
- Run on the host with the configration yaml file set via the `--config` parameter. For example, | ||
|
||
``` | ||
curl -L https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/latest/download/otelcontribcol_linux_amd64 | otelcontribcol_linux_amd64 --config otel_collector_config.yaml |
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.
If they downloaded the binary, they wouldn't use curl
right?
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.
yup good catch. this was combining downloading the release and running it...will remove the curl
bit to make it more clear.
|
||
- Create a `otel_collector_config.yaml` file. [Here is an example template](https://docs.datadoghq.com/tracing/setup_overview/open_standards/#ingesting-opentelemetry-traces-with-the-collector) to get started. It enables the collector's otlp receiver and datadog exporter. | ||
|
||
- Use a published docker image such as [`otel/opentelemetry-collector-contrib:latest`](https://hub.docker.com/r/otel/opentelemetry-collector-contrib/tags) |
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.
- Use a published docker image such as [`otel/opentelemetry-collector-contrib:latest`](https://hub.docker.com/r/otel/opentelemetry-collector-contrib/tags) | |
2. Choose a published docker image such as [`otel/opentelemetry-collector-contrib:latest`](https://hub.docker.com/r/otel/opentelemetry-collector-contrib/tags). |
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.
Also, move link to bottom of the file.
|
||
In order to accurately track the appropriate metadata in Datadog for information and billing purposes, it is recommended the OpenTelemetry Collector be run at least in agent mode on each of the Kubernetes Nodes. | ||
|
||
- When deploying the OpenTelemetry Collector as a Daemonset, refer to [the example configuration below](#opentelemetry-kubernetes-example-collector-configuration) as a guide. |
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.
- When deploying the OpenTelemetry Collector as a Daemonset, refer to [the example configuration below](#opentelemetry-kubernetes-example-collector-configuration) as a guide. | |
When deploying the OpenTelemetry Collector as a daemonset, refer to [the example configuration below](#opentelemetry-kubernetes-example-collector-configuration) as a guide. |
|
||
- When deploying the OpenTelemetry Collector as a Daemonset, refer to [the example configuration below](#opentelemetry-kubernetes-example-collector-configuration) as a guide. | ||
|
||
- On the application container, use the downward API to pull the host IP; the application container needs an environment variable that points to status.hostIP. The OpenTelemetry Collector container Agent expects this to be named `OTEL_EXPORTER_OTLP_SPAN_ENDPOINT`. Use the [below example snippet](#opentelemetry-kubernetes-example-application-configuration) as a guide. |
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.
- On the application container, use the downward API to pull the host IP; the application container needs an environment variable that points to status.hostIP. The OpenTelemetry Collector container Agent expects this to be named `OTEL_EXPORTER_OTLP_SPAN_ENDPOINT`. Use the [below example snippet](#opentelemetry-kubernetes-example-application-configuration) as a guide. | |
On the application container, use the downward API to pull the host IP. The application container needs an environment variable that points to `status.hostIP`. The OpenTelemetry Collector container Agent expects this to be named `OTEL_EXPORTER_OTLP_SPAN_ENDPOINT`. Use the [below example snippet](#opentelemetry-kubernetes-example-application-configuration) as a guide. |
|
||
- On the application container, use the downward API to pull the host IP; the application container needs an environment variable that points to status.hostIP. The OpenTelemetry Collector container Agent expects this to be named `OTEL_EXPORTER_OTLP_SPAN_ENDPOINT`. Use the [below example snippet](#opentelemetry-kubernetes-example-application-configuration) as a guide. | ||
|
||
##### OpenTelemetry Kubernetes Example Collector Configuration |
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.
##### OpenTelemetry Kubernetes Example Collector Configuration | |
##### Example Kubernetes collector configuration |
name: otel-collector-config-vol | ||
``` | ||
|
||
##### Opentelemetry Kubernetes Example Application Configuration |
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.
##### Opentelemetry Kubernetes Example Application Configuration | |
##### Example Kubernetes application configuration |
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.
We should keep these docs for Datadog specific configuration only, and link to the OpenTelemetry docs as much as possible. If not, we are going to end up having very long docs that are going to have to be constantly updated.
In particular, I think we should focus on answering these questions:
- What components do we require on each environment?
- What specific configuration (different from the one on the component docs) do we require on these components?
For example, for Kubernetes we should state that we require the k8s_tagger on Kubernetes and that the default configuration should be used.
Now, if some docs are missing upstream for a given component (like it is the case here) we should add it here now and contribute those docs upstream as soon as we can so that they are kept up to date and are useful for everyone
curl -L https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/latest/download/otelcontribcol_linux_amd64 | otelcontribcol_linux_amd64 --config otel_collector_config.yaml | ||
``` | ||
|
||
#### Docker |
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.
IMO we can mostly get rid of this section and just link here instead: https://opentelemetry.io/docs/collector/getting-started/#docker, making clear that we are present in the contrib flavor.
I don't think we should explain how to use Docker or how to use the OpenTelemetry Collector in general in Datadog docs, we should keep this for Datadog exporter specific configuration
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.
These sections are quite misleading (note the kill $pid1; docker stop otelcol
at the end of the docker command, for example) and have the user cloning the repo locally. i think it's better to have working examples in our docs and then contrib upstream to improve the upstream docs, and when those are improved we can point to them directly.
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.
Makes sense, let's keep it then. Can you open an issue for this on the https://github.com/open-telemetry/opentelemetry.io repo?
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.
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.
also added for rbac: open-telemetry/opentelemetry-collector-contrib#2274
@mx-psi @kayayarai I tried to address all the feedback here. Let me know what you think. The two main points seem to be.
Lastly, I think @andrewardito makes a good point here around ordering and discoverability. It would be really nice if we could preference or elevate the collector setup section. I'm not sure how best to accomplish that, i don't think it shoud be a blocker from getting these docs out but if anyone has ideas i'd love to try them. |
@kayayarai @mx-psi i uh..forgot to push up the changes, sorry about that, updated |
|
||
#### Kubernetes | ||
|
||
The OpenTelemetry Collector can be run in two types of [deployment scenarios][13]. |
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.
The OpenTelemetry Collector can be run in two types of [deployment scenarios][13]. | |
The OpenTelemetry Collector can be run in two types of [deployment scenarios][13]: |
|
||
- As an OpenTelemetry Collector "agent" running on the same host as the application in a sidecar or daemonset; or | ||
|
||
- As a standalone service, e.g. a container or deployment, typically per-cluster, -datacenter or -region. |
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.
- As a standalone service, e.g. a container or deployment, typically per-cluster, -datacenter or -region. | |
- As a standalone service, for example a container or deployment, typically per-cluster, per-datacenter, or per-region. |
|
||
When deploying the OpenTelemetry Collector as a daemonset, refer to [the example configuration below](#opentelemetry-kubernetes-example-collector-configuration) as a guide. | ||
|
||
On the application container, use the downward API to pull the host IP. The application container needs an environment variable that points to `status.hostIP`. The OpenTelemetry Application SDKs expects this to be named `OTEL_EXPORTER_OTLP_ENDPOINT`. Use the [below example snippet](#opentelemetry-kubernetes-example-application-configuration) as a guide. |
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.
is it "the SDKs expect" or "the SDK expects"?
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.
sdks expect...updated!
|
||
##### Example Kubernetes OpenTelemetry Collector configuration | ||
|
||
A full example k8s manifest for deploying the OpenTelemetry Collector as both daemonset and standalone collector [can be found here][14]. Depending on your environment this example may be modified, however the important sections to note specific to Datadog are as follows. |
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.
A full example k8s manifest for deploying the OpenTelemetry Collector as both daemonset and standalone collector [can be found here][14]. Depending on your environment this example may be modified, however the important sections to note specific to Datadog are as follows. | |
A full example Kubernetes manifest for deploying the OpenTelemetry Collector as both daemonset and standalone collector [can be found here][14]. Modify the example to suit your environment. The key sections that are specific to Datadog are as follows: |
|
||
2. Create a `otel_collector_config.yaml` file. [Here is an example template](#ingesting-opentelemetry-traces-with-the-collector) to get started. It enables the collector's OTLP Receiver and Datadog Exporter. | ||
|
||
3. Run on the host with the configration yaml file set via the `--config` parameter. For example, |
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.
3. Run on the host with the configration yaml file set via the `--config` parameter. For example, | |
3. Run the download on the host, specifying the configration YAML file in the `--config` parameter. For example: |
# ... | ||
``` | ||
|
||
3. For any OpenTelemetry-Collector's in "standalone collector" mode, which receive traces from downstream collectors and export to Datadog's backend, include a `batch` processor configured with a `timeout` of `10s` as well as the `k8s_tagger` enabled. These should be included along with the `datadog` exporter and added to the `traces` pipeline. |
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.
3. For any OpenTelemetry-Collector's in "standalone collector" mode, which receive traces from downstream collectors and export to Datadog's backend, include a `batch` processor configured with a `timeout` of `10s` as well as the `k8s_tagger` enabled. These should be included along with the `datadog` exporter and added to the `traces` pipeline. | |
3. For OpenTelemetry Collectors in standalone collector mode, which receive traces from downstream collectors and export to Datadog's backend, include a `batch` processor configured with a `timeout` of `10s` as well as the `k8s_tagger` enabled. These should be included along with the `datadog` exporter and added to the `traces` pipeline. |
|
||
3. For any OpenTelemetry-Collector's in "standalone collector" mode, which receive traces from downstream collectors and export to Datadog's backend, include a `batch` processor configured with a `timeout` of `10s` as well as the `k8s_tagger` enabled. These should be included along with the `datadog` exporter and added to the `traces` pipeline. | ||
|
||
- In the `otel-collector-conf` ConfigMap's `data.otel-collector-config` `processors` section |
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.
- In the `otel-collector-conf` ConfigMap's `data.otel-collector-config` `processors` section | |
In the `otel-collector-conf` ConfigMap's `data.otel-collector-config` `processors` section: |
# ... | ||
``` | ||
|
||
- In the `otel-collector-conf` ConfigMap's `data.otel-collector-config` `exporters` section |
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.
- In the `otel-collector-conf` ConfigMap's `data.otel-collector-config` `exporters` section | |
In the `otel-collector-conf` ConfigMap's `data.otel-collector-config` `exporters` section: |
key: <YOUR_API_KEY> | ||
``` | ||
|
||
- In the `otel-agent-conf` ConfigMap's `data.otel-agent-config` `service.pipelines.traces` section |
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.
- In the `otel-agent-conf` ConfigMap's `data.otel-agent-config` `service.pipelines.traces` section | |
In the `otel-agent-conf` ConfigMap's `data.otel-agent-config` `service.pipelines.traces` section: |
|
||
##### Example Kubernetes OpenTelemetry application configuration | ||
|
||
In addition to the OpenTelemetry Collector configuration, ensure OpenTelemetry SDKs installed in an application transmit telemetry data to the Collector by configuring the environment variable `OTEL_EXPORTER_OTLP_ENDPOINT` with the host IP. Use the downward API to pull the host IP, and set it as an environment variable, which is then interpolated when setting the `OTEL_EXPORTER_OTLP_ENDPOINT` environment variable. |
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.
In addition to the OpenTelemetry Collector configuration, ensure OpenTelemetry SDKs installed in an application transmit telemetry data to the Collector by configuring the environment variable `OTEL_EXPORTER_OTLP_ENDPOINT` with the host IP. Use the downward API to pull the host IP, and set it as an environment variable, which is then interpolated when setting the `OTEL_EXPORTER_OTLP_ENDPOINT` environment variable. | |
In addition to the OpenTelemetry Collector configuration, ensure that OpenTelemetry SDKs that are installed in an application transmit telemetry data to the collector, by configuring the environment variable `OTEL_EXPORTER_OTLP_ENDPOINT` with the host IP. Use the downward API to pull the host IP, and set it as an environment variable, which is then interpolated when setting the `OTEL_EXPORTER_OTLP_ENDPOINT` environment variable: |
Co-authored-by: Pablo Baeyens <[email protected]>
…umentation into add_otel_collector_config merge origin
@kayayarai Hey! added the last round of feedback, i think we should be ok here. Just noting this branch is definitely from my own fork, but i also have happened to push up a branch with identical naming |
Cool cool! I'll take a look at it this afternoon, no worries about the fork v. branch situation, you can leave it as is I think. |
…aDog/documentation into ericmustin/add_otel_collector_config merge upstream
What does this PR do?
This PR adds additional environment specific configuration for the opentelemetry collector and datadog exporter, for host based, containerized, and k8s environments.
Motivation
Some background:
With that in mind, I've tried to mimic the
datadog-agent
section of our in app apm onboarding docs+scenarios, but for the opentelemetry-collector instead. This PR does not include language-sdk specific setup info like our in app apm docs do, but i'd like to add those in the near future and will be important. For now though, what's most critical is making sure folks deploy the collector correctly, as accurate hostname resolution from the collector impacts billing, and so this PR provides examples for the most common scenarios to do so.Preview
https://docs-staging.datadoghq.com/ericmustin/add_otel_collector_config/tracing/setup_overview/open_standards/
Additional Notes
cc'ing to start, @mx-psi , @andrewardito , @andrewsouthard1 , @albertvaka , @KSerrania , @kayayarai . Any feedback is super helpful.
Reviewer checklist