Skip to content

Commit e7a6c78

Browse files
[CONTP-1246] docs(k8s_tags): Add AD template variable to k8s tag autodiscovery section (#34241)
* docs: Add tmpl variable support in k8s tag extraction page * docs: frontload exception Co-authored-by: Esther Kim <esther.kim@datadoghq.com> --------- Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
1 parent 21ebf18 commit e7a6c78

File tree

1 file changed

+9
-0
lines changed
  • content/en/containers/kubernetes

1 file changed

+9
-0
lines changed

content/en/containers/kubernetes/tag.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ Starting with Agent v7.17+, the Agent can Autodiscover tags from Docker labels.
111111
com.datadoghq.ad.tags: '["<TAG_KEY>:TAG_VALUE", "<TAG_KEY_1>:<TAG_VALUE_1>"]'
112112
```
113113

114+
Starting with Agent v7.77+, tag annotations support [Autodiscovery template variables][5] for dynamic tagging based on runtime metadata. With the exception of `%%env_<VAR>%%`, all template variables are supported.
115+
116+
```yaml
117+
annotations:
118+
ad.datadoghq.com/tags: '{"pod_ip":"%%host%%","pod_name":"%%kube_pod_name%%","namespace":"%%kube_namespace%%"}'
119+
ad.datadoghq.com/nginx.tags: '{"container_port":"%%port_80%%"}'
120+
```
121+
114122
## Tag extraction
115123

116124
Starting in version 7.64+, the Agent and Cluster Agent can be configured to collect labels and annotations from Kubernetes resources and use them as tags from a common configuration. Datadog recommends using the following options to ensure consistent reporting across the Agent's core tagging, the Cluster Agent's KSM reporting, and both Agents' Orchestrator Explorer reporting:
@@ -951,3 +959,4 @@ DD_CONTAINER_LABELS_AS_TAGS='{"app":"kube_app"}'
951959
[2]: /getting_started/tagging/unified_service_tagging
952960
[3]: /account_management/billing/custom_metrics
953961
[4]: /getting_started/tagging/assigning_tags/?tab=containerizedenvironments#tags-cardinality
962+
[5]: /containers/guide/template_variables/

0 commit comments

Comments
 (0)