DataDog / datadog-agent

Main repository for Datadog Agent
https://docs.datadoghq.com/
Apache License 2.0
2.89k stars 1.21k forks source link

[BUG] Automatic version tagging for containerized environments doesn't work #29425

Open yoav-klein opened 2 months ago

yoav-klein commented 2 months ago

Agent Environment Agent version: 7.55.2

Describe what happened: The docs in https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging/?tab=kubernetes state that the version tag should be taken from the image_tag. Therefore, for the following pod:

apiVersion: v1
kind: Pod
metadata:
  name: test
  labels:
    app: my-app
    tags.datadoghq.com/env: "staging"
    tags.datadoghq.com/service: "mysvc"
spec:
  containers:
  - name: nginx
    image: yoavklein3/nginx:0.1
    ports:
    - containerPort: 80

the version tag should be 0.1. But I don't see any version tag on the logs generated by this container.

Describe what you expected: the version tag should be 0.1. But I don't see any version tag on the logs generated by this container.

Steps to reproduce the issue:

  1. Install the Datadog Agent using the Datadog Operator on a Kubernetes cluster.
  2. Deploy the following pod:
apiVersion: v1
kind: Pod
metadata:
  name: test
  labels:
    app: my-app
    tags.datadoghq.com/env: "staging"
    tags.datadoghq.com/service: "mysvc"
spec:
  containers:
  - name: nginx
    image: yoavklein3/nginx:0.1
    ports:
    - containerPort: 80

Additional environment details (Operating System, Cloud provider, etc):

clamoriniere commented 2 months ago

Hi @yoav-klein

Thank you for reporting this issue, and we apologize for the inconvenience. While the documentation was recently updated (https://github.com/DataDog/documentation/pull/23262), it is not yet fully accurate in describing how "Unified Service Tagging" works across all Datadog products.

Currently, only the APM product supports automatic "version" tagging from image_tag. As such, it is expected that this functionality isn't yet available for logs and metrics emitted by your application.

We are planning to update the documentation soon to provide a more accurate description of the current Unified Service Tagging capabilities. In parallel, we're starting an internal discussion about extending this behavior to other products. In the meantime, I recommend reapplying the tags.datadoghq.com/version label to retrieve the version tags.

Thanks again for your understanding, and we'll keep you posted on any updates.