opentelemetry-java icon indicating copy to clipboard operation
opentelemetry-java copied to clipboard

Please do not deprecate OtlpGrpcMetricExporterBuilder#setChannel

Open aaron-ai opened this issue 2 years ago • 3 comments

As we can see, OtlpGrpcMetricExporterBuilder#setChannel has been marked as deprecated.

  /**
   * Sets the managed chanel to use when communicating with the backend. Takes precedence over
   * {@link #setEndpoint(String)} if both are called.
   *
   * @param channel the channel to use
   * @return this builder's instance
   * @deprecated Use {@link #setEndpoint(String)}. If you have a use case not satisfied by the
   *     methods on this builder, please file an issue to let us know what it is.
   */
  @Deprecated
  public OtlpGrpcMetricExporterBuilder setChannel(ManagedChannel channel) {
    delegate.setChannel(channel);
    return this;
  }

In our case, we have the need that put multiple ipv4/ipv6 addresses into one ManagedChannel rather than using domain name directly. To achieve this goal, we also customized the corresponding load balancing strategy in gRPC.

So I don't think OtlpGrpcMetricExporterBuilder#setEndpoint is universal enough.

aaron-ai avatar Jun 13 '22 14:06 aaron-ai

Hi @aaron-ai - currently load balancing is not supported by the OpenTelemetry specification. It seems like it could be a useful feature so you may want to file an issue in the repository.

https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md

Then we would add support with a similar API both for gRPC and HTTP exporters.

setChannel is a backdoor to a lot of different gRPC configurations / variables that we can't really provide support for, while also limiting our ability to iterate on the underlying implementation, so we'd like to remove it. We don't want to block useful features but think it should be in a way that is driven by the specification.

anuraaga avatar Jun 14 '22 00:06 anuraaga

Well, looking forward to the APIs of exporter load balancing.

aaron-ai avatar Jun 15 '22 05:06 aaron-ai