@@ -247,82 +247,9 @@ your OpenTelemetry instance. You can refer to
247
247
[ CustomOpenTelemetryMetricsProvider] ( https://github.com/googleapis/java-bigtable/blob/main/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CustomOpenTelemetryMetricsProvider.java )
248
248
on how to set it up.
249
249
250
- ## Client request tracing: OpenCensus Tracing
251
-
252
- Cloud Bigtable client supports [ OpenCensus Tracing] ( https://opencensus.io/tracing/ ) ,
253
- which gives insight into the client internals and aids in debugging production issues.
254
- By default, the functionality is disabled. For example to enable tracing using
255
- [ Google Stackdriver] ( https://cloud.google.com/trace/docs/ ) :
256
-
257
- [ // ] : # ( TODO: figure out how to keep opencensus version in sync with pom.xml )
258
-
259
- If you are using Maven, add this to your pom.xml file
260
- ``` xml
261
- <dependency >
262
- <groupId >io.opencensus</groupId >
263
- <artifactId >opencensus-impl</artifactId >
264
- <version >0.31.1</version >
265
- <scope >runtime</scope >
266
- </dependency >
267
- <dependency >
268
- <groupId >io.opencensus</groupId >
269
- <artifactId >opencensus-exporter-trace-stackdriver</artifactId >
270
- <version >0.31.1</version >
271
- <exclusions >
272
- <exclusion >
273
- <groupId >io.grpc</groupId >
274
- <artifactId >*</artifactId >
275
- </exclusion >
276
- <exclusion >
277
- <groupId >com.google.auth</groupId >
278
- <artifactId >*</artifactId >
279
- </exclusion >
280
- </exclusions >
281
- </dependency >
282
- ```
283
- If you are using Gradle, add this to your dependencies
284
- ``` Groovy
285
- compile 'io.opencensus:opencensus-impl:0.24.0'
286
- compile 'io.opencensus:opencensus-exporter-trace-stackdriver:0.24.0'
287
- ```
288
- If you are using SBT, add this to your dependencies
289
- ``` Scala
290
- libraryDependencies += " io.opencensus" % " opencensus-impl" % " 0.24.0"
291
- libraryDependencies += " io.opencensus" % " opencensus-exporter-trace-stackdriver" % " 0.24.0"
292
- ```
293
-
294
- At the start of your application configure the exporter:
295
-
296
- ``` java
297
- import io.opencensus.exporter.trace.stackdriver.StackdriverTraceConfiguration ;
298
- import io.opencensus.exporter.trace.stackdriver.StackdriverTraceExporter ;
299
-
300
- StackdriverTraceExporter . createAndRegister(
301
- StackdriverTraceConfiguration . builder()
302
- .setProjectId(" YOUR_PROJECT_ID" )
303
- .build());
304
- ```
305
-
306
- You can view the traces on the Google Cloud Platform Console
307
- [ Trace] ( https://console.cloud.google.com/traces ) page.
308
-
309
- By default traces are [ sampled] ( https://opencensus.io/tracing/sampling ) at a rate of about 1/10,000.
310
- You can configure a higher rate by updating the active tracing params:
311
-
312
- ``` java
313
- import io.opencensus.trace.Tracing ;
314
- import io.opencensus.trace.samplers.Samplers ;
315
-
316
- Tracing . getTraceConfig(). updateActiveTraceParams(
317
- Tracing . getTraceConfig(). getActiveTraceParams(). toBuilder()
318
- .setSampler(Samplers . probabilitySampler(0.01 ))
319
- .build()
320
- );
321
- ```
322
-
323
250
### Disable Bigtbale traces
324
251
325
- If your application already has OpenCensus Tracing integration and you want to disable Bigtable
252
+ If your application already has tracing integration and you want to disable Bigtable
326
253
traces, you can do the following:
327
254
328
255
``` java
0 commit comments