Skip to content

feat: Open telemetry implementation #2770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Prev Previous commit
Next Next commit
Update README.md
Co-authored-by: Knut Olav Løite <[email protected]>
  • Loading branch information
surbhigarg92 and olavloite committed Feb 8, 2024
commit 4a0acfb884a1beb2750c48b0cb2317129752ca1e
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ If you are using Maven, add this to your pom.xml file
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'io.opencensus:opencensus-impl:0.30.0'
compile 'io.opencensus:opencensus-exporter-stats-stackdriver:0.30.0'
compile 'io.opentelemetry:opentelemetry-sdk:{opentelemetry.version}'
compile 'io.opentelemetry:opentelemetry-sdk-metrics:{opentelemetry.version}'
compile 'io.opentelemetry:opentelemetry-exporter-oltp:{opentelemetry.version}'
```

By default, the functionality is disabled. You need to enable OpenTelemetry metrics and must configure the OpenTelemetry with appropriate exporters at the startup of your application:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1388,12 +1388,12 @@ public static void enableOpenCensusTraces() {
}
}

@ObsoleteApi(
"The OpenCensus project is deprecated. Use enableOpenTelemetryTraces to switch to OpenTelemetry traces")
/**
* Always resets the activeTracingFramework. This variable is used for internal testing, and is
* not a valid production scenario
*/
@ObsoleteApi(
"The OpenCensus project is deprecated. Use enableOpenTelemetryTraces to switch to OpenTelemetry traces")
static void resetActiveTracingFramework() {
activeTracingFramework = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@ public void testOpenCensusMetricsDisable() {
.setInitialWaitForSessionTimeoutMillis(50L)
.build();
FakeClock clock = new FakeClock();
clock.currentTimeMillis = System.currentTimeMillis();
clock.currentTimeMillis.set(System.currentTimeMillis());
FakeMetricRegistry metricRegistry = new FakeMetricRegistry();
List<LabelValue> labelValues =
Arrays.asList(
Expand Down Expand Up @@ -1905,7 +1905,7 @@ public void testOpenTelemetrySessionMetrics() throws Exception {
.setInitialWaitForSessionTimeoutMillis(50L)
.build();
FakeClock clock = new FakeClock();
clock.currentTimeMillis = System.currentTimeMillis();
clock.currentTimeMillis.set(System.currentTimeMillis());

InMemoryMetricReader inMemoryMetricReader = InMemoryMetricReader.create();
SdkMeterProvider sdkMeterProvider =
Expand Down