Search in sources :

Example 1 with CollectorSpanEventSender

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;
}
Also used : AgentConfig(com.newrelic.agent.config.AgentConfig) SpanEventsServiceImpl(com.newrelic.agent.service.analytics.SpanEventsServiceImpl) CollectorSpanEventSender(com.newrelic.agent.service.analytics.CollectorSpanEventSender) SpanErrorBuilder(com.newrelic.agent.service.analytics.SpanErrorBuilder) TracerToSpanEvent(com.newrelic.agent.service.analytics.TracerToSpanEvent) SpanEvent(com.newrelic.agent.model.SpanEvent) ReservoirManager(com.newrelic.agent.interfaces.ReservoirManager) CollectorSpanEventReservoirManager(com.newrelic.agent.service.analytics.CollectorSpanEventReservoirManager) TracerToSpanEvent(com.newrelic.agent.service.analytics.TracerToSpanEvent)

Aggregations

AgentConfig (com.newrelic.agent.config.AgentConfig)1 ReservoirManager (com.newrelic.agent.interfaces.ReservoirManager)1 SpanEvent (com.newrelic.agent.model.SpanEvent)1 CollectorSpanEventReservoirManager (com.newrelic.agent.service.analytics.CollectorSpanEventReservoirManager)1 CollectorSpanEventSender (com.newrelic.agent.service.analytics.CollectorSpanEventSender)1 SpanErrorBuilder (com.newrelic.agent.service.analytics.SpanErrorBuilder)1 SpanEventsServiceImpl (com.newrelic.agent.service.analytics.SpanEventsServiceImpl)1 TracerToSpanEvent (com.newrelic.agent.service.analytics.TracerToSpanEvent)1