Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
To extract the correct hostname and host tags, Datadog Exporter uses the resource detection processor and the Kubernetes attributes processor. These processors allow for extracting information from hosts and containers in the form of resource semantic conventions, which is then used to build the hostname, host tags, and container tags. These tags enable automatic correlation among telemetry signals and tag-based navigation for filtering and grouping telemetry data within Datadog.
The Helm kubernetesAttributes preset sets up the service account necessary for the Kubernetes attributes processor to extract metadata from pods. Read Important Components for Kubernetes for additional information about the required service account.
Add the following in the Collector configuration:
processors:k8sattributes:passthrough:falseauth_type:"serviceAccount"pod_association:- sources:- from:resource_attributename:k8s.pod.ipextract:metadata:- k8s.pod.name- k8s.pod.uid- k8s.deployment.name- k8s.node.name- k8s.namespace.name- k8s.pod.start_time- k8s.replicaset.name- k8s.replicaset.uid- k8s.daemonset.name- k8s.daemonset.uid- k8s.job.name- k8s.job.uid- k8s.cronjob.name- k8s.statefulset.name- k8s.statefulset.uid- container.image.name- container.image.tag- container.id- k8s.container.name- container.image.name- container.image.tag- container.idlabels:- tag_name:kube_app_namekey:app.kubernetes.io/namefrom:pod- tag_name:kube_app_instancekey:app.kubernetes.io/instancefrom:pod- tag_name:kube_app_versionkey:app.kubernetes.io/versionfrom:pod- tag_name:kube_app_componentkey:app.kubernetes.io/componentfrom:pod- tag_name:kube_app_part_ofkey:app.kubernetes.io/part-offrom:pod- tag_name:kube_app_managed_bykey:app.kubernetes.io/managed-byfrom:podresourcedetection:# remove the ones that you do not usedetectors:[env, eks, ec2, aks, azure, gke, gce, system]timeout:2soverride:false
Add the following lines to values.yaml:
presets:kubernetesAttributes:enabled:true
Use the Helm k8sattributes preset in both Daemonset and Gateway, to set up the service account necessary for k8sattributesprocessor to extract metadata from pods. Read Important Components for Kubernetes for additional information about the required service account.
Because the processor is in passthrough mode in the DaemonSet, it adds only the pod IP addresses. These addresses are then used by the Gateway processor to make Kubernetes API calls and extract metadata.
The Helm kubernetesAttributes preset sets up the service account necessary for the Kubernetes attributes processor to extract metadata from pods. Read Important Components for Kubernetes for additional information about the required service account.
Set custom hosts tags directly in the Datadog exporter:
## @param tags - list of strings - optional - default: empty list## List of host tags to be sent as part of the host metadata.## These tags will be attached to telemetry signals that have the host metadata hostname.#### To attach tags to telemetry signals regardless of the host, use a processor instead.#tags:["team:infra","<TAG_KEY>:<TAG_VALUE>"]
Custom host tags can also be set as resource attributes that start with the namespace datadog.host.tag.
This can be set as an env var OTEL_RESOURCE_ATTRIBUTES=datadog.host.tag.<custom_tag_name>=<custom_tag_value> in an OTel SDK.
Or this can be set in a processor:
Same as for custom host tags, custom containers tags can be set by prefixing resource attributes by datadog.container.tag in your OTEL instrumentation.
This can be set as an env var OTEL_RESOURCE_ATTRIBUTES=datadog.container.tag.<custom_tag_name>=<custom_tag_value> in an OTel SDK.
Or this can be set in a processor: