Class SpanExporter

java.lang.Object
io.opencensus.trace.export.SpanExporter
Direct Known Subclasses:
SpanExporter.NoopSpanExporter, SpanExporterImpl

@ThreadSafe public abstract class SpanExporter extends Object
A service that is used by the library to export SpanData for all the spans that are part of a distributed sampled trace (see TraceOptions.isSampled()).
Since:
0.5
  • Field Details

    • NOOP_SPAN_EXPORTER

      private static final SpanExporter NOOP_SPAN_EXPORTER
  • Constructor Details

    • SpanExporter

      public SpanExporter()
  • Method Details

    • getNoopSpanExporter

      public static SpanExporter getNoopSpanExporter()
      Returns the no-op implementation of the ExportComponent.
      Returns:
      the no-op implementation of the ExportComponent.
      Since:
      0.5
    • registerHandler

      public abstract void registerHandler(String name, SpanExporter.Handler handler)
      Registers a new service handler that is used by the library to export SpanData for sampled spans (see TraceOptions.isSampled()).
      Parameters:
      name - the name of the service handler. Must be unique for each service.
      handler - the service handler that is called for each ended sampled span.
      Since:
      0.5
    • unregisterHandler

      public abstract void unregisterHandler(String name)
      Unregisters the service handler with the provided name.
      Parameters:
      name - the name of the service handler that will be unregistered.
      Since:
      0.5