Skip to content
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

OTAGENT-261 Add Datadog Operator instructions to otel-agent installation guide #27769

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

krlv
Copy link
Contributor

@krlv krlv commented Feb 22, 2025

What does this PR do? What is the motivation?

Document installation process of the Agent with Embedded OpenTelemetry Collector using Datadog Operator.

Merge instructions

Merge readiness:

  • Ready for merge

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:

/merge

@krlv krlv requested a review from a team as a code owner February 22, 2025 00:03
Copy link
Contributor

Preview links (active after the build_preview check completes)

Modified Files

Replace {{ code-block }} with standard markdown code blocks to fix
markup errors.
@krlv krlv force-pushed the krlv/OTAGENT-261_operator_docs branch 3 times, most recently from 5209ca2 to 8a974f1 Compare February 24, 2025 06:51
To prevent markup issues with code snippets in lists inside the tabs,
set list item numbering manually.
@krlv krlv force-pushed the krlv/OTAGENT-261_operator_docs branch from 8a974f1 to a7c3c96 Compare February 24, 2025 07:25
@krlv krlv requested a review from brett0000FF February 24, 2025 15:49
Copy link
Member

@mackjmr mackjmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM small nit on the ports

otelCollector:
enabled: true
ports:
- containerPort: 4317
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no ports are specified here then the operator will default to binding 4317/4318 (see here). This option is to be used if you pass non default ports in the otel-config.yaml, in which case you need to respecify the ports here so the operator knows how to bind them.

I think from this example it appears like setting this is necessary, whereas it's only when using non-default ports.

@brett0000FF brett0000FF added the editorial review Waiting on a more in-depth review label Feb 24, 2025
Copy link
Contributor

@brett0000FF brett0000FF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good! Just left a few suggestions and comments. Also, yes the formatting can get wonky when things are nested inside tabs. The preview looks good to me though.


Choose one of the following installation methods:

- [Datadog Operator][55]: a [Kubernetes-native][56] that approach that automatically reconciles and maintains your Datadog setup. It reports deployment status, health, and errors in its Custom Resource status, and it limits the risk of misconfiguration thanks to higher-level configuration options.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [Datadog Operator][55]: a [Kubernetes-native][56] that approach that automatically reconciles and maintains your Datadog setup. It reports deployment status, health, and errors in its Custom Resource status, and it limits the risk of misconfiguration thanks to higher-level configuration options.
- [Datadog Operator][55]: A [Kubernetes-native][56] approach that automatically reconciles and maintains your Datadog setup. It reports deployment status, health, and errors in its Custom Resource status, and it limits the risk of misconfiguration thanks to higher-level configuration options.

Choose one of the following installation methods:

- [Datadog Operator][55]: a [Kubernetes-native][56] that approach that automatically reconciles and maintains your Datadog setup. It reports deployment status, health, and errors in its Custom Resource status, and it limits the risk of misconfiguration thanks to higher-level configuration options.
- [Helm chart][4]: quick and simple way to deploy Datadog Agent. It provides versioning, rollback, and templating capabilities, making deployments consistent, and easier to replicate.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [Helm chart][4]: quick and simple way to deploy Datadog Agent. It provides versioning, rollback, and templating capabilities, making deployments consistent, and easier to replicate.
- [Helm chart][4]: A straightforward way to deploy Datadog Agent. It provides versioning, rollback, and templating capabilities, making deployments consistent and easier to replicate.

Editing out "quick" and "simple" per Vale. The reason is that these could be viewed as subjective claims that might now match all users' experiences.

Use a YAML file to specify the Helm chart parameters for the [Datadog Agent chart][4].
{{< tabs >}}
{{% tab "Datadog Operator" %}}
After deploying the Datadog Operator, create the `DatadogAgent` resource that triggers the deployment of the Datadog Agent, Cluster Agent and Cluster Checks Runners (if used) in your Kubernetes cluster. The Datadog Agent will be deployed as a DaemonSet, running a pod on every node of your cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After deploying the Datadog Operator, create the `DatadogAgent` resource that triggers the deployment of the Datadog Agent, Cluster Agent and Cluster Checks Runners (if used) in your Kubernetes cluster. The Datadog Agent will be deployed as a DaemonSet, running a pod on every node of your cluster.
After deploying the Datadog Operator, create the `DatadogAgent` resource that triggers the deployment of the Datadog Agent, Cluster Agent and Cluster Checks Runners (if used) in your Kubernetes cluster. The Datadog Agent deploys as a DaemonSet, running a pod on every node of your cluster.

{{% tab "Datadog Operator" %}}
After deploying the Datadog Operator, create the `DatadogAgent` resource that triggers the deployment of the Datadog Agent, Cluster Agent and Cluster Checks Runners (if used) in your Kubernetes cluster. The Datadog Agent will be deployed as a DaemonSet, running a pod on every node of your cluster.

1. Use datadog-agent.yaml file to specify your `DatadogAgent` deployment configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Use datadog-agent.yaml file to specify your `DatadogAgent` deployment configuration.
1. Use the `datadog-agent.yaml` file to specify your `DatadogAgent` deployment configuration.

Comment on lines +110 to +111
- Replace `<CLUSTER_NAME>` with a name for your cluster.
- Replace `<DATADOG_SITE>` with your [Datadog site][1]. Your site is {{< region-param key="dd_site" code="true" >}}. (Ensure the correct SITE is selected on the right).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Replace `<CLUSTER_NAME>` with a name for your cluster.
- Replace `<DATADOG_SITE>` with your [Datadog site][1]. Your site is {{< region-param key="dd_site" code="true" >}}. (Ensure the correct SITE is selected on the right).
- Replace `<CLUSTER_NAME>` with a name for your cluster.
- Replace `<DATADOG_SITE>` with your [Datadog site][1]. Your site is {{< region-param key="dd_site" code="true" >}}. (Ensure the correct **DATADOG SITE** is selected on the right.)

1. Remove the <code>hostPort</code> entries from your <code>datadog-values.yaml</code> file.
1. In your application's deployment file (`deployment.yaml`), configure the OTLP exporter to use the Agent service:
```sh
It is required to set the `hostPort` in order for the container port to be exposed to the external network. This enables configuring the OTLP exporter to point to the IP address of the node to which the Datadog Agent is assigned.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It is required to set the `hostPort` in order for the container port to be exposed to the external network. This enables configuring the OTLP exporter to point to the IP address of the node to which the Datadog Agent is assigned.
Set the `hostPort` to expose the container port to the external network. This enables configuring the OTLP exporter to point to the IP address of the node where the Datadog Agent is assigned.

- **Inline configuration**: Add your custom collector configuration directly in the `features.otelCollector.conf.configData` field.
- **ConfigMap-based configuration**: Store your collector configuration in a ConfigMap and reference it in the `features.otelCollector.conf.configMap` field. This approach allows you to keep Collector configuration decoupled from the `DatadogAgent` resource.

#### Inline Collector Configuration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### Inline Collector Configuration
#### Inline Collector configuration

Comment on lines +379 to +380
- **Inline configuration**: Add your custom collector configuration directly in the `features.otelCollector.conf.configData` field.
- **ConfigMap-based configuration**: Store your collector configuration in a ConfigMap and reference it in the `features.otelCollector.conf.configMap` field. This approach allows you to keep Collector configuration decoupled from the `DatadogAgent` resource.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Inline configuration**: Add your custom collector configuration directly in the `features.otelCollector.conf.configData` field.
- **ConfigMap-based configuration**: Store your collector configuration in a ConfigMap and reference it in the `features.otelCollector.conf.configMap` field. This approach allows you to keep Collector configuration decoupled from the `DatadogAgent` resource.
- **Inline configuration**: Add your custom Collector configuration directly in the `features.otelCollector.conf.configData` field.
- **ConfigMap-based configuration**: Store your Collector configuration in a ConfigMap and reference it in the `features.otelCollector.conf.configMap` field. This approach allows you to keep Collector configuration decoupled from the `DatadogAgent` resource.

name: otel-agent-config-map
{{< /code-block >}}

The Operator automatically mounts `otel-config.yaml` from the ConfigMap into the Agent with OpenTelemetry Collector DaemonSet.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Operator automatically mounts `otel-config.yaml` from the ConfigMap into the Agent with OpenTelemetry Collector DaemonSet.
The Operator automatically mounts `otel-config.yaml` from the ConfigMap into the Agent's OpenTelemetry Collector DaemonSet.

I think this is a bit clearer.

Comment on lines +864 to +870
Deploy the Datadog Agent with the above configuration file:

```shell
kubectl apply -f datadog-agent.yaml
```

After deploying the Datadog Operator, create the `DatadogAgent` resource that triggers the deployment of the Datadog Agent with OpenTelemetry Collector as a DaemonSet. The Collector is running on the same host as your application, following the [Agent deployment pattern][1]. The [Gateway deployment pattern][2] is not supported.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Deploy the Datadog Agent with the above configuration file:
```shell
kubectl apply -f datadog-agent.yaml
```
After deploying the Datadog Operator, create the `DatadogAgent` resource that triggers the deployment of the Datadog Agent with OpenTelemetry Collector as a DaemonSet. The Collector is running on the same host as your application, following the [Agent deployment pattern][1]. The [Gateway deployment pattern][2] is not supported.
Deploy the Datadog Agent with the configuration file:
```shell
kubectl apply -f datadog-agent.yaml
```
This deploys the Datadog Agent as a DaemonSet with the embedded OpenTelemetry Collector. The Collector runs on the same host as your application, following the [Agent deployment pattern][1]. The [Gateway deployment pattern][2] is not supported.

The second part is just describing the result, right? I don't think this is a separate action, so this suggestion should help make that more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial review Waiting on a more in-depth review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants