From e369c6e6c2e4cbbdfeea50cc27a93ca616bcaf25 Mon Sep 17 00:00:00 2001 From: Mattie Fu Date: Fri, 5 Feb 2021 17:14:54 +0000 Subject: [PATCH] chore: move readme changes on stackdriver examples --- .readme-partials.yml | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.readme-partials.yml b/.readme-partials.yml index 3f62c8db5c..dd804349e4 100644 --- a/.readme-partials.yml +++ b/.readme-partials.yml @@ -115,7 +115,7 @@ custom_content: | TIP: If you are experiencing version conflicts with gRPC, see [Version Conflicts](#version-conflicts). - ## OpenCensus Tracing + ## Client request tracing: OpenCensus Tracing Cloud Bigtable client supports [OpenCensus Tracing](https://opencensus.io/tracing/), which gives insight into the client internals and aids in debugging production issues. @@ -171,6 +171,9 @@ custom_content: | .build()); ``` + You can view the traces on the Google Cloud Platform Console + [Trace](https://console.cloud.google.com/traces) page. + By default traces are [sampled](https://opencensus.io/tracing/sampling) at a rate of about 1/10,000. You can configure a higher rate by updating the active tracing params: @@ -185,7 +188,7 @@ custom_content: | ); ``` - ## OpenCensus Stats + ## Enabling Cloud Bigtable Metrics: OpenCensus Stats Cloud Bigtable client supports [Opencensus Metrics](https://opencensus.io/stats/), which gives insight into the client internals and aids in debugging production issues. @@ -288,6 +291,34 @@ custom_content: | BigtableDataSettings.enableGfeOpenCensusStats(); ``` + You can view the metrics on the Google Cloud Platform Console + [Metrics explorer](https://console.cloud.google.com/monitoring/metrics-explorer) + page. + + You can configure how frequently metrics are pushed to StackDriver and the + [Monitored resource type](https://cloud.google.com/monitoring/api/resources) by + updating `StackdriverStatsConfiguration`: + + ``` java + // Example: configuring export interval and monitored resource type + StackdriverStatsExporter.createAndRegister( + StackdriverStatsConfiguration.builder() + .setProjectId("YOUR_PROJECT_ID") + // Exporting metrics every 10 seconds + .setExportInterval(Duration.create(10, 0)) + // Configure monitored resource type. A common practice is to use the + // monitored resource objects that represent the physical resources + // where your application code is running. See the full list of + // monitored resource type here: + // https://cloud.google.com/monitoring/api/resources + .setMonitoredResource(MonitoredResource.newBuilder() + .setType("global") + .putLabels("project_id", "YOUR_PROJECT_ID") + .build()) + .build() + ); + ``` + ## Version Conflicts google-cloud-bigtable depends on gRPC directly which may conflict with the versions brought