Skip to content

Commit

Permalink
Init deps before telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Achooo committed Apr 26, 2023
1 parent 0a8cae7 commit b73a195
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions agent/setup.go
Original file line number Diff line number Diff line change
@@ -101,6 +101,12 @@ func NewBaseDeps(configLoader ConfigLoader, logOut io.Writer, providedLogger hcl
cfg.Telemetry.PrometheusOpts.CounterDefinitions = counters
cfg.Telemetry.PrometheusOpts.SummaryDefinitions = summaries

if cfg.IsCloudEnabled() {
d.HCP, err = hcp.NewDeps(cfg.Cloud, d.Logger)
if err != nil {
return d, err
}
}
cfg.Telemetry.HCPSink = d.HCP.Sink

d.MetricsConfig, err = lib.InitTelemetry(cfg.Telemetry, d.Logger)
@@ -187,12 +193,6 @@ func NewBaseDeps(configLoader ConfigLoader, logOut io.Writer, providedLogger hcl
d.EventPublisher = stream.NewEventPublisher(10 * time.Second)

d.XDSStreamLimiter = limiter.NewSessionLimiter()
if cfg.IsCloudEnabled() {
d.HCP, err = hcp.NewDeps(cfg.Cloud, d.Logger)
if err != nil {
return d, err
}
}

return d, nil
}

0 comments on commit b73a195

Please sign in to comment.