vaadin / observability-kit

Other
5 stars 2 forks source link

Propagate frontend traces #165

Closed MatthewVaadin closed 1 year ago

MatthewVaadin commented 1 year ago

This adds a meta tag into each page to propagate the server trace ID to the frontend.

There is also an attempt at using the configured OpenTelemetry exporter to send the frontend traces to the observability platform. This currently gives the following error:

java.lang.NoSuchMethodError: 'io.opentelemetry.sdk.trace.data.EventData io.opentelemetry.sdk.trace.data.EventData.create(long, java.lang.String, io.opentelemetry.javaagent.shaded.io.opentelemetry.api.common.Attributes)'
    at com.vaadin.extension.instrumentation.client.JsonNodeSpanWrapper.<init>(JsonNodeSpanWrapper.java:104) ~[na:na]
    at com.vaadin.extension.instrumentation.client.SpanExporterWrapper.export(SpanExporterWrapper.java:32) ~[na:na]
    at com.vaadin.observability.ObservabilityHandler.handleTraces(ObservabilityHandler.java:118) ~[observability-kit-starter-2.0-SNAPSHOT.jar:na]
MatthewVaadin commented 1 year ago

@MatthewVaadin Do you plan to move the span consumer into the Advice, instead of injecting it into the ObservabilityHandler? This should also allow us to remove the opentelemetry-sdk dependency from the starter

The serviceInit method in ObservabilityServiceInitListener also depends on opentelemetry-sdk, so I'm not sure we can remove it.

mcollovati commented 1 year ago

The serviceInit method in ObservabilityServiceInitListener also depends on opentelemetry-sdk, so I'm not sure we can remove it.

Good point. I missed it