Skip to content

Commit

Permalink
doc: improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mutianf committed Dec 5, 2024
1 parent caa622e commit 7b3adcc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.google.api.gax.rpc.StubSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.auth.Credentials;
import com.google.bigtable.v2.FeatureFlags;
import com.google.bigtable.v2.PingAndWarmRequest;
import com.google.cloud.bigtable.Version;
Expand All @@ -46,6 +47,8 @@
import com.google.cloud.bigtable.data.v2.models.Row;
import com.google.cloud.bigtable.data.v2.models.RowMutation;
import com.google.cloud.bigtable.data.v2.models.sql.Statement;
import com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsView;
import com.google.cloud.bigtable.data.v2.stub.metrics.CustomOpenTelemetryMetricsProvider;
import com.google.cloud.bigtable.data.v2.stub.metrics.DefaultMetricsProvider;
import com.google.cloud.bigtable.data.v2.stub.metrics.MetricsProvider;
import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptor;
Expand All @@ -55,6 +58,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -1035,6 +1039,10 @@ public MetricsProvider getMetricsProvider() {
/**
* Built-in client side metrics are published through Google Cloud Monitoring endpoint. This
* setting overrides the default endpoint for publishing the metrics.
*
* <p>Note that if you're using {@link CustomOpenTelemetryMetricsProvider}, you should call
* {@link BuiltinMetricsView#registerBuiltinMetrics(Credentials, SdkMeterProviderBuilder,
* String)} to set up the endpoint.
*/
public Builder setMetricsEndpoint(String endpoint) {
this.metricsEndpoint = endpoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
* .setInstanceId("my-instance-id")
* .setMetricsProvider(CustomOpenTelemetryMetricsProvider.create(openTelemetry)
* .build();
*
*
* To set up a different credential or endpoint, call
* {@link BuiltinMetricsView#registerBuiltinMetrics(Credentials, SdkMeterProviderBuilder, String)}
* }</pre>
*/
public final class CustomOpenTelemetryMetricsProvider implements MetricsProvider {
Expand Down

0 comments on commit 7b3adcc

Please sign in to comment.