open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.13k stars 2.4k forks source link

[docker_observer]: Potential issue with image regex #36239

Open odvarkadaniel opened 3 weeks ago

odvarkadaniel commented 3 weeks ago

Component(s)

extension/observer/dockerobserver

What happened?

Description

We are seeing errors regaring image parsing in the otelcol binary.

otelcol[4045]: 2024-09-30T14:16:04.962Z error   dockerobserver@v0.103.0/extension.go:169    could not parse container image name    {"kind": "extension", "name": "docker_observer", "error": "failed to match regex against image"}

Steps to Reproduce

Have an image running on a node with the sha256 part not being only numbers, but e.g. <repository>:<path>@sha256:07faaa0588009ace... The regex expects the sha256 part to contain numbers only. What are the reasons behind the sha256 digest regex part accepting only digits?

Expected Result

Not fail the config.image parsing.

Actual Result

Error as mentioned above.

Collector version

v0.103.0

Environment information

Environment

OS: Ubuntu 22.04.5 LTS

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

github-actions[bot] commented 3 weeks ago

Pinging code owners:

rogercoll commented 3 weeks ago

I reported a very similar issue for the k8s_cluster receiver, I guess it applies to all receivers using the internal/common/docker package: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/36279