caddyhttp: Make metrics opt-in (#5042)

* caddyhttp: Make metrics opt-in

Related to #4644

* Make configurable in Caddyfile
This commit is contained in:
Matt Holt 2022-09-16 13:32:49 -06:00 committed by GitHub
parent 258071d857
commit 74547f5bed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 8 deletions

View file

@ -263,7 +263,7 @@ func (app *App) Provision(ctx caddy.Context) error {
// route handler so that important security checks are done, etc.
primaryRoute := emptyHandler
if srv.Routes != nil {
err := srv.Routes.ProvisionHandlers(ctx)
err := srv.Routes.ProvisionHandlers(ctx, srv.Metrics)
if err != nil {
return fmt.Errorf("server %s: setting up route handlers: %v", srvName, err)
}