Skip to content

Commit

Permalink
fix: missing metrics with Caddy 2.9 (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
IndraGunawan authored Feb 12, 2025
1 parent 6c2d07d commit 107e6b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions caddy/mercure.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile"
"github.com/caddyserver/caddy/v2/modules/caddyhttp"
"github.com/dunglas/mercure"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
Expand All @@ -29,7 +28,6 @@ const defaultHubURL = "/.well-known/mercure"

var (
ErrCompatibility = errors.New("compatibility mode only supports protocol version 7")
metrics = mercure.NewPrometheusMetrics(prometheus.DefaultRegisterer) //nolint:gochecknoglobals

// Deprecated: use transports Caddy modules.
transports = caddy.NewUsagePool() //nolint:gochecknoglobals
Expand Down Expand Up @@ -189,6 +187,8 @@ func createTransportLegacy(m *Mercure) (mercure.Transport, error) {

//nolint:wrapcheck
func (m *Mercure) Provision(ctx caddy.Context) error { //nolint:funlen,gocognit
metrics := mercure.NewPrometheusMetrics(ctx.GetMetricsRegistry())

if err := m.populateJWTConfig(); err != nil {
return err
}
Expand Down

0 comments on commit 107e6b8

Please sign in to comment.