Skip to content

Commit

Permalink
Add telemetry to HttpEventListener
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed Dec 5, 2024
1 parent 9dfafec commit 7b026b3
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import com.google.inject.Scopes;
import io.airlift.bootstrap.Bootstrap;
import io.airlift.json.JsonModule;
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.trace.Tracer;
import io.trino.spi.eventlistener.EventListener;
import io.trino.spi.eventlistener.EventListenerFactory;
import io.trino.spi.eventlistener.QueryCompletedEvent;
Expand Down Expand Up @@ -43,6 +45,8 @@ public EventListener create(Map<String, String> config, EventListenerContext con
Bootstrap app = new Bootstrap(
new JsonModule(),
binder -> {
binder.bind(OpenTelemetry.class).toInstance(context.getOpenTelemetry());
binder.bind(Tracer.class).toInstance(context.getTracer());
jsonCodecBinder(binder).bindJsonCodec(QueryCompletedEvent.class);
jsonCodecBinder(binder).bindJsonCodec(QueryCreatedEvent.class);
jsonCodecBinder(binder).bindJsonCodec(SplitCompletedEvent.class);
Expand Down

0 comments on commit 7b026b3

Please sign in to comment.