use of com.newrelic.agent.interfaces.ReservoirManager in project newrelic-java-agent by newrelic.
the class IntrospectorServiceManager method setup.
private void setup(Map<String, Object> config) {
configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(config), Collections.<String, Object>emptyMap());
ServiceFactory.setServiceManager(this);
coreService = new IntrospectorCoreService();
threadService = new ThreadService();
environmentService = new EnvironmentServiceImpl();
transactionService = new TransactionService();
rpmConnectionService = new IntrospectorRPMConnectService();
rpmServiceManager = new IntrospectorRPMServiceManager();
transactionTraceService = new IntrospectorTransactionTraceService();
asyncTxService = new AsyncTransactionService();
profilerService = new ProfilerService();
statsService = new IntrospectorStatsService();
harvestService = new IntrospectorHarvestService();
sqlTraceService = new SqlTraceServiceImpl();
insightsService = new IntrospectorInsightsService();
logSenderService = new IntrospectorLogSenderService();
expirationService = new ExpirationService();
dbService = new DatabaseService();
jarCollectorService = new IgnoringJarCollectorService();
distributedTraceService = new DistributedTraceServiceImpl();
TransactionDataToDistributedTraceIntrinsics transactionDataToDistributedTraceIntrinsics = new TransactionDataToDistributedTraceIntrinsics(distributedTraceService);
transactionEventsService = new TransactionEventsService(transactionDataToDistributedTraceIntrinsics);
normalizationService = new NormalizationServiceImpl();
extensionService = new ExtensionService(configService, ExtensionsLoadedListener.NOOP);
tracerService = new TracerService();
commandParser = new CommandParser();
remoteInstrumentationService = new RemoteInstrumentationServiceImpl();
sourceLanguageService = new SourceLanguageService();
classTransformerService = new NoOpClassTransformerService();
jmxService = new JmxService(configService.getDefaultAgentConfig().getJmxConfig());
attributesService = new AttributesService();
circuitBreakerService = new CircuitBreakerService();
AgentConfig agentConfig = createAgentConfig(config, (Map) config.get("distributed_tracing"));
distributedTraceService.connected(null, agentConfig);
ReservoirManager<SpanEvent> reservoirManager = new CollectorSpanEventReservoirManager(configService);
ReservoirManager.EventSender<SpanEvent> collectorSender = new CollectorSpanEventSender(rpmServiceManager);
Consumer<SpanEvent> infiniteTracing = new Consumer<SpanEvent>() {
@Override
public void accept(SpanEvent spanEvent) {
}
};
SpanEventCreationDecider spanEventCreationDecider = new SpanEventCreationDecider(configService);
spanEventsService = new IntrospectorSpanEventService(agentConfig, reservoirManager, collectorSender, infiniteTracing, spanEventCreationDecider, environmentService, transactionDataToDistributedTraceIntrinsics);
configService.addIAgentConfigListener((IntrospectorSpanEventService) spanEventsService);
transactionService.addTransactionListener((IntrospectorSpanEventService) spanEventsService);
try {
transactionTraceService.start();
transactionEventsService.start();
transactionService.start();
} catch (Exception e) {
// fall through
}
}
use of com.newrelic.agent.interfaces.ReservoirManager 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