func NewAgent(ctx context.Context, conf *config.AgentConfig) *Agent {
	dynConf := sampler.NewDynamicConfig(conf.DefaultEnv)
	in := make(chan *api.Payload, 1000)
	statsChan := make(chan pb.StatsPayload, 100)

	agnt := &Agent{
		Concentrator:          stats.NewConcentrator(conf, statsChan, time.Now()),
		ClientStatsAggregator: stats.NewClientStatsAggregator(conf, statsChan),
		Blacklister:           filters.NewBlacklister(conf.Ignore["resource"]),
		Replacer:              filters.NewReplacer(conf.ReplaceTags),
		PrioritySampler:       sampler.NewPrioritySampler(conf, dynConf),
		ErrorsSampler:         sampler.NewErrorsSampler(conf),
		ExceptionSampler:      sampler.NewExceptionSampler(),
		NoPrioritySampler:     sampler.NewNoPrioritySampler(conf),
		EventProcessor:        newEventProcessor(conf),
		TraceWriter:           writer.NewTraceWriter(conf),
		StatsWriter:           writer.NewStatsWriter(conf, statsChan),
		obfuscator:            obfuscate.NewObfuscator(conf.Obfuscation),
		In:                    in,
		conf:                  conf,
		ctx:                   ctx,
	}
	agnt.Receiver = api.NewHTTPReceiver(conf, dynConf, in, agnt)
	agnt.OTLPReceiver = api.NewOTLPReceiver(in, conf.OTLPReceiver)
	return agnt
}
// NewAgent returns a new Agent object, ready to be started. It takes a context
// which may be cancelled in order to gracefully stop the agent.
NewAgent returns a new Agent object, ready to be started. It takes a context
which may be cancelled in order to gracefully stop the agent.
// NewAgent returns a new Agent object ready to be started . It takes a context // which may be cancelled in order to gracefully stop the agent .
func NewAgent(ctx context.Context, conf *config.AgentConfig) *Agent {
	dynConf := sampler.NewDynamicConfig(conf.DefaultEnv)
	in := make(chan *api.Payload, 1000)
	statsChan := make(chan pb.StatsPayload, 100)
	agnt := &Agent{
		Concentrator:          stats.NewConcentrator(conf, statsChan, time.Now()),
		ClientStatsAggregator: stats.NewClientStatsAggregator(conf, statsChan),
		Blacklister:           filters.NewBlacklister(conf.Ignore["resource"]),
		Replacer:              filters.NewReplacer(conf.ReplaceTags),
		PrioritySampler:       sampler.NewPrioritySampler(conf, dynConf),
		ErrorsSampler:         sampler.NewErrorsSampler(conf),
		ExceptionSampler:      sampler.NewExceptionSampler(),
		NoPrioritySampler:     sampler.NewNoPrioritySampler(conf),
		EventProcessor:        newEventProcessor(conf),
		TraceWriter:           writer.NewTraceWriter(conf),
		StatsWriter:           writer.NewStatsWriter(conf, statsChan),
		obfuscator:            obfuscate.NewObfuscator(conf.Obfuscation),
		In:                    in,
		conf:                  conf,
		ctx:                   ctx,
	}
	agnt.Receiver = api.NewHTTPReceiver(conf, dynConf, in, agnt)
	agnt.OTLPReceiver = api.NewOTLPReceiver(in, conf.OTLPReceiver)
	return agnt
}
func NewAgent ( ctx context . Context , conf * config . AgentConfig ) * Agent { dynConf := sampler . NewDynamicConfig ( conf . DefaultEnv ) in := make ( chan * api . Payload , 1000 ) statsChan := make ( chan pb . StatsPayload , 100 ) agnt := & Agent { Concentrator : stats . NewConcentrator ( conf , statsChan , time . Now ( ) ) , ClientStatsAggregator : stats . NewClientStatsAggregator ( conf , statsChan ) , Blacklister : filters . NewBlacklister ( conf . Ignore [ " " ] ) , Replacer : filters . NewReplacer ( conf . ReplaceTags ) , PrioritySampler : sampler . NewPrioritySampler ( conf , dynConf ) , ErrorsSampler : sampler . NewErrorsSampler ( conf ) , ExceptionSampler : sampler . NewExceptionSampler ( ) , NoPrioritySampler : sampler . NewNoPrioritySampler ( conf ) , EventProcessor : newEventProcessor ( conf ) , TraceWriter : writer . NewTraceWriter ( conf ) , StatsWriter : writer . NewStatsWriter ( conf , statsChan ) , obfuscator : obfuscate . NewObfuscator ( conf . Obfuscation ) , In : in , conf : conf , ctx : ctx , } agnt . Receiver = api . NewHTTPReceiver ( conf , dynConf , in , agnt ) agnt . OTLPReceiver = api . NewOTLPReceiver ( in , conf . OTLPReceiver ) return agnt }
NewAgent returns a new Agent object, ready to be started.
NewAgent returns a new Agent object ready to be started .