Skip to content

Support per-host Prometheus metrics #3784

@muety

Description

@muety

Initiated through this forum post – involving @hairyhenderson –, I'd like to open the discussion about extending the metrics directive to support metrics (request count, etc.) on a per-host basis.

I'd like to have metrics exposed for every single site block (speaking in Caddyfile terminology), i.e. metrics about different sites / vhosts result in different Prometheus metrics labels.

Since determining the labels automatically based on the incoming requests' host headers is problematic (see discussion above), a solution would be to manually assign a tag to the metrics directive. For instance:

example.org {
    root /var/www/html
    file_server
    metrics /metrics {
        host "example.org"
    }
}

I'm not really involved with Caddy's code base or development process, so this is rather supposed to be a starter for further discussion.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions