feat: garage metrics coop-cloud/garage#8 #22

Closed
fauno wants to merge 3 commits from garage into alloy
Owner

since metrics by default are protected by a token, they can't be exported locally like we're discussing at #20

since metrics by default are protected by a token, they can't be exported locally like we're discussing at #20
fauno added 1 commit 2026-06-11 22:20:37 +00:00
fauno added 1 commit 2026-06-11 22:34:06 +00:00
fauno added 1 commit 2026-06-11 22:38:40 +00:00
Owner

How would I scrape multiple garage instances?

How would I scrape multiple garage instances?
Owner

https://grafana.com/docs/alloy/latest/reference/components/discovery/discovery.docker/

It seems it is possible to configure a bearer token for the discovery with docker labels

https://grafana.com/docs/alloy/latest/reference/components/discovery/discovery.docker/ It seems it is possible to configure a bearer token for the discovery with docker labels
Owner

I was thinking about a label-based approach, see the alloy-updates branch commit e247677433. Discovering the targets that have to be scraped dynamically based on container labels. I haven't tested this yet.

Any container can opt in to being scraped by adding Docker labels:

labels:
  - "prometheus.io/scrape=true"
  - "prometheus.io/port=3903"       # Garage metrics port
  - "prometheus.io/path=/metrics"   # optional, /metrics is the default
  - "prometheus.io/auth=basic"      # optional, uses the basic_auth secret

Alloy then discovers all containers, filters to those with prometheus.io/scrape=true, and scrapes them automatically. I've only added noauth and basic auth, so for Garage, prometheus.io/auth=bearer should probably be added. Multiple Garage instances on the same host would each be picked up as separate targets by their service name. Alloy just needs to be configured with all needed types of auth and other possible parameters, and then the container labels do the rest. No need to add every app we want to scrape into monitoring-ng.

I was thinking about a label-based approach, see the alloy-updates branch commit e247677433. Discovering the targets that have to be scraped dynamically based on container labels. I haven't tested this yet. Any container can opt in to being scraped by adding Docker labels: ``` labels: - "prometheus.io/scrape=true" - "prometheus.io/port=3903" # Garage metrics port - "prometheus.io/path=/metrics" # optional, /metrics is the default - "prometheus.io/auth=basic" # optional, uses the basic_auth secret ``` Alloy then discovers all containers, filters to those with prometheus.io/scrape=true, and scrapes them automatically. I've only added noauth and basic auth, so for Garage, `prometheus.io/auth=bearer` should probably be added. Multiple Garage instances on the same host would each be picked up as separate targets by their service name. Alloy just needs to be configured with all needed types of auth and other possible parameters, and then the container labels do the rest. No need to add every app we want to scrape into monitoring-ng.
Author
Owner

already implemented metrics discovery

already implemented metrics discovery
fauno closed this pull request 2026-06-20 16:37:01 +00:00

Pull request closed

Sign in to join this conversation.