Class OtlpGrpcSpanExporter

  • All Implemented Interfaces:
    io.opentelemetry.sdk.trace.export.SpanExporter, Closeable, AutoCloseable

    @ThreadSafe
    public final class OtlpGrpcSpanExporter
    extends Object
    implements io.opentelemetry.sdk.trace.export.SpanExporter
    Exports spans using OTLP via gRPC, using OpenTelemetry's protobuf model.
    • Method Detail

      • export

        public io.opentelemetry.sdk.common.CompletableResultCode export​(Collection<io.opentelemetry.sdk.trace.data.SpanData> spans)
        Submits all the given spans in a single batch to the OpenTelemetry collector.
        Specified by:
        export in interface io.opentelemetry.sdk.trace.export.SpanExporter
        Parameters:
        spans - the list of sampled Spans to be exported.
        Returns:
        the result of the operation
      • flush

        public io.opentelemetry.sdk.common.CompletableResultCode flush()
        The OTLP exporter does not batch spans, so this method will immediately return with success.
        Specified by:
        flush in interface io.opentelemetry.sdk.trace.export.SpanExporter
        Returns:
        always Success
      • builder

        public static OtlpGrpcSpanExporterBuilder builder()
        Returns a new builder instance for this exporter.
        Returns:
        a new builder instance for this exporter.
      • getDefault

        public static OtlpGrpcSpanExporter getDefault()
        Returns a new OtlpGrpcSpanExporter reading the configuration values from the environment and from system properties. System properties override values defined in the environment. If a configuration value is missing, it uses the default value.
        Returns:
        a new OtlpGrpcSpanExporter instance.
      • shutdown

        public io.opentelemetry.sdk.common.CompletableResultCode shutdown()
        Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately cancelled.
        Specified by:
        shutdown in interface io.opentelemetry.sdk.trace.export.SpanExporter