grafana / beyla

eBPF-based autoinstrumentation of web applications and network metrics
https://grafana.com/oss/beyla-ebpf/
Apache License 2.0
1.35k stars 96 forks source link

Allow Beyla to receiver a logger object #1057

Open marctc opened 2 months ago

marctc commented 2 months ago

Currently Beyla uses its own logger and it's global to all packages. This is fine using Beyla as standalone process, but when using Beyla with Alloy the loggers are not the same and log level can't be propagated properly.

Currently we are using slog.SetDefault to specify the log level and other options. Ideally Beyla should receive a logger object an propagate to the rest of packages. Usually Prometheus packages use go-kit logger, but I assume we can do the same with slog.

mariomac commented 2 months ago

I think this fixes this task, at least partially: https://github.com/grafana/beyla/pull/1069