vaadin / observability-kit

Other
5 stars 2 forks source link

refactor: instrument VaadinServlet for root span creation #125

Closed sissbruecker closed 1 year ago

sissbruecker commented 1 year ago

Description

Moves the root / server span creation from VaadinServiceInstrumentation to VaadinServletInstrumentation, and only creates a root span if it doesn't exist yet. This ensures that there is always only one server span, even when enabling the default servlet / application server instrumentations, and also ensures that there is a server span for Vaadin instrumentations that are outside of VaadinService.handleRequest calls, such as serving static files.

sissbruecker commented 1 year ago

I did experiment some more, and found a way to filter spans before they are passed to the exporter. That would be a more wholesome solution than disabling default instrumentations, and then trying to mirror their behavior. It would also make this PR pointless. Let's discuss how we want to proceed.