Skip to content

Commit

Permalink
feat: Enable OpenTelemetry Trace exporter #120
Browse files Browse the repository at this point in the history
  • Loading branch information
astsiapanay committed Jan 8, 2024
1 parent 6be06e6 commit cddbf47
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/main/java/com/epam/aidial/core/AiDial.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
import com.google.common.annotations.VisibleForTesting;
import io.micrometer.registry.otlp.OtlpMeterRegistry;
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator;
import io.opentelemetry.context.propagation.ContextPropagators;
import io.opentelemetry.sdk.OpenTelemetrySdk;
import io.opentelemetry.sdk.trace.SdkTracerProvider;
import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk;
import io.vertx.config.spi.utils.JsonObjectHelper;
import io.vertx.core.Future;
import io.vertx.core.Vertx;
Expand Down Expand Up @@ -221,12 +218,7 @@ private static void setupMetrics(VertxOptions options) {
}

private static void setupTracing(VertxOptions vertxOptions) {
SdkTracerProvider sdkTracerProvider = SdkTracerProvider.builder().build();
OpenTelemetry openTelemetry = OpenTelemetrySdk.builder()
.setTracerProvider(sdkTracerProvider)
.setPropagators(ContextPropagators.create(W3CTraceContextPropagator.getInstance()))
.build();

OpenTelemetry openTelemetry = AutoConfiguredOpenTelemetrySdk.builder().build().getOpenTelemetrySdk();
vertxOptions.setTracingOptions(new OpenTelemetryOptions(openTelemetry));
}
}

0 comments on commit cddbf47

Please sign in to comment.