Search in sources :

Example 1 with TracerToSpanEvent

use of com.newrelic.agent.service.analytics.TracerToSpanEvent 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)

Example 2 with TracerToSpanEvent

use of com.newrelic.agent.service.analytics.TracerToSpanEvent in project newrelic-java-agent by newrelic.

the class IntrospectorSpanEventService method buildTracerToSpanEvent.

private static TracerToSpanEvent buildTracerToSpanEvent(AgentConfig agentConfig, EnvironmentService environmentService, TransactionDataToDistributedTraceIntrinsics transactionDataToDistributedTraceIntrinsics) {
    Map<String, SpanErrorBuilder> map = new HashMap<>();
    SpanErrorBuilder spanErrorBuilder = new SpanErrorBuilder(new ErrorAnalyzerImpl(agentConfig.getErrorCollectorConfig()), new ErrorMessageReplacer(agentConfig.getStripExceptionConfig()));
    map.put(agentConfig.getApplicationName(), spanErrorBuilder);
    return new TracerToSpanEvent(map, environmentService, transactionDataToDistributedTraceIntrinsics, spanErrorBuilder);
}
Also used : HashMap(java.util.HashMap) SpanErrorBuilder(com.newrelic.agent.service.analytics.SpanErrorBuilder) TracerToSpanEvent(com.newrelic.agent.service.analytics.TracerToSpanEvent) ErrorMessageReplacer(com.newrelic.agent.errors.ErrorMessageReplacer) ErrorAnalyzerImpl(com.newrelic.agent.errors.ErrorAnalyzerImpl)

Aggregations

SpanErrorBuilder (com.newrelic.agent.service.analytics.SpanErrorBuilder)2 TracerToSpanEvent (com.newrelic.agent.service.analytics.TracerToSpanEvent)2 AgentConfig (com.newrelic.agent.config.AgentConfig)1 ErrorAnalyzerImpl (com.newrelic.agent.errors.ErrorAnalyzerImpl)1 ErrorMessageReplacer (com.newrelic.agent.errors.ErrorMessageReplacer)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 SpanEventsServiceImpl (com.newrelic.agent.service.analytics.SpanEventsServiceImpl)1 HashMap (java.util.HashMap)1