grafana / alloy

OpenTelemetry Collector distribution with programmable pipelines
https://grafana.com/oss/alloy
Apache License 2.0
977 stars 103 forks source link

Feature Request: Add cURL to the Container Images #477

Open SeamusGrafana opened 1 year ago

SeamusGrafana commented 1 year ago

Hello,

Would it be possible to add cURL to the Container Images by default?

This helps with troubleshooting connectivity from the Agent Container to an Endpoint and I often find myself having to install it manually when testing/troubleshooting issues and it aids me in resolving them.

Additionally, it also allows you to define a custom Healthcheck in a Docker Compose file to use the health endpoint.

Thanks

tpaschalis commented 4 months ago

Is this enabling any use case other than a shortcut for apt update && apt-install -y curl?

If it isn't, then I'd be a little wary of introducing a new dependency just for the sake of it.

SeamusGrafana commented 4 months ago

Personally, I would use it as a Health Check for the Docker Container when running Docker Compose, against the Ready or Health Endpoint

andeki92 commented 2 months ago

I support the idea of incorporating curl to facilitate easier health checks. Our setup uses Podman, where health checks are performed within the container. Consequently, accessing the /-/ready endpoint directly is challenging.

For those encountering this issue, an alternative is to employ exec health checks. The following command can serve as a workaround:

/bin/bash -c 'echo -e "GET /-/ready HTTP/1.1\nHost: localhost\nConnection: close\n\n"> /dev/tcp/localhost/<application-port>'

This uses the /dev/tcp system utility to report the endpoint status!

brpaz commented 1 month ago

@tpaschalis I stumbled on this when trying to install Grafana Alloy for the first time, on my cluster.

I understand the reason, for not introducing a new dependency, but curl or wget are pretty standard to have and pretty much the common way to do health checks in containers.

Having the health endpoint is kind useless if I can´t call it :)