Skip to content

Commit

Permalink
went back to inmem sink being the default
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Dec 9, 2023
1 parent 150a5dc commit 4905617
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ func DefaultConfig() *Config {
Telemetry: telemetry.Config{
Enabled: false,
GlobalLabels: [][]string{},
MetricsSink: telemetry.MetricSinkInMem,
},
API: APIConfig{
Enable: false,
Expand Down
12 changes: 5 additions & 7 deletions telemetry/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ func New(cfg Config) (_ *Metrics, rerr error) {
err error
)
switch cfg.MetricsSink {
case MetricSinkInMem:
case MetricSinkStatsd:
sink, err = metrics.NewStatsdSink(cfg.StatsdAddr)
case MetricSinkDogsStatsd:
sink, err = datadog.NewDogStatsdSink(cfg.StatsdAddr, cfg.DatadogHostname)
default:
memSink := metrics.NewInmemSink(10*time.Second, time.Minute)
sink = memSink
inMemSig := metrics.DefaultInmemSignal(memSink)
Expand All @@ -124,12 +128,6 @@ func New(cfg Config) (_ *Metrics, rerr error) {
inMemSig.Stop()
}
}()
case MetricSinkStatsd:
sink, err = metrics.NewStatsdSink(cfg.StatsdAddr)
case MetricSinkDogsStatsd:
sink, err = datadog.NewDogStatsdSink(cfg.StatsdAddr, cfg.DatadogHostname)
default:
sink = &metrics.BlackholeSink{}
}

if err != nil {
Expand Down

0 comments on commit 4905617

Please sign in to comment.