grafana / alloy

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

Is there any way to disable the Alloy HTTP server #1509

Open frejanordsiek opened 3 weeks ago

frejanordsiek commented 3 weeks ago

When alloy runs, it launches a local HTTP server for debugging, defaulting to binding to 127.0.0.1:1234 (see https://grafana.com/docs/alloy/latest/troubleshoot/debug and https://grafana.com/docs/alloy/latest/reference/cli/run/ ).

Going through the documentation (config file docs and command line interface docs), there appears to be no way to actually disable this local HTTP server. Is there any way to disable it (clearly not documented) short of patching Alloy's source code and building it from source? This would be much much much better (and more reliable) than having to use a firewall rule to block the port on localhost.

For reference, this is for running Alloy on multi-user nodes where exposing internal interfaces to local users is something to be avoided.

defanator commented 3 weeks ago

Would love to see such an option as well. We have some environments where multiple instances of alloy are running on the same VM in the same netns space; currently the only way to have these together is explicitly specifying different ports for that [unnecessary in those particular envs] feature.

Also, memory consumption of alloy itself is my personal concern. It takes a lot of rss memory even for quite easy and straightforward tasks like local logs scraping. Having knobs to disable potentially memory-greedy features would be good.