@Override public void initializePlugin(final StagemonitorPlugin.InitArguments initArguments) { corePlugin = initArguments.getPlugin(CorePlugin.class); corePlugin.getGrafanaClient().sendGrafanaDashboardAsync("grafana/ElasticsearchRequestDashboard.json"); final Metric2Registry metricRegistry = initArguments.getMetricRegistry(); tracerFactory = getTracerImpl(); final Tracer tracer = tracerFactory.getTracer(initArguments); reportingSpanEventListener = new ReportingSpanEventListener(initArguments.getConfiguration()); for (SpanReporter spanReporter : ServiceLoader.load(SpanReporter.class, RequestMonitor.class.getClassLoader())) { addReporter(spanReporter); } samplePriorityDeterminingSpanInterceptor = new SamplePriorityDeterminingSpanEventListener(initArguments.getConfiguration()); final ServiceLoader<SpanEventListenerFactory> factories = ServiceLoader.load(SpanEventListenerFactory.class, TracingPlugin.class.getClassLoader()); this.spanWrappingTracer = createSpanWrappingTracer(tracer, initArguments.getConfiguration(), metricRegistry, factories, samplePriorityDeterminingSpanInterceptor, reportingSpanEventListener); GlobalTracer.register(spanWrappingTracer); }
@Override public void initializePlugin(StagemonitorPlugin.InitArguments initArguments) throws Exception { alertSender = new AlertSender(initArguments.getConfiguration()); CorePlugin corePlugin = initArguments.getPlugin(CorePlugin.class); if (!corePlugin.getElasticsearchUrls().isEmpty()) { incidentRepository = new ElasticsearchIncidentRepository(corePlugin.getElasticsearchClient()); } else { incidentRepository = new ConcurrentMapIncidentRepository(); } logger.info("Using {} for storing incidents.", incidentRepository.getClass().getSimpleName()); thresholdMonitoringReporter = ThresholdMonitoringReporter.forRegistry(initArguments.getMetricRegistry()) .alertingPlugin(this) .alertSender(alertSender) .incidentRepository(incidentRepository) .measurementSession(initArguments.getMeasurementSession()) .build(); thresholdMonitoringReporter.start(checkFrequency.getValue(), TimeUnit.SECONDS); SlaCheckCreatingClassPathScanner.onStart(initArguments.getMeasurementSession()); }
@Override public void initializePlugin(InitArguments initArguments) { this.metricRegistry = initArguments.getMetricRegistry(); this.healthCheckRegistry = initArguments.getHealthCheckRegistry(); final Integer reloadInterval = getReloadConfigurationInterval(); if (reloadInterval > 0) { initArguments.getConfiguration().scheduleReloadAtRate(reloadInterval, TimeUnit.SECONDS); } initArguments.getMetricRegistry().register(MetricName.name("online").build(), new Gauge<Integer>() { @Override public Integer getValue() { return 1; } }); // it's important to initialize the ElasticsearchClient via getElasticsearchClient() // otherwise the periodic availability check might not get started getElasticsearchClient(); if (isReportToElasticsearch()) { final GrafanaClient grafanaClient = getGrafanaClient(); grafanaClient.createElasticsearchDatasource(getElasticsearchUrl()); grafanaClient.sendGrafanaDashboardAsync("grafana/ElasticsearchCustomMetricsDashboard.json"); } registerReporters(initArguments.getMetricRegistry(), initArguments.getConfiguration(), initArguments.getMeasurementSession()); }
@Override public void initializePlugin(StagemonitorPlugin.InitArguments initArguments) { initPasswordChecker(initArguments.getConfiguration()); registerPooledResources(initArguments.getMetricRegistry(), tomcatThreadPools()); final CorePlugin corePlugin = initArguments.getPlugin(CorePlugin.class); corePlugin.getGrafanaClient().sendGrafanaDashboardAsync("grafana/ElasticsearchApplicationServer.json"); initClientSpanExtensions(initArguments.getConfiguration()); }