use of com.newrelic.agent.service.analytics.SpanErrorBuilder 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;
}
use of com.newrelic.agent.service.analytics.SpanErrorBuilder 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);
}
Aggregations