Class GcpManagedChannelOptions.GcpMetricsOptions.Builder (1.11.0)

public static class GcpManagedChannelOptions.GcpMetricsOptions.Builder

Inheritance

java.lang.Object > GcpManagedChannelOptions.GcpMetricsOptions.Builder

Constructors

Builder()

public Builder()

Constructor for GcpMetricsOptions.Builder.

Builder(GcpManagedChannelOptions.GcpMetricsOptions options)

public Builder(GcpManagedChannelOptions.GcpMetricsOptions options)
Parameter
Name Description
options GcpManagedChannelOptions.GcpMetricsOptions

Methods

build()

public GcpManagedChannelOptions.GcpMetricsOptions build()
Returns
Type Description
GcpManagedChannelOptions.GcpMetricsOptions

withLabels(List<LabelKey> labelKeys, List<LabelValue> labelValues)

public GcpManagedChannelOptions.GcpMetricsOptions.Builder withLabels(List<LabelKey> labelKeys, List<LabelValue> labelValues)

Sets label keys and values to report with the metrics. The size of keys and values lists must match. Otherwise the labels will not be applied.

Parameters
Name Description
labelKeys List<io.opencensus.metrics.LabelKey>

a list of LabelKey.

labelValues List<io.opencensus.metrics.LabelValue>

a list of LabelValue.

Returns
Type Description
GcpManagedChannelOptions.GcpMetricsOptions.Builder

withMetricRegistry(MetricRegistry registry)

public GcpManagedChannelOptions.GcpMetricsOptions.Builder withMetricRegistry(MetricRegistry registry)
Parameter
Name Description
registry io.opencensus.metrics.MetricRegistry
Returns
Type Description
GcpManagedChannelOptions.GcpMetricsOptions.Builder

withNamePrefix(String namePrefix)

public GcpManagedChannelOptions.GcpMetricsOptions.Builder withNamePrefix(String namePrefix)

Sets the prefix for all metric names reported by GcpManagedChannel.

Parameter
Name Description
namePrefix String

the prefix for metrics names.

Returns
Type Description
GcpManagedChannelOptions.GcpMetricsOptions.Builder

withOpenTelemetryMeter(Meter meter)

public GcpManagedChannelOptions.GcpMetricsOptions.Builder withOpenTelemetryMeter(Meter meter)

Sets the OpenTelemetry Meter to be used to emit metrics. If provided, metrics will be exported using OpenTelemetry APIs. If both MetricRegistry and Meter are null, metrics are disabled.

Parameter
Name Description
meter io.opentelemetry.api.metrics.Meter
Returns
Type Description
GcpManagedChannelOptions.GcpMetricsOptions.Builder

withOtelLabels(List<String> labelKeys, List<String> labelValues)

public GcpManagedChannelOptions.GcpMetricsOptions.Builder withOtelLabels(List<String> labelKeys, List<String> labelValues)

Sets label keys and values for OpenTelemetry metrics. The size of keys and values lists must match. These labels are applied to all OTel metrics emitted by the channel.

Parameters
Name Description
labelKeys List<String>
labelValues List<String>
Returns
Type Description
GcpManagedChannelOptions.GcpMetricsOptions.Builder