@@ -203,7 +203,7 @@ try {
203
203
204
204
TIP: If you are experiencing version conflicts with gRPC, see [ Version Conflicts] ( #version-conflicts ) .
205
205
206
- ## OpenCensus Tracing
206
+ ## Client request tracing: OpenCensus Tracing
207
207
208
208
Cloud Bigtable client supports [ OpenCensus Tracing] ( https://opencensus.io/tracing/ ) ,
209
209
which gives insight into the client internals and aids in debugging production issues.
@@ -258,6 +258,8 @@ StackdriverTraceExporter.createAndRegister(
258
258
.setProjectId(" YOUR_PROJECT_ID" )
259
259
.build());
260
260
```
261
+ You can view the traces on the Google Cloud Platform Console
262
+ [ Trace] ( https://console.cloud.google.com/traces ) page.
261
263
262
264
By default traces are [ sampled] ( https://opencensus.io/tracing/sampling ) at a rate of about 1/10,000.
263
265
You can configure a higher rate by updating the active tracing params:
@@ -273,7 +275,7 @@ Tracing.getTraceConfig().updateActiveTraceParams(
273
275
);
274
276
```
275
277
276
- ## OpenCensus Stats
278
+ ## Enabling Cloud Bigtable Metrics: OpenCensus Stats
277
279
278
280
Cloud Bigtable client supports [ Opencensus Metrics] ( https://opencensus.io/stats/ ) ,
279
281
which gives insight into the client internals and aids in debugging production issues.
@@ -376,6 +378,34 @@ BigtableDataSettings.enableOpenCensusStats();
376
378
BigtableDataSettings . enableGfeOpenCensusStats();
377
379
```
378
380
381
+ You can view the metrics on the Google Cloud Platform Console
382
+ [ Metrics explorer] ( https://console.cloud.google.com/monitoring/metrics-explorer )
383
+ page.
384
+
385
+ You can configure how frequently metrics are pushed to StackDriver and the
386
+ [ Monitored resource type] ( https://cloud.google.com/monitoring/api/resources ) by
387
+ updating ` StackdriverStatsConfiguration ` :
388
+
389
+ ``` java
390
+ // Example: configuring export interval and monitored resource type
391
+ StackdriverStatsExporter . createAndRegister(
392
+ StackdriverStatsConfiguration . builder()
393
+ .setProjectId(" YOUR_PROJECT_ID" )
394
+ // Exporting metrics every 10 seconds
395
+ .setExportInterval(Duration . create(10 , 0 ))
396
+ // Configure monitored resource type. A common practice is to use the
397
+ // monitored resource objects that represent the physical resources
398
+ // where your application code is running. See the full list of
399
+ // monitored resource type here:
400
+ // https://cloud.google.com/monitoring/api/resources
401
+ .setMonitoredResource(MonitoredResource . newBuilder()
402
+ .setType(" global" )
403
+ .putLabels(" project_id" , " YOUR_PROJECT_ID" )
404
+ .build())
405
+ .build()
406
+ );
407
+ ```
408
+
379
409
## Version Conflicts
380
410
381
411
google-cloud-bigtable depends on gRPC directly which may conflict with the versions brought
0 commit comments