You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Invalid transaction names in OTEL Java agent when using Tapir + Akka Http #4343
When using Tapir + Akka Http, OTEL Java agent sets the wrong transaction names. Only request method is included without url template.
Plain Akka Http routes provides correct transaction names.
I'm not that familiar with OTEL Java Agent, probably it has some Akka-specific instrumentation code. To work with Tapir, it would need to have Tapir-specific instrumentation code.
Alternatively, we could try to generate Akka directives (in the tapir -> akka interpreter) which can be instrumented using the Java Agent, but for that, we would need details on how this instrumentation works
Hi @adamw I work with @Matzz, and we have been looking at this issue together. So it looks like the java agent computes the URI as part of this code. From what I can tell, tapir uses a more general mechanism to match the route (in FilterServerEndpoints?). Perhaps there could be an opportunity to use PatchMatcher when computing the path within PekkoServerRequest?
Thinking a bit more about this, I don't think we'll be able to use Akka/Pekko's mechanisms for path matching. Tapir uses a different approach, with path decoders that are defined as part of the inputs, and while translating this to path matchers would be in theory possible, it would be a lot of work. Probably much easier to add OTel/Tapir integration - e.g. through an interceptor (not "magical", just a simple interceptor), which would report the appropriate data when an endpoint is successfully decoded.
Activity
adamw commentedon Feb 19, 2025
I'm not that familiar with OTEL Java Agent, probably it has some Akka-specific instrumentation code. To work with Tapir, it would need to have Tapir-specific instrumentation code.
Alternatively, we could try to generate Akka directives (in the tapir -> akka interpreter) which can be instrumented using the Java Agent, but for that, we would need details on how this instrumentation works
masonedmison commentedon Feb 19, 2025
Hi @adamw I work with @Matzz, and we have been looking at this issue together. So it looks like the java agent computes the URI as part of this code. From what I can tell, tapir uses a more general mechanism to match the route (in
FilterServerEndpoints?). Perhaps there could be an opportunity to usePatchMatcherwhen computing the path within PekkoServerRequest?adamw commentedon Feb 20, 2025
Thinking a bit more about this, I don't think we'll be able to use Akka/Pekko's mechanisms for path matching. Tapir uses a different approach, with path decoders that are defined as part of the inputs, and while translating this to path matchers would be in theory possible, it would be a lot of work. Probably much easier to add OTel/Tapir integration - e.g. through an interceptor (not "magical", just a simple interceptor), which would report the appropriate data when an endpoint is successfully decoded.