Package com.google.cloud.grpc
Class GcpManagedChannelOptions.GcpMetricsOptions.Builder
java.lang.Object
com.google.cloud.grpc.GcpManagedChannelOptions.GcpMetricsOptions.Builder
- Enclosing class:
- GcpManagedChannelOptions.GcpMetricsOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()withLabels(List<io.opencensus.metrics.LabelKey> labelKeys, List<io.opencensus.metrics.LabelValue> labelValues) Sets label keys and values to report with the metrics.withMetricRegistry(io.opencensus.metrics.MetricRegistry registry) withNamePrefix(String namePrefix) Sets the prefix for all metric names reported by GcpManagedChannel.withOpenTelemetryMeter(io.opentelemetry.api.metrics.Meter meter) Sets the OpenTelemetryMeterto be used to emit metrics.withOtelLabels(List<String> labelKeys, List<String> labelValues) Sets label keys and values for OpenTelemetry metrics.
-
Constructor Details
-
Builder
public Builder()Constructor for GcpMetricsOptions.Builder. -
Builder
-
-
Method Details
-
build
-
withMetricRegistry
public GcpManagedChannelOptions.GcpMetricsOptions.Builder withMetricRegistry(io.opencensus.metrics.MetricRegistry registry) -
withLabels
public GcpManagedChannelOptions.GcpMetricsOptions.Builder withLabels(List<io.opencensus.metrics.LabelKey> labelKeys, List<io.opencensus.metrics.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:
labelKeys- a list ofLabelKey.labelValues- a list ofLabelValue.
-
withNamePrefix
Sets the prefix for all metric names reported by GcpManagedChannel.- Parameters:
namePrefix- the prefix for metrics names.
-
withOpenTelemetryMeter
public GcpManagedChannelOptions.GcpMetricsOptions.Builder withOpenTelemetryMeter(io.opentelemetry.api.metrics.Meter meter) Sets the OpenTelemetryMeterto be used to emit metrics. If provided, metrics will be exported using OpenTelemetry APIs. If both MetricRegistry and Meter are null, metrics are disabled. -
withOtelLabels
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.
-