Skip to content

Commit

Permalink
[APM Onboarding] Update configuration options for APM Instrumentation (
Browse files Browse the repository at this point in the history
…#1318)

---------

Co-authored-by: Cedric Lamoriniere <cedric.lamoriniere@datadoghq.com>
  • Loading branch information
liliyadd and clamoriniere authored Mar 11, 2024
1 parent e5284d5 commit dd8fb79
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 54 deletions.
8 changes: 8 additions & 0 deletions charts/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Datadog changelog

## 3.58.0

* Change configuration options for APM Instrumentation. Starting from Agent and Cluster-Agent version `7.51.0` APM Instrumentation needs to be configured using the following configuration options:
* `datadog.apm.instrumentation.enabled` - set to `true` to enable automatic instrumentation.
* `datadog.apm.instrumentation.enabledNamespaces` - optional; list of namespaces to enable automatic instrumentation in. If not provided, every namespace in the cluster will be instrumented.
* `datadog.apm.instrumentation.disabledNamespaces` - optional; list of namespaces to disable automatic instrumentation in.


## 3.57.3

* Exclude agent, cluster agent and agent clusterchecks pods from injection from the admission controller.
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: datadog
version: 3.57.3
version: 3.58.0
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
6 changes: 3 additions & 3 deletions charts/datadog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog

![Version: 3.57.3](https://img.shields.io/badge/Version-3.57.3-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.58.0](https://img.shields.io/badge/Version-3.58.0-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)

[Datadog](https://www.datadoghq.com/) is a hosted infrastructure monitoring platform. This chart adds the Datadog Agent to all nodes in your cluster via a DaemonSet. It also optionally depends on the [kube-state-metrics chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics). For more information about monitoring Kubernetes with Datadog, please refer to the [Datadog documentation website](https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/).

Expand Down Expand Up @@ -262,7 +262,7 @@ datadog:
# (...)
apm:
instrumentation:
enabled: false
enabled: true
enabledNamespaces:
- namespaceC
```
Expand All @@ -274,7 +274,7 @@ datadog:
# (...)
apm:
instrumentation:
enabled: false
enabled: true
libVersions:
java: v1.18.0
python: v1.20.0
Expand Down
4 changes: 2 additions & 2 deletions charts/datadog/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ datadog:
# (...)
apm:
instrumentation:
enabled: false
enabled: true
enabledNamespaces:
- namespaceC
```
Expand All @@ -270,7 +270,7 @@ datadog:
# (...)
apm:
instrumentation:
enabled: false
enabled: true
libVersions:
java: v1.18.0
python: v1.20.0
Expand Down
16 changes: 3 additions & 13 deletions charts/datadog/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,24 +155,14 @@ The Datadog Agent is listening on port {{ $apmPort }} for APM service.

{{- end }}

{{- if and .Values.datadog.apm.instrumentation.enabled_namespaces (eq (include "cluster-agent-enabled" .) "false")}}
{{- if and .Values.datadog.apm.instrumentation.enabledNamespaces (not .Values.datadog.apm.instrumentation.enabled) }}

#################################################################
#### WARNING: Configuration notice ####
#################################################################

You are using datadog.apm.instrumentation.enabledNamespaces but you disabled the cluster agent. This configuration is unsupported and Kubernetes resource monitoring has been turned off.
To enable it please set clusterAgent.enabled to 'true'.
{{- end }}

{{- if and .Values.datadog.apm.instrumentation.enabled .Values.datadog.apm.instrumentation.enabledNamespaces }}

#################################################################
#### WARNING: Configuration notice ####
#################################################################

The options `datadog.apm.instrumentation.enabled` and `datadog.apm.instrumentation.enabledNamespaces` are set together.
APM Single Step Instrumentation will be enabled in the whole cluster.
The option `datadog.apm.instrumentation.enabledNamespaces` is set while `datadog.apm.instrumentation.enabled` is disabled.
APM Single Step Instrumentation will be disabled in the whole cluster.

{{- end }}

Expand Down
30 changes: 0 additions & 30 deletions charts/datadog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -903,34 +903,4 @@ Create RBACs for custom resources
{{- end -}}
{{- end -}}

{{/*
Return all namespaces with enabled Single Step Instrumentation. If instrumentation.enabledNamespaces contains the namespace where Datadog is installed,
it will be removed.
*/}}
{{- define "apmInstrumentation.enabledNamespaces" -}}
{{- if and .Values.datadog.apm .Values.datadog.apm.instrumentation -}}
{{- if and .Values.datadog.apm.instrumentation.enabledNamespaces (not .Values.datadog.apm.instrumentation.enabled) -}}
{{- if has .Release.Namespace .Values.datadog.apm.instrumentation.enabledNamespaces -}}
{{- $ns := mustWithout .Values.datadog.apm.instrumentation.enabledNamespaces .Release.Namespace -}}
{{- if $ns -}}
{{- $ns | toJson | quote -}}
{{- end -}}
{{- else -}}
{{- .Values.datadog.apm.instrumentation.enabledNamespaces | toJson | quote -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Return all namespaces with disabled Single Step Instrumentation
*/}}
{{- define "apmInstrumentation.disabledNamespaces" -}}
{{- if and .Values.datadog.apm .Values.datadog.apm.instrumentation -}}
{{- if and .Values.datadog.apm.instrumentation.disabledNamespaces .Values.datadog.apm.instrumentation.enabled -}}
{{- append .Values.datadog.apm.instrumentation.disabledNamespaces .Release.Namespace | toJson | quote -}}
{{- else if .Values.datadog.apm.instrumentation.enabled -}}
{{- list .Release.Namespace | toJson | quote -}}
{{- end -}}
{{- end -}}
{{- end -}}
10 changes: 5 additions & 5 deletions charts/datadog/templates/cluster-agent-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ spec:
value: {{ include "clusterAgent-remoteConfiguration-enabled" . | quote }}
{{- if .Values.datadog.apm.instrumentation.enabled }}
- name: DD_APM_INSTRUMENTATION_ENABLED
value: "true"
value: {{ .Values.datadog.apm.instrumentation.enabled | quote }}
{{- end }}
{{- if ne (include "apmInstrumentation.enabledNamespaces" .) "" }}
{{- if .Values.datadog.apm.instrumentation.enabledNamespaces }}
- name: DD_APM_INSTRUMENTATION_ENABLED_NAMESPACES
value: {{ include "apmInstrumentation.enabledNamespaces" . }}
value: {{ .Values.datadog.apm.instrumentation.enabledNamespaces | toJson | quote }}
{{- end }}
{{- if ne (include "apmInstrumentation.disabledNamespaces" .) "" }}
{{- if .Values.datadog.apm.instrumentation.disabledNamespaces }}
- name: DD_APM_INSTRUMENTATION_DISABLED_NAMESPACES
value: {{ include "apmInstrumentation.disabledNamespaces" . }}
value: {{ .Values.datadog.apm.instrumentation.disabledNamespaces | toJson | quote }}
{{- end }}
{{- if .Values.datadog.apm.instrumentation.libVersions }}
- name: DD_APM_INSTRUMENTATION_LIB_VERSIONS
Expand Down

0 comments on commit dd8fb79

Please sign in to comment.