Interface GrpcSenderConfig


@Immutable public interface GrpcSenderConfig
Configuration for GrpcSender implementations, provided via GrpcSenderProvider.createSender(GrpcSenderConfig).
Since:
1.59.0
  • Method Details

    • getEndpoint

      URI getEndpoint()
      The gRPC endpoint to send to, including scheme. Omits path, which must be obtained from getFullMethodName().
    • getFullMethodName

      String getFullMethodName()
      The fully qualified gRPC method name, e.g. opentelemetry.proto.collector.trace.v1.TraceService/Export.
    • getCompressor

      @Nullable Compressor getCompressor()
      The compressor, or null if no compression is used. If present, Compressor.compress(OutputStream) must be applied to MessageWriter.writeMessage(OutputStream) when GrpcSender.send(MessageWriter, Consumer, Consumer) is called and Compressor.getEncoding() must be set as the grpc-encoding.
    • getTimeout

      Duration getTimeout()
      The max duration allowed to send a request, including resolving DNS, connecting, writing the request, reading the response, and any retries via getRetryPolicy().
    • getConnectTimeout

      Duration getConnectTimeout()
      The max duration allowed to connect to a target host.
    • getHeadersSupplier

      Supplier<Map<String,List<String>>> getHeadersSupplier()
      Additional headers that must be appended to every request. The resulting Supplier must be invoked for each request.
    • getRetryPolicy

      @Nullable RetryPolicy getRetryPolicy()
      The retry policy, or null if retry is disabled.
    • getSslContext

      @Nullable SSLContext getSslContext()
      The SSL context to use, or null if the system default is used. If non-null, getTrustManager() will also be non-null.
    • getTrustManager

      @Nullable X509TrustManager getTrustManager()
      The trust manager to use, or null if the system default is used. If non-null, getSslContext() will also be non-null.
    • getExecutorService

      @Nullable ExecutorService getExecutorService()
      The executor service used to execute any asynchronous processing, or null if the sender default executor service should be used.
    • getMaxResponseBodySize

      default long getMaxResponseBodySize()
      The maximum number of bytes to read from a response body. Defaults to 4 MiB.

      Warning: setting a high or unbounded limit allows a malicious or misconfigured server to cause unbounded heap allocation, potentially leading to out-of-memory errors.

      Since:
      1.61.0