Prometheus server field value

1. Caddy version (caddy version):

2.4.0-beta.2-alpine

2. How I run Caddy:

Kubernetes or Docker

a. System environment:

K3S

b. Command:

N/A

c. Service/unit/compose file:

N/A

d. My complete Caddyfile or JSON config:

N/A

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:

N/A

6. Links to relevant resources:

Thanks in advance,
Alejandro

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.