diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..cfc1e2c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,23 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "daily" + commit-message: + include: "scope" + labels: + - "deps" + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" + commit-message: + include: "scope" + labels: + - "deps" diff --git a/observability/module.go b/observability/module.go index 02ec2a8..8ac86f3 100644 --- a/observability/module.go +++ b/observability/module.go @@ -44,6 +44,8 @@ func (Observer) CaddyModule() caddy.ModuleInfo { } func (m *Observer) Provision(ctx caddy.Context) error { + registerer := prometheus.DefaultRegisterer // TODO: use ctx.GetMetricsRegisterer() on caddy >= 2.9.0 + if m.ServiceID == "" { return fmt.Errorf("service_id is required") } @@ -61,7 +63,7 @@ func (m *Observer) Provision(ctx caddy.Context) error { labels := []string{"server_name", "service_id", "process_id", "rule_id"} - m.metrics.requestsInFlight = promauto.NewGaugeVec(prometheus.GaugeOpts{ + m.metrics.requestsInFlight = promauto.With(registerer).NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Subsystem: subsystem, Name: "requests_in_flight", @@ -69,7 +71,7 @@ func (m *Observer) Provision(ctx caddy.Context) error { ConstLabels: prometheus.Labels{}, }, labels) - m.metrics.requestsCount = promauto.NewCounterVec(prometheus.CounterOpts{ + m.metrics.requestsCount = promauto.With(registerer).NewCounterVec(prometheus.CounterOpts{ Namespace: namespace, Subsystem: subsystem, Name: "requests_count", @@ -77,7 +79,7 @@ func (m *Observer) Provision(ctx caddy.Context) error { ConstLabels: prometheus.Labels{}, }, append(labels, "status_code")) - m.metrics.requestsTtfb = promauto.NewHistogramVec(prometheus.HistogramOpts{ + m.metrics.requestsTtfb = promauto.With(registerer).NewHistogramVec(prometheus.HistogramOpts{ Namespace: namespace, Subsystem: subsystem, Name: "requests_ttfb", @@ -85,7 +87,7 @@ func (m *Observer) Provision(ctx caddy.Context) error { ConstLabels: prometheus.Labels{}, }, labels) - m.metrics.requestsDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ + m.metrics.requestsDuration = promauto.With(registerer).NewHistogramVec(prometheus.HistogramOpts{ Namespace: namespace, Subsystem: subsystem, Name: "requests_duration",