Name servers in metrics

caddy 2.6.2

Is it possible to name servers, so I can identify them easier in metrics?

I have two sites in Caddyfile, they get named srv0 and srv1, but it’s hard to tell which one is which, and not even sure if the name assignment is persistent.

# metrics on localhost
localhost:80 caddy:80 {
	handle /metrics {
		metrics
	}
}

# main domains
website.com {
    handle {
	    reverse_proxy http://nuxt:3000
    }
}

metrics

caddy_http_request_duration_seconds_sum{code="200", handler="subroute", instance="caddy:80", job="caddy", method="GET", server="srv0"}
1.7661053550000003
caddy_http_request_duration_seconds_sum{code="200", handler="subroute", instance="caddy:80", job="caddy", method="GET", server="srv1"}
0.06964131200000001
1 Like

This has been requested on GitHub, see this issue:

The problem is, we don’t have the expertise or maintainers to help us with fixing problems with metrics right now. The most active maintainers don’t use metrics for themselves and don’t have a good enough understanding of it to maintain it.

2 Likes

got it!
thanks for the link, will keep an eye on it.

This topic was automatically closed after 30 days. New replies are no longer allowed.