diff --git a/cmd/agent/app/builder.go b/cmd/agent/app/builder.go index 46a37a1a1dde..75c51c240a48 100644 --- a/cmd/agent/app/builder.go +++ b/cmd/agent/app/builder.go @@ -68,9 +68,9 @@ type Builder struct { HTTPServer HTTPServerConfiguration `yaml:"httpServer"` Metrics jmetrics.Builder `yaml:"metrics"` - reporterBuilders []reporter.Reporter - metricsFactory metrics.Factory - clientConfigManager httpserver.ClientConfigManager + reporters []reporter.Reporter + metricsFactory metrics.Factory + configManager httpserver.ClientConfigManager } // ProcessorConfiguration holds config for a processor that receives spans from Server @@ -95,7 +95,7 @@ type HTTPServerConfiguration struct { // WithReporters adds auxiliary reporters. func (b *Builder) WithReporters(r ...reporter.Reporter) *Builder { - b.reporterBuilders = append(b.reporterBuilders, r...) + b.reporters = append(b.reporters, r...) return b } @@ -136,7 +136,7 @@ func (b *Builder) CreateAgent(logger *zap.Logger) (*Agent, error) { if err != nil { return nil, err } - server, err := b.HTTPServer.getHTTPServer(b.clientConfigManager, mFactory, &b.Metrics) + server, err := b.HTTPServer.getHTTPServer(b.configManager, mFactory, &b.Metrics) if err != nil { return nil, err } @@ -144,7 +144,7 @@ func (b *Builder) CreateAgent(logger *zap.Logger) (*Agent, error) { } func (b *Builder) getReporter(logger *zap.Logger) reporter.Reporter { - return reporter.NewMultiReporter(b.reporterBuilders...) + return reporter.NewMultiReporter(b.reporters...) } // GetProcessors creates Processors with attached Reporter @@ -179,7 +179,7 @@ func (b *Builder) GetProcessors(rep reporter.Reporter, mFactory metrics.Factory, // WithClientConfigManager adds configuration manager. func (b *Builder) WithClientConfigManager(manager httpserver.ClientConfigManager) *Builder { - b.clientConfigManager = manager + b.configManager = manager return b }