Class OtlpGrpcSpanExporter.Builder

    • Nested Class Summary

      • Nested classes/interfaces inherited from class io.opentelemetry.sdk.common.export.ConfigBuilder

        io.opentelemetry.sdk.common.export.ConfigBuilder.NamingConvention
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      OtlpGrpcSpanExporter.Builder addHeader​(java.lang.String key, java.lang.String value)
      Add header to request.
      OtlpGrpcSpanExporter build()
      Constructs a new instance of the exporter based on the builder's values.
      protected OtlpGrpcSpanExporter.Builder fromConfigMap​(java.util.Map<java.lang.String,​java.lang.String> configMap, io.opentelemetry.sdk.common.export.ConfigBuilder.NamingConvention namingConvention)
      Sets the configuration values from the given configuration map for only the available keys.
      OtlpGrpcSpanExporter.Builder setChannel​(io.grpc.ManagedChannel channel)
      Sets the managed chanel to use when communicating with the backend.
      OtlpGrpcSpanExporter.Builder setDeadlineMs​(long deadlineMs)
      Sets the max waiting time for the collector to process each span batch.
      OtlpGrpcSpanExporter.Builder setEndpoint​(java.lang.String endpoint)
      Sets the OTLP endpoint to connect to.
      OtlpGrpcSpanExporter.Builder setUseTls​(boolean useTls)
      Sets use or not TLS, default is false.
      • Methods inherited from class io.opentelemetry.sdk.common.export.ConfigBuilder

        getBooleanProperty, getDoubleProperty, getIntProperty, getLongProperty, getStringProperty, readEnvironmentVariables, readProperties, readSystemProperties
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setChannel

        public OtlpGrpcSpanExporter.Builder setChannel​(io.grpc.ManagedChannel channel)
        Sets the managed chanel to use when communicating with the backend. Takes precedence over setEndpoint(String) if both are called.
        Parameters:
        channel - the channel to use
        Returns:
        this builder's instance
      • setDeadlineMs

        public OtlpGrpcSpanExporter.Builder setDeadlineMs​(long deadlineMs)
        Sets the max waiting time for the collector to process each span batch. Optional.
        Parameters:
        deadlineMs - the max waiting time
        Returns:
        this builder's instance
      • setEndpoint

        public OtlpGrpcSpanExporter.Builder setEndpoint​(java.lang.String endpoint)
        Sets the OTLP endpoint to connect to. Optional, defaults to "localhost:4317".
        Parameters:
        endpoint - endpoint to connect to
        Returns:
        this builder's instance
      • setUseTls

        public OtlpGrpcSpanExporter.Builder setUseTls​(boolean useTls)
        Sets use or not TLS, default is false. Optional. Applicable only if endpoint is set to build channel.
        Parameters:
        useTls - use TLS or not
        Returns:
        this builder's instance
      • addHeader

        public OtlpGrpcSpanExporter.Builder addHeader​(java.lang.String key,
                                                      java.lang.String value)
        Add header to request. Optional. Applicable only if endpoint is set to build channel.
        Parameters:
        key - header key
        value - header value
        Returns:
        this builder's instance
      • build

        public OtlpGrpcSpanExporter build()
        Constructs a new instance of the exporter based on the builder's values.
        Returns:
        a new exporter's instance
      • fromConfigMap

        protected OtlpGrpcSpanExporter.Builder fromConfigMap​(java.util.Map<java.lang.String,​java.lang.String> configMap,
                                                             io.opentelemetry.sdk.common.export.ConfigBuilder.NamingConvention namingConvention)
        Sets the configuration values from the given configuration map for only the available keys.
        Specified by:
        fromConfigMap in class io.opentelemetry.sdk.common.export.ConfigBuilder<OtlpGrpcSpanExporter.Builder>
        Parameters:
        configMap - Map holding the configuration values.
        Returns:
        this.