use of com.newrelic.agent.service.analytics.CollectorSpanEventSender in project newrelic-java-agent by newrelic.
the class SpanEventsServiceFactory method build.
public SpanEventsService build() {
ReservoirManager.EventSender<SpanEvent> collectorSpanEventSender = new CollectorSpanEventSender(rpmServiceManager);
AgentConfig agentConfig = configService.getDefaultAgentConfig();
Consumer<SpanEvent> eventStorageBackend = buildStorageBackendConsumer(reservoirManager);
SpanErrorBuilder defaultSpanErrorBuilder = buildDefaultSpanErrorBuilder(agentConfig);
Map<String, SpanErrorBuilder> errorBuilderForApp = buildSpanEventErrorBuilder(agentConfig, defaultSpanErrorBuilder);
configureUpdateOnConfigChange(errorBuilderForApp);
TracerToSpanEvent tracerToSpanEvent = new TracerToSpanEvent(errorBuilderForApp, environmentService, transactionDataToDistributedTraceIntrinsics, defaultSpanErrorBuilder);
SpanEventsServiceImpl result = SpanEventsServiceImpl.builder().agentConfig(agentConfig).reservoirManager(reservoirManager).collectorSender(collectorSpanEventSender).eventBackendStorage(eventStorageBackend).spanEventCreationDecider(spanEventCreationDecider).tracerToSpanEvent(tracerToSpanEvent).build();
configService.addIAgentConfigListener(result);
transactionService.addTransactionListener(result);
return result;
}
Aggregations