From be02a6a521ec75c3def32bb25aba5041b14af158 Mon Sep 17 00:00:00 2001 From: George Robinson Date: Thu, 9 Jan 2025 14:58:12 +0000 Subject: [PATCH] feat: add metrics limits frontend --- pkg/limits/frontend/metrics.go | 11 +++++++++++ pkg/limits/frontend/service.go | 13 +++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 pkg/limits/frontend/metrics.go diff --git a/pkg/limits/frontend/metrics.go b/pkg/limits/frontend/metrics.go new file mode 100644 index 0000000000000..8e91c280ae2c4 --- /dev/null +++ b/pkg/limits/frontend/metrics.go @@ -0,0 +1,11 @@ +package frontend + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +type Metrics struct{} + +func NewMetrics(_ prometheus.Registerer) *Metrics { + return &Metrics{} +} diff --git a/pkg/limits/frontend/service.go b/pkg/limits/frontend/service.go index 14a7d4f1d7d5b..fa4e6151563f1 100644 --- a/pkg/limits/frontend/service.go +++ b/pkg/limits/frontend/service.go @@ -9,13 +9,18 @@ import ( ) type IngestLimits struct { - cfg Config - logger log.Logger + cfg Config + logger log.Logger + metrics *Metrics services.Service } -func New(cfg Config, logger log.Logger, _ prometheus.Registerer) (*IngestLimits, error) { - l := &IngestLimits{} +func New(cfg Config, logger log.Logger, r prometheus.Registerer) (*IngestLimits, error) { + l := &IngestLimits{ + cfg: cfg, + logger: logger, + metrics: NewMetrics(r), + } l.Service = services.NewBasicService(l.starting, l.running, l.stopping) return l, nil }