Open meiao opened 11 months ago
When a new connection is created, a query (not requested by the code) is executed. But for some reason, the doFinally
in the request wrapper is not being executed:
public static Flux<PostgresqlResult> wrapRequest(Flux<PostgresqlResult> request, ...) {
//...
Segment segment = transaction.startSegment("execute");
return request
.doOnSubscribe(reportExecution(sql, connectionConfiguration, segment))
.doFinally((type) -> segment.end());
}
This causes every transaction with a new connection to be held until the segment times out. Also since the segment was not ended, the whole time of the segment shows up in the transaction.
When a transaction uses a connection created outside of it, for instance as part of a connection pool, then this inaccuracy will not happen.
Description
When a connection is created, it makes some queries on which the instrumentation starts a segment but fails to end it.
This causes the transaction to last longer until the segment times out, making the time measurements inaccurate.
All versions of the instrumentation are affected by this.