Skip to content

[processor/k8sattributes] Support name:tag@digest image name format #36131

Closed
@zarbis

Description

@zarbis

Component(s)

processor/k8sattributes

What happened?

Description

For better integrity guarantees we've started using name:tag@digest image reference format (e.g. alpine:3.19@sha256:ae65dbf8749a7d4527648ccee1fa3deb6bfcae34cbc30fc67aa45c44dcaa90ee).

It doesn't seem to be part of OCI image spec, but many projects use it (for example Karpenter).

Steps to Reproduce

  • Deploy Pod with image alpine:3.19@sha256:ae65dbf8749a7d4527648ccee1fa3deb6bfcae34cbc30fc67aa45c44dcaa90ee
  • Create collector with k8sattributes processor:
processors:
  k8sattributes: 
    extract:
      metadata:
      - k8s.node.name
      - k8s.deployment.name
      - k8s.replicaset.name
      - k8s.daemonset.name
      - k8s.job.name
      - k8s.cronjob.name
      - k8s.statefulset.name
      - k8s.container.name
      - container.image.name
      - container.image.tag
  • Observe telemetry metadata

Expected Result

container.image.name: alpine
container.image.tag: 3.19

Actual Result

container.image.name: alpine:3.19@sha
container.image.tag: ae65dbf8749a7d4527648ccee1fa3deb6bfcae34cbc30fc67aa45c44dcaa90ee

So basically split happens on last colon, not the first one.

Collector version

0.107.0

Environment information

Environment

K8s: 1.29

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions