Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mutianf committed Dec 21, 2021
1 parent 11c5204 commit 2355da2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 301 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ public Builder enableBuiltinMetrics() throws IOException {
.setProjectId(stubSettings.getProjectId())
.setMonitoredResource(
MonitoredResource.newBuilder().setType("bigtable_table").build())
.setMetricNamePrefix("bigtable.googleapis.com/client/")
.setMetricNamePrefix("bigtable.googleapis.com/internal/client/")
.setExportInterval(
com.google.bigtable.veneer.repackaged.io.opencensus.common.Duration.create(
10, 0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public class EnhancedBigtableStub implements AutoCloseable {
public static EnhancedBigtableStub create(EnhancedBigtableStubSettings settings)
throws IOException {
settings = finalizeSettings(settings, Tags.getTagger(), Stats.getStatsRecorder());

return new EnhancedBigtableStub(settings, ClientContext.create(settings));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
*
* <p>- Call {@link BigtableTracer#onRequest()} to record the request events in a stream.
*
* <p>- Get Bigtable zone and cluster information from response trailer and record in tracer.
*
* <p>This class is considered an internal implementation detail and not meant to be used by
* applications.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@
import javax.annotation.Nonnull;

/**
* This callable will inject a {@link GrpcResponseMetadata} to access the headers and trailers
* returned by gRPC methods upon completion. The {@link BigtableTracer} will process metrics that
* were injected in the header/trailer and publish them to OpenCensus. If {@link
* GrpcResponseMetadata#getMetadata()} returned null, it probably means that the request has never
* reached GFE, and it'll increment the gfe_header_missing_counter in this case.
* This callable will:
*
* <p>- Inject a {@link GrpcResponseMetadata} to access the headers and trailers returned by gRPC
* methods upon completion. The {@link BigtableTracer} will process metrics that were injected in
* the header/trailer and publish them to OpenCensus. If {@link GrpcResponseMetadata#getMetadata()}
* returned null, it probably means that the request has never reached GFE, and it'll increment the
* gfe_header_missing_counter in this case.
*
* <p>- Get Bigtable zone and cluster information from response trailer and record in tracer.
*
* <p>This class is considered an internal implementation detail and not meant to be used by
* applications.
Expand All @@ -49,7 +53,7 @@ public BigtableTracerUnaryCallable(@Nonnull UnaryCallable<RequestT, ResponseT> i

@Override
public ApiFuture futureCall(RequestT request, ApiCallContext context) {
// this should always be true
// tracer should always be an instance of BigtableTracer
if (context.getTracer() instanceof BigtableTracer) {
final GrpcResponseMetadata responseMetadata = new GrpcResponseMetadata();
final ApiCallContext contextWithResponseMetadata = responseMetadata.addHandlers(context);
Expand Down

0 comments on commit 2355da2

Please sign in to comment.