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
We are using ProjectReactor and grpc, as well as using reactive drivers for postgres r2dbc-postgresql.
There are 3 microservices.
A grpc request is made from the pvi-adapter application, to the ed-server application, then a transaction is opened, some kind of business logic is executed, then a grpc call to the dicts server is made.
When you start the application for the first time and receive the first grpc request from pvi-adapter, all spans are appended in the correct sequence and to the correct trace.
But all subsequent requests received via grpc from pvi-adpater are also bound to the span that was formed at the first request.
To pass the span in the reactor, we use
Hooks.onEachOperator (TracedSubscriber.asOperator (tracer));
Hooks.onLastOperator (TracedSubscriber.asOperator (tracer));
as you have written about it https://github.com/opentracing-contrib/java-reactor
After a long debugging, I came to the conclusion that the problem is that the postgres r2dbc driver keeps the context passed through TracedSubscriber until the connection to the database is interrupted io.r2dbc.postgresql.client.ReactorNettyClient
The question is who faced such a problem and how to get around it? Now it turns out that using TracedSubscriber in a fully reactive environment with reactive drivers for postgres is not possible.
The text was updated successfully, but these errors were encountered:
The fact that the library uses the same first span sideways that the library's chain is not really part of the request handling chain in the way that is expected, otherwise the right context span would be used.
Perhaps there's an instrumentation for that specific library...?
Library is PostgreSQL R2DBC Driver https://github.com/pgjdbc/r2dbc-postgresql
Is it part of request handling chain? Is it possible to skip this library from tracing, then i use TracedSubscriber?
We are using ProjectReactor and grpc, as well as using reactive drivers for postgres r2dbc-postgresql.
There are 3 microservices.
A grpc request is made from the pvi-adapter application, to the ed-server application, then a transaction is opened, some kind of business logic is executed, then a grpc call to the dicts server is made.
When you start the application for the first time and receive the first grpc request from pvi-adapter, all spans are appended in the correct sequence and to the correct trace.
But all subsequent requests received via grpc from pvi-adpater are also bound to the span that was formed at the first request.
To pass the span in the reactor, we use
Hooks.onEachOperator (TracedSubscriber.asOperator (tracer));
Hooks.onLastOperator (TracedSubscriber.asOperator (tracer));
as you have written about it https://github.com/opentracing-contrib/java-reactor
To pass the span through grpc, we use
TracingServerInterceptor and TracingClientInterceptor from repository
https://github.com/opentracing-contrib/java-grpc
After a long debugging, I came to the conclusion that the problem is that the postgres r2dbc driver keeps the context passed through TracedSubscriber until the connection to the database is interrupted io.r2dbc.postgresql.client.ReactorNettyClient
https://github.com/pgjdbc/r2dbc-postgresql/blob/main/src/main/java/io/r2dbc/postgresql/client/ReactorNettyClient.java
The question is who faced such a problem and how to get around it? Now it turns out that using TracedSubscriber in a fully reactive environment with reactive drivers for postgres is not possible.
The text was updated successfully, but these errors were encountered: