chore: mark opencensus as deprecated (#2533) · googleapis/java-bigtable@832e8dc · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Commit 832e8dc

Browse files
chore: mark opencensus as deprecated (#2533)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigtable/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) - [ ] Rollback plan is reviewed and LGTMed - [ ] All new data plane features have a completed end to end testing plan Fixes #<issue_number_goes_here> ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).
1 parent 43c97a3 commit 832e8dc

File tree

3 files changed

+11
-85
lines changed

3 files changed

+11
-85
lines changed

.readme-partials.yml

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -149,82 +149,9 @@ custom_content: |
149149
[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)
150150
on how to set it up.
151151
152-
## Client request tracing: OpenCensus Tracing
153-
154-
Cloud Bigtable client supports [OpenCensus Tracing](https://opencensus.io/tracing/),
155-
which gives insight into the client internals and aids in debugging production issues.
156-
By default, the functionality is disabled. For example to enable tracing using
157-
[Google Stackdriver](https://cloud.google.com/trace/docs/):
158-
159-
[//]: # (TODO: figure out how to keep opencensus version in sync with pom.xml)
160-
161-
If you are using Maven, add this to your pom.xml file
162-
```xml
163-
<dependency>
164-
<groupId>io.opencensus</groupId>
165-
<artifactId>opencensus-impl</artifactId>
166-
<version>0.31.1</version>
167-
<scope>runtime</scope>
168-
</dependency>
169-
<dependency>
170-
<groupId>io.opencensus</groupId>
171-
<artifactId>opencensus-exporter-trace-stackdriver</artifactId>
172-
<version>0.31.1</version>
173-
<exclusions>
174-
<exclusion>
175-
<groupId>io.grpc</groupId>
176-
<artifactId>*</artifactId>
177-
</exclusion>
178-
<exclusion>
179-
<groupId>com.google.auth</groupId>
180-
<artifactId>*</artifactId>
181-
</exclusion>
182-
</exclusions>
183-
</dependency>
184-
```
185-
If you are using Gradle, add this to your dependencies
186-
```Groovy
187-
compile 'io.opencensus:opencensus-impl:0.24.0'
188-
compile 'io.opencensus:opencensus-exporter-trace-stackdriver:0.24.0'
189-
```
190-
If you are using SBT, add this to your dependencies
191-
```Scala
192-
libraryDependencies += "io.opencensus" % "opencensus-impl" % "0.24.0"
193-
libraryDependencies += "io.opencensus" % "opencensus-exporter-trace-stackdriver" % "0.24.0"
194-
```
195-
196-
At the start of your application configure the exporter:
197-
198-
```java
199-
import io.opencensus.exporter.trace.stackdriver.StackdriverTraceConfiguration;
200-
import io.opencensus.exporter.trace.stackdriver.StackdriverTraceExporter;
201-
202-
StackdriverTraceExporter.createAndRegister(
203-
StackdriverTraceConfiguration.builder()
204-
.setProjectId("YOUR_PROJECT_ID")
205-
.build());
206-
```
207-
208-
You can view the traces on the Google Cloud Platform Console
209-
[Trace](https://console.cloud.google.com/traces) page.
210-
211-
By default traces are [sampled](https://opencensus.io/tracing/sampling) at a rate of about 1/10,000.
212-
You can configure a higher rate by updating the active tracing params:
213-
214-
```java
215-
import io.opencensus.trace.Tracing;
216-
import io.opencensus.trace.samplers.Samplers;
217-
218-
Tracing.getTraceConfig().updateActiveTraceParams(
219-
Tracing.getTraceConfig().getActiveTraceParams().toBuilder()
220-
.setSampler(Samplers.probabilitySampler(0.01))
221-
.build()
222-
);
223-
```
224-
225152
### Disable Bigtbale traces
226153
227-
If your application already has OpenCensus Tracing integration and you want to disable Bigtable
154+
If your application already has tracing integration and you want to disable Bigtable
228155
traces, you can do the following:
229156
230157
```java

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ public static Builder newBuilderForEmulator(String hostname, int port) {
146146
}
147147

148148
/**
149+
* @deprecated OpenCensus support is deprecated and will be removed in a future version
149150
* Enables OpenCensus metric aggregations.
150151
*
151152
* <p>This will register Bigtable client relevant {@link io.opencensus.stats.View}s. When coupled
@@ -179,7 +180,7 @@ public static Builder newBuilderForEmulator(String hostname, int port) {
179180
* BigtableDataSettings.enableOpenCensusStats();
180181
* }</pre>
181182
*/
182-
@BetaApi("OpenCensus stats integration is currently unstable and may change in the future")
183+
@Deprecated
183184
public static void enableOpenCensusStats() {
184185
com.google.cloud.bigtable.data.v2.stub.metrics.RpcViews.registerBigtableClientViews();
185186
// TODO(igorbernstein): Enable grpc views once we upgrade to grpc-java 1.24.0
@@ -188,15 +189,14 @@ public static void enableOpenCensusStats() {
188189
}
189190

190191
/**
191-
* Enables OpenCensus GFE metric aggregations.
192-
*
193-
* <p>This will register views for gfe_latency and gfe_header_missing_count metrics.
194-
*
195-
* <p>gfe_latency measures the latency between Google's network receives an RPC and reads back the
196-
* first byte of the response. gfe_header_missing_count is a counter of the number of RPC
197-
* responses received without the server-timing header.
192+
* @deprecated OpenCensus support is deprecated and will be removed in a future version Enables
193+
* OpenCensus GFE metric aggregations.
194+
* <p>This will register views for gfe_latency and gfe_header_missing_count metrics.
195+
* <p>gfe_latency measures the latency between Google's network receives an RPC and reads back
196+
* the first byte of the response. gfe_header_missing_count is a counter of the number of RPC
197+
* responses received without the server-timing header.
198198
*/
199-
@BetaApi("OpenCensus stats integration is currently unstable and may change in the future")
199+
@Deprecated
200200
public static void enableGfeOpenCensusStats() {
201201
com.google.cloud.bigtable.data.v2.stub.metrics.RpcViews.registerBigtableClientGfeViews();
202202
}

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcViews.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
*/
1616
package com.google.cloud.bigtable.data.v2.stub.metrics;
1717

18-
import com.google.api.core.BetaApi;
1918
import com.google.common.annotations.VisibleForTesting;
2019
import com.google.common.collect.ImmutableSet;
2120
import io.opencensus.stats.Stats;
2221
import io.opencensus.stats.View;
2322
import io.opencensus.stats.ViewManager;
2423

25-
@BetaApi
24+
@Deprecated
2625
public class RpcViews {
2726
@VisibleForTesting
2827
private static final ImmutableSet<View> BIGTABLE_CLIENT_VIEWS_SET =

0 commit comments

Comments
 (0)

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.