@Test public void testLogReportSpan() throws Exception { Mockito.when(elasticsearchTracingPlugin.isOnlyLogElasticsearchSpanReports()).thenReturn(true); final SpanContextInformation spanContext = reportSpanWithCallTree(1000, "Report Me"); final List<MockSpan> sampledSpans = getSampledSpans(); assertThat(sampledSpans).hasSize(1); Mockito.verify(httpClient, Mockito.times(0)).send(any(), any(), any(), any(), any()); Mockito.verify(spanLogger).info(ArgumentMatchers.startsWith("{\"index\":{\"_index\":\"stagemonitor-spans-" + StringUtils.getLogstashStyleDate() + "\",\"_type\":\"spans\"}}\n")); Assert.assertTrue(reporter.isActive(spanContext)); }
@Override public boolean isActive(SpanContextInformation spanContext) { final boolean logOnly = elasticsearchTracingPlugin.isOnlyLogElasticsearchSpanReports(); return elasticsearchClient.isElasticsearchAvailable() || logOnly; }
ElasticsearchSpanReporter extends SpanReporter { @Override public boolean isActive(SpanContextInformation spanContext) { final boolean logOnly = elasticsearchTracingPlugin.isOnlyLogElasticsearchSpanReports(); return elasticsearchClient.isElasticsearchAvailable() || logOnly; } }
ElasticsearchSpanReporter extends SpanReporter { @Override public boolean isActive(SpanContextInformation spanContext) { final boolean logOnly = elasticsearchTracingPlugin.isOnlyLogElasticsearchSpanReports(); return elasticsearchClient.isElasticsearchAvailable() || logOnly; } ElasticsearchSpanReporter();   ElasticsearchSpanReporter(Logger spanLogger); }
ElasticsearchSpanReporter extends SpanReporter { @Override public boolean isActive(SpanContextInformation spanContext) { final boolean logOnly = elasticsearchTracingPlugin.isOnlyLogElasticsearchSpanReports(); return elasticsearchClient.isElasticsearchAvailable() || logOnly; } ElasticsearchSpanReporter();   ElasticsearchSpanReporter(Logger spanLogger); @Override void init(ConfigurationRegistry configuration); @Override void report(SpanContextInformation spanContext, final SpanWrapper spanWrapper); @Override boolean isActive(SpanContextInformation spanContext); @Override void updateSpan(B3HeaderFormat.B3Identifiers spanIdentifiers, B3HeaderFormat.B3Identifiers newSpanIdentifiers, Map<String, Object> tagsToUpdate); }
ElasticsearchSpanReporter extends SpanReporter { @Override public boolean isActive(SpanContextInformation spanContext) { final boolean logOnly = elasticsearchTracingPlugin.isOnlyLogElasticsearchSpanReports(); return elasticsearchClient.isElasticsearchAvailable() || logOnly; } ElasticsearchSpanReporter();   ElasticsearchSpanReporter(Logger spanLogger); @Override void init(ConfigurationRegistry configuration); @Override void report(SpanContextInformation spanContext, final SpanWrapper spanWrapper); @Override boolean isActive(SpanContextInformation spanContext); @Override void updateSpan(B3HeaderFormat.B3Identifiers spanIdentifiers, B3HeaderFormat.B3Identifiers newSpanIdentifiers, Map<String, Object> tagsToUpdate);  }