/** * Unregisters the {@link JaegerTraceExporter} from the OpenCensus library. * * @throws IllegalStateException if a Jaeger exporter is not registered. * @since 0.13 */ public static void unregister() { synchronized (monitor) { checkState(handler != null, "Jaeger exporter is not registered."); unregister(Tracing.getExportComponent().getSpanExporter()); handler = null; } }
/** * Unregisters the Stackdriver Trace exporter from the OpenCensus library. * * @throws IllegalStateException if a Stackdriver exporter is not registered. * @since 0.12 */ public static void unregister() { synchronized (monitor) { checkState(handler != null, "Stackdriver exporter is not registered."); unregister(Tracing.getExportComponent().getSpanExporter()); handler = null; } }
/** * Unregisters the Stackdriver Trace exporter from the OpenCensus library. * * @throws IllegalStateException if a Stackdriver exporter is not registered. * @since 0.12 */ public static void unregister() { synchronized (monitor) { checkState(handler != null, "Stackdriver exporter is not registered."); unregister(Tracing.getExportComponent().getSpanExporter()); handler = null; } }
/** * Unregisters the Zipkin Trace exporter from the OpenCensus library. * * @throws IllegalStateException if a Zipkin exporter is not registered. * @since 0.12 */ public static void unregister() { synchronized (monitor) { checkState(handler != null, "Zipkin exporter is not registered."); unregister(Tracing.getExportComponent().getSpanExporter()); handler = null; } }
/** * Unregisters the Datadog Trace exporter from the OpenCensus library. * * @throws IllegalStateException if a Datadog exporter is not registered. * @since 0.19 */ public static void unregister() { synchronized (monitor) { checkState(handler != null, "Datadog exporter is not registered."); Tracing.getExportComponent().getSpanExporter().unregisterHandler(REGISTER_NAME); handler = null; } } }
/** * Unregisters the Instana Trace exporter from the OpenCensus library. * * @throws IllegalStateException if a Instana exporter is not registered. * @since 0.12 */ public static void unregister() { synchronized (monitor) { checkState(handler != null, "Instana exporter is not registered."); unregister(Tracing.getExportComponent().getSpanExporter()); handler = null; } }
/** * Registers the Logging exporter to the OpenCensus library. * * @since 0.12 */ public static void register() { register(Tracing.getExportComponent().getSpanExporter()); }
/** * Unregisters the Logging exporter from the OpenCensus library. * * @since 0.12 */ public static void unregister() { unregister(Tracing.getExportComponent().getSpanExporter()); }
/** * Unregisters the OC-Agent exporter from the OpenCensus library. * * @since 0.19 */ public static void unregister() { unregister(Tracing.getExportComponent().getSpanExporter()); }
/** * Unregisters the Logging exporter from the OpenCensus library. * * @since 0.12 */ public static void unregister() { unregister(Tracing.getExportComponent().getSpanExporter()); }
private static void registerInternal(Handler newHandler) { synchronized (monitor) { handler = newHandler; register(Tracing.getExportComponent().getSpanExporter(), newHandler); } }
/** * Registers the Logging exporter to the OpenCensus library. * * @since 0.12 */ public static void register() { register(Tracing.getExportComponent().getSpanExporter()); }
private static void registerInternal(Handler newHandler) { synchronized (monitor) { handler = newHandler; register(Tracing.getExportComponent().getSpanExporter(), newHandler); } }
private static void registerInternal(Handler newHandler) { synchronized (monitor) { handler = newHandler; register(Tracing.getExportComponent().getSpanExporter(), newHandler); } }
/** * Creates and registers the Instana Trace exporter to the OpenCensus library. Only one Instana * exporter can be registered at any point. * * @param agentEndpoint Ex http://localhost:42699/com.instana.plugin.generic.trace * @throws MalformedURLException if the agentEndpoint is not a valid http url. * @throws IllegalStateException if a Instana exporter is already registered. * @since 0.12 */ public static void createAndRegister(String agentEndpoint) throws MalformedURLException { synchronized (monitor) { checkState(handler == null, "Instana exporter is already registered."); Handler newHandler = new InstanaExporterHandler(new URL(agentEndpoint)); handler = newHandler; register(Tracing.getExportComponent().getSpanExporter(), newHandler); } }
/** * Creates and registers the Jaeger Trace exporter to the OpenCensus library using the provided * HttpSender. Only one Jaeger exporter can be registered at any point. * * @param httpSender the pre-configured HttpSender to use with the exporter * @param serviceName the local service name of the process. * @throws IllegalStateException if a Jaeger exporter is already registered. * @since 0.17 */ public static void createWithSender(final HttpSender httpSender, final String serviceName) { synchronized (monitor) { checkState(handler == null, "Jaeger exporter is already registered."); final SpanExporter.Handler newHandler = newHandlerWithSender(httpSender, serviceName); JaegerTraceExporter.handler = newHandler; register(Tracing.getExportComponent().getSpanExporter(), newHandler); } }
@Test public void implementationOfSpanExporter() { assertThat(exportComponentWithInProcess.getSpanExporter()).isInstanceOf(SpanExporterImpl.class); }
@Test public void implementationOfSpanExporter() { assertThat(exportComponent.getSpanExporter()).isEqualTo(SpanExporter.getNoopSpanExporter()); }
@After public void teardown() { SpanExporter exporter = Tracing.getExportComponent().getSpanExporter(); exporter.unregisterHandler("testing"); }
@Before public void setup() { handler = new TestHandler(); SpanExporter exporter = Tracing.getExportComponent().getSpanExporter(); exporter.registerHandler("testing", handler); TraceParams params = Tracing.getTraceConfig() .getActiveTraceParams() .toBuilder() .setSampler(Samplers.alwaysSample()) .build(); Tracing.getTraceConfig().updateActiveTraceParams(params); }