Class GcpManagedChannelOptions.GcpMetricsOptions.Builder (1.11.0)
public static class GcpManagedChannelOptions.GcpMetricsOptions.Builder
Inheritance
java.lang.Object >
GcpManagedChannelOptions.GcpMetricsOptions.Builder
Constructors
Builder()
Constructor for GcpMetricsOptions.Builder.
Builder(GcpManagedChannelOptions.GcpMetricsOptions options)
public Builder(GcpManagedChannelOptions.GcpMetricsOptions options)
Methods
build()
public GcpManagedChannelOptions.GcpMetricsOptions build()
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.
|
withMetricRegistry(MetricRegistry registry)
public GcpManagedChannelOptions.GcpMetricsOptions.Builder withMetricRegistry(MetricRegistry registry)
| Parameter |
| Name |
Description |
registry |
io.opencensus.metrics.MetricRegistry
|
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.
|
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
|
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-06-19 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-19 UTC."],[],[]]