Prometheus server field value

1. Caddy version (caddy version):


2. How I run Caddy:

Kubernetes or Docker

a. System environment:


b. Command:


c. Service/unit/compose file:


d. My complete Caddyfile or JSON config:


3. The problem I’m having:

I want to use the prometheus plugin using a Caddyfile. The plugin just works.
That said, is there a way to change the server field value without switching to the JSON format? (not sure if that’s possible)
caddy_http_response_size_bytes_bucket{code="200",handler="encode",method="GET",server="srv0",le="256"} 23

What I already tried:


6. Links to relevant resources:

Thanks in advance,

No, the server names are abstracted away in the Caddyfile.

We could possible expose a way to do it via the servers global options though, but I’m not sure how useful it would be. Yours is the first request for this. It would also be tricky to apply because each server must have a unique name to be valid JSON, and the servers global option was designed allow applying to any/all servers.

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