Skip to content

Commit

Permalink
feat: add metrics limits frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
grobinson-grafana committed Jan 9, 2025
1 parent adec609 commit be02a6a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
11 changes: 11 additions & 0 deletions pkg/limits/frontend/metrics.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package frontend

import (
"github.com/prometheus/client_golang/prometheus"
)

type Metrics struct{}

func NewMetrics(_ prometheus.Registerer) *Metrics {
return &Metrics{}
}
13 changes: 9 additions & 4 deletions pkg/limits/frontend/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit be02a6a

Please sign in to comment.