How to Perform Periodic HTTP Health Checks in Grafana Agent and Send Results to Loki/Prometheus?

Hi everyone,

I have a Tomcat server running on a port, which exposes health check URLs for various services (e.g., http://localhost:port/auth/hello). I want Grafana Agent to periodically query these URLs, extract the HTTP response status (200, 500, etc.), and send it as logs to Loki or as metrics to Prometheus, so I can visualize service availability in Grafana.

I saw this url: blackbox_config next | Grafana Agent documentation

But I am unsure which approach is best suited for my use case. Any guidance or example configurations would be greatly appreciated!

Thanks in advance!

What format is the health check data

Ila’s recommended on that page you linked I would go with alloy

Another way is using a Cron job and push to Loki using python