Skip to content

Commit 8ba0623

Browse files
committed
Merge branch 'eddy/k8-lib-injection' of github.com:DataDog/documentation into eddy/k8-lib-injection
2 parents 4e1a552 + 036abd7 commit 8ba0623

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

content/en/containers/cluster_agent/admission_controller.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,29 +128,42 @@ Finally, run the following commands:
128128
- `kubectl apply -f agent-services.yaml`
129129
- `kubectl apply -f cluster-agent-deployment.yaml`
130130

131-
### APM and DogStatsD
132131

133-
To configure and inject APM tracers libraries and DogstatsD clients automatically:
132+
### APM
133+
You can configure the Cluster Agent (version 7.39 and higher) to inject APM tracing libraries automatically.
134134

135+
After you install the Cluster Agent, do one of the following:
135136
- Add the label `admission.datadoghq.com/enabled: "true"` to your pod.
136137
- Configure the Cluster Agent admission controller by setting `mutateUnlabelled` (or `DD_ADMISSION_CONTROLLER_MUTATE_UNLABELLED`, depending on your configuration method) to `true`.
137138

138-
To opt-in your container for library injection, use Pod annotations inside your application's YAML file to specify which language tracers and should be injected, along with their versions.
139+
To opt-in your container for library injection, use Pod annotations inside your application's YAML file to specify language tracers and versions.
140+
139141

140142
The annotations are a `key: value` pair in the following format:
141143

142144
```yaml
143-
admission.datadoghq.com/<language>-tracer.version: <tracer-version>
145+
datadoghq.com/<language>-lib.version: <lib-version>
146+
```
147+
148+
Adding a this annotation results in the injection of the tracer library for that language and version into the containerized application.
149+
Currently, the list of possible lib values include `java`, `js` and `python` respectively.
150+
151+
For example to inject the latest Java tracer:
152+
153+
```yaml
154+
annotations:
155+
datadoghq.com/java-lib.version: "latest"
144156
```
145157

146-
Adding a this annotation means the tracer library for that language and version is injected into the containerized application. You can add several `<language>-tracer.version` annotations to inject multiple language tracers into one container.
158+
**Note**: Use caution specifying `latest` as major library releases can introduce breaking changes.
147159

148-
For example to inject the latest Java tracer and Ruby tracer version 1.4.0:
160+
Although it's an uncommon scenario, you can add multiple `<language>-lib.version` annotations to inject multiple language tracers into one container.
149161

162+
For example to inject the latest Java tracer and Node tracer v3.0.0:
150163
```yaml
151164
annotations:
152-
admission.datadoghq.com/java-tracer.version: "latest"
153-
admission.datadoghq.com/ruby-tracer.version: "1.4.0"
165+
datadoghq.com/java-lib.version: "latest"
166+
datadoghq.com/js-lib.version: "3.0.0"
154167
```
155168

156169
To prevent pods from receiving environment variables, add the label `admission.datadoghq.com/enabled: "false"`. This works even if you set `mutateUnlabelled: true`.
@@ -166,6 +179,11 @@ Possible options:
166179
| `false` | `admission.datadoghq.com/enabled=true` | Yes |
167180
| `false` | `admission.datadoghq.com/enabled=false` | No |
168181

182+
### DogStatsD
183+
To configure DogstatsD clients or other APM libraries that does not support library injection at this time, inject the environment variables `DD_AGENT_HOST` and `DD_ENTITY_ID` by using one of the following:
184+
- Add the label `admission.datadoghq.com/enabled: "true"` to your pod.
185+
- Configure the Cluster Agent admission controller by setting `mutateUnlabelled` (or `DD_ADMISSION_CONTROLLER_MUTATE_UNLABELLED`, depending on your configuration method) to `true`.
186+
169187

170188
#### Order of priority
171189
The Datadog admission controller does not inject the environment variables `DD_VERSION`, `DD_ENV`, and `DD_SERVICE` if they already exist.

0 commit comments

Comments
 (0)