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

[receiver/dockerstatsreceiver] Does not support setting TLS settings #33557

Open moserke opened 5 months ago

moserke commented 5 months ago

Component(s)

receiver/dockerstats

What happened?

Description

In trying to set up a receiver for a TLS protected containerd daemon over a docker socket, can not set TLS settings and therefore get malformed http responses. Because you can't specify the scheme in the unix socket name the net/http layer assumes http protocol.

You can see this in the error output of

"http://containerd.sock/v1.25/containers/json?filters=%7B%22status%22%3A%7B%22running%22%3Atrue%7D%7D": net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x00\x00\x06\x04\x00\x00\x00\x00\x00\x00\x05\x00\x00@\x00".
* Are you trying to connect to a TLS-enabled daemon without TLS?

Can you actually do this or is this something that is not supported today?

Collector version

0.102.1

Environment information

Environment

OS: (e.g., "Ubuntu 20.04") Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

docker_stats:
  endpoint: unix://containerd.sock

Log output

No response

Additional context

No response

github-actions[bot] commented 5 months ago

Pinging code owners:

github-actions[bot] commented 3 months ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

jamesmoessis commented 3 months ago

@moserke I would be happy to review if you raise a PR for this. I am assuming this would only apply if the daemon is done over TCP, not unix socket?

github-actions[bot] commented 4 hours ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.