From fa2f8c5bfd6f578680cb4a833054e0d5cfe745f4 Mon Sep 17 00:00:00 2001 From: Adel Haj Hassan Date: Mon, 1 Dec 2025 13:00:17 +0100 Subject: [PATCH 1/2] hide pod and node labels/annotations as tags in a collapsed legacy configuration section --- content/en/containers/kubernetes/tag.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/en/containers/kubernetes/tag.md b/content/en/containers/kubernetes/tag.md index 4cf56d0e25a..1b7b457f59c 100644 --- a/content/en/containers/kubernetes/tag.md +++ b/content/en/containers/kubernetes/tag.md @@ -438,7 +438,7 @@ bar: quuz - +{{% collapse-content title="Legacy Configuration" level="h4" expanded=false id="legacy-configuration" %}} ### Node labels as tags
@@ -835,6 +835,7 @@ DD_KUBERNETES_NAMESPACE_LABELS_AS_TAGS='{"*":"_%%label%%"}' {{< /tabs >}} **Note**: Custom metrics may impact billing. See the [custom metrics billing page][3] for more information. +{{% /collapse-content %}} ### Container environment variables as tags From 898b273d8c328d27584e0ddc767328defcd527be Mon Sep 17 00:00:00 2001 From: Adel Haj Hassan Date: Tue, 2 Dec 2025 11:32:24 +0100 Subject: [PATCH 2/2] respond to review --- content/en/containers/kubernetes/tag.md | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/content/en/containers/kubernetes/tag.md b/content/en/containers/kubernetes/tag.md index 1b7b457f59c..987c9e99d2c 100644 --- a/content/en/containers/kubernetes/tag.md +++ b/content/en/containers/kubernetes/tag.md @@ -326,7 +326,7 @@ spec: baz: qux ``` -For Agent v7.24.0+, use the following environment variable configuration to add all resource annotations as tags to your metrics, except those from KSM (`kubernetes_state.*`). In this example, pod tag names are prefixed with `_`: +For Agent v7.24.0+, use the following environment variable configuration to add all resource annotations as tags to your metrics. In this example, pod tag names are prefixed with `_`: ```yaml apiVersion: datadoghq.com/v2alpha1 @@ -337,7 +337,7 @@ spec: global: kubernetesResourcesAnnotationsAsTags: pods: - "*": _%%annotation%% + "*": _%%annotation%% # ``` {{% /tab %}} @@ -439,7 +439,7 @@ bar: quuz {{% collapse-content title="Legacy Configuration" level="h4" expanded=false id="legacy-configuration" %}} -### Node labels as tags +#### Node labels as tags
@@ -476,7 +476,7 @@ spec: kubernetes.io/arch: arch ``` -For Agent v7.24.0+, use the following environment variable configuration to add all node labels as tags to your metrics, except those from KSM (`kubernetes_state.*`). In this example, the tag' names are prefixed with `_`: +For Agent v7.24.0+, use the following environment variable configuration to add all node labels as tags to your metrics. In this example, the tag' names are prefixed with `_`: ```yaml apiVersion: datadoghq.com/v2alpha1 @@ -486,7 +486,7 @@ metadata: spec: global: nodeLabelsAsTags: - "*": _%%label%% # Note: wildcards do not work for KSM metrics + "*": _%%label%% # Note: wildcards do not work for KSM metrics before version 7.73 ``` {{% /tab %}} @@ -506,13 +506,13 @@ datadog: kubernetes.io/arch: arch ``` -For Agent v7.24.0+, use the following environment variable configuration to add all node labels as tags to your metrics, except those from KSM (`kubernetes_state.*`). In this example, the tags' names are prefixed with `_`: +For Agent v7.24.0+, use the following environment variable configuration to add all node labels as tags to your metrics. In this example, the tags' names are prefixed with `_`: ```yaml datadog: nodeLabelsAsTags: - "*": _%%label%% # Note: wildcards do not work for KSM metrics + "*": _%%label%% # Note: wildcards do not work for KSM metrics before version 7.73 ``` {{% /tab %}} @@ -529,17 +529,17 @@ For example, you could set up: DD_KUBERNETES_NODE_LABELS_AS_TAGS='{"kubernetes.io/arch":"arch"}' ``` -For Agent v7.24.0+, use the following environment variable configuration to add all node labels as tags to your metrics, except those from KSM (`kubernetes_state.*`). In this example, the tags' tag names are prefixed with `_`: +For Agent v7.24.0+, use the following environment variable configuration to add all node labels as tags to your metrics. In this example, the tags' tag names are prefixed with `_`: ```bash -DD_KUBERNETES_NODE_LABELS_AS_TAGS='{"*":"_%%label%%"}' +DD_KUBERNETES_NODE_LABELS_AS_TAGS='{"*":"_%%label%%"}' # Note: wildcards do not work for KSM metrics before version 7.73 ``` {{% /tab %}} {{< /tabs >}} **Note**: Custom metrics may impact billing. See the [custom metrics billing page][3] for more information. -### Pod labels as tags +#### Pod labels as tags
@@ -576,7 +576,7 @@ spec: app: kube_app ``` -For Agent v7.24.0+, use the following environment variable configuration to add all pod labels as tags to your metrics, except those from KSM (`kubernetes_state.*`). In this example, the tags' names are prefixed with `_`: +For Agent v7.24.0+, use the following environment variable configuration to add all pod labels as tags to your metrics In this example, the tags' names are prefixed with `_`: ```yaml apiVersion: datadoghq.com/v2alpha1 @@ -586,7 +586,7 @@ metadata: spec: global: podLabelsAsTags: - "*": _%%label%% # Note: wildcards do not work for KSM metrics + "*": _%%label%% # Note: wildcards do not work for KSM metrics before version 7.73 ``` {{% /tab %}} @@ -638,7 +638,7 @@ DD_KUBERNETES_POD_LABELS_AS_TAGS='{"*":"_%%label%%"}' **Note**: Custom metrics may impact billing. See the [custom metrics billing page][3] for more information. -### Pod annotations as tags +#### Pod annotations as tags
@@ -737,7 +737,7 @@ DD_KUBERNETES_POD_ANNOTATIONS_AS_TAGS='{"*":"_%%annotation%%"}' **Note**: Custom metrics may impact billing. See the [custom metrics billing page][3] for more information. -### Namespace labels as tags +#### Namespace labels as tags