opentelemetry-collector-releases icon indicating copy to clipboard operation
opentelemetry-collector-releases copied to clipboard

Publishing remotely debuggable collector docker images

Open swar8080 opened this issue 1 year ago • 5 comments
trafficstars

Hello, I'm opening this issue to see if there's interest in publishing collector images that allow attaching a remote debugger. They can be helpful for troubleshooting environment-specific issues

I've hacked together some images that allow this at https://github.com/swar8080/remote-debug-otel-collector. I'll mention this repo in the otel slack channel and link this issue in the README. That could help gauge the community's interest in making "official" debuggable images in opentelemetry-collector-releases

swar8080 avatar Feb 20 '24 01:02 swar8080

For security reasons we have no plans to publish images built with anything other than scratch, with only the bare minimum needed to run a Collector.

If you need to remote into a running collector I think the route you've taken to build your own image is the correct approach.

TylerHelmuth avatar Feb 20 '24 17:02 TylerHelmuth

It's probably possible to get the image down to scratch plus just the delve binary

swar8080 avatar Feb 20 '24 20:02 swar8080

Jaeger has something like this, and I think we could incorporate building new images after the release is made. From what I remember, apart from the initial implementation, it didn't require maintenance.

https://github.com/jaegertracing/jaeger/blob/main/docker/debug/Dockerfile

jpkrohling avatar Feb 22 '24 08:02 jpkrohling

Kubernetes supports using ephemeral containers for debugging https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/#ephemeral-container; I think most of our users can debug the official images without us having to introduce new images.

mx-psi avatar Mar 05 '24 11:03 mx-psi

That's useful, but from what I remember, there are two advantages to debug images: there's delve, allowing people to plug a debugger and attach the source code, so that people can add breakpoints and see why things are breaking. The second advantage is having access to the same file system, which might be useful to check whether the right files are being loaded.

jpkrohling avatar Mar 05 '24 11:03 jpkrohling