Search in sources :

Example 1 with ReservoirManager

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
    }
}
Also used : ReservoirManager(com.newrelic.agent.interfaces.ReservoirManager) CommandParser(com.newrelic.agent.commands.CommandParser) Consumer(com.newrelic.agent.interfaces.backport.Consumer) ProfilerService(com.newrelic.agent.profile.ProfilerService) CircuitBreakerService(com.newrelic.agent.circuitbreaker.CircuitBreakerService) NormalizationServiceImpl(com.newrelic.agent.normalization.NormalizationServiceImpl) ExtensionService(com.newrelic.agent.extension.ExtensionService) RemoteInstrumentationServiceImpl(com.newrelic.agent.reinstrument.RemoteInstrumentationServiceImpl) SqlTraceServiceImpl(com.newrelic.agent.sql.SqlTraceServiceImpl) AsyncTransactionService(com.newrelic.agent.service.async.AsyncTransactionService) DistributedTraceServiceImpl(com.newrelic.agent.tracing.DistributedTraceServiceImpl) JmxService(com.newrelic.agent.jmx.JmxService) AttributesService(com.newrelic.agent.attributes.AttributesService) AsyncTransactionService(com.newrelic.agent.service.async.AsyncTransactionService) DatabaseService(com.newrelic.agent.database.DatabaseService) EnvironmentServiceImpl(com.newrelic.agent.environment.EnvironmentServiceImpl) SpanEvent(com.newrelic.agent.model.SpanEvent) SourceLanguageService(com.newrelic.agent.language.SourceLanguageService)

Example 2 with ReservoirManager

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;
}
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

ReservoirManager (com.newrelic.agent.interfaces.ReservoirManager)2 SpanEvent (com.newrelic.agent.model.SpanEvent)2 AttributesService (com.newrelic.agent.attributes.AttributesService)1 CircuitBreakerService (com.newrelic.agent.circuitbreaker.CircuitBreakerService)1 CommandParser (com.newrelic.agent.commands.CommandParser)1 AgentConfig (com.newrelic.agent.config.AgentConfig)1 DatabaseService (com.newrelic.agent.database.DatabaseService)1 EnvironmentServiceImpl (com.newrelic.agent.environment.EnvironmentServiceImpl)1 ExtensionService (com.newrelic.agent.extension.ExtensionService)1 Consumer (com.newrelic.agent.interfaces.backport.Consumer)1 JmxService (com.newrelic.agent.jmx.JmxService)1 SourceLanguageService (com.newrelic.agent.language.SourceLanguageService)1 NormalizationServiceImpl (com.newrelic.agent.normalization.NormalizationServiceImpl)1 ProfilerService (com.newrelic.agent.profile.ProfilerService)1 RemoteInstrumentationServiceImpl (com.newrelic.agent.reinstrument.RemoteInstrumentationServiceImpl)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