[OTel C++] Deprecate SetTargetAttributeFilter method on OpenTelemetryPluginBuilder (#36567)

Implements the change in https://github.com/grpc/proposal/pull/431 and documents the current working of the `SetTargetAttributeFilter` method on `OpenTelemetryPluginBuilder`

Closes #36567

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36567 from yashykt:DeprecateTargetAttributeFilter f3f2fef8cb
PiperOrigin-RevId: 633330427
pull/36599/head^2
Yash Tibrewal 11 months ago committed by Copybara-Service
parent 29f2dc1e08
commit 27b82ca0ef
  1. 24
      include/grpcpp/ext/otel_plugin.h

@ -88,11 +88,25 @@ class OpenTelemetryPluginBuilder {
/// If `SetMeterProvider()` is not called, no metrics are collected.
OpenTelemetryPluginBuilder& SetMeterProvider(
std::shared_ptr<opentelemetry::metrics::MeterProvider> meter_provider);
/// If set, \a target_attribute_filter is called per channel to decide whether
/// to record the target attribute on client or to replace it with "other".
/// This helps reduce the cardinality on metrics in cases where many channels
/// are created with different targets in the same binary (which might happen
/// for example, if the channel target string uses IP addresses directly).
/// DEPRECATED: If set, \a target_attribute_filter is called per channel to
/// decide whether to record the target attribute on client or to replace it
/// with "other". This helps reduce the cardinality on metrics in cases where
/// many channels are created with different targets in the same binary (which
/// might happen for example, if the channel target string uses IP addresses
/// directly).
/// This filtration only works for the per-call metrics -
/// grpc.client.attempt.started
/// grpc.client.attempt.duration
/// grpc.client.attempt.sent_total_compressed_message_size
/// grpc.client.attempt.rcvd_total_compressed_message_size
/// For example, the grpc.target attribute on pick first lb policy metrics
/// defined in
/// https://github.com/grpc/proposal/blob/master/A78-grpc-metrics-wrr-pf-xds.md
/// will not be filtered. Please contact the grpc team if this filtration is
/// of interest to you.
GRPC_DEPRECATED(
"Does not work as expected. Please raise an issue on "
"https://github.com/grpc/grpc if this would be of use to you.")
OpenTelemetryPluginBuilder& SetTargetAttributeFilter(
absl::AnyInvocable<bool(absl::string_view /*target*/) const>
target_attribute_filter);

Loading…
Cancel
Save