The main point of this PR was to include the request trace_id (an UUID) in the request logs (eg. Started GET... or Completed 200 OK) and transaction logs (eg. Created transaction..., Executing SQL query ...). However, to make it feasible, some large-scale refactorings (not rewrites!) were necessary.
I suggest reviewing commit-by-commit.
"Create context.Context and trace_id in middleware layers" is the essence: it moves creating trace ID and context from goext to middleware
"Database interface refactoring" removes dependencies from db package to avoid dependency cycles and introduces functional options paradigm for easier transaction parametrization
"Log trace_id in middleware and transaction" introduces a new type tracingLogger and uses it it goext and transactions
"Simplify Transaction interface" is a follow up of commit 2. - it further simplifies the transaction interface - about half of all methods has been removed
"Exec should clear the cache" fixes bugs in cached_transaction - the cache was not cleared on Exec and new contexts were created instead of using a context passed by parameter
The main point of this PR was to include the request
trace_id
(an UUID) in the request logs (eg.Started GET...
orCompleted 200 OK
) and transaction logs (eg.Created transaction...
,Executing SQL query ...
). However, to make it feasible, some large-scale refactorings (not rewrites!) were necessary.I suggest reviewing commit-by-commit.
db
package to avoid dependency cycles and introduces functional options paradigm for easier transaction parametrizationtracingLogger
and uses it it goext and transactionstransaction
interface - about half of all methods has been removedcached_transaction
- the cache was not cleared on Exec and new contexts were created instead of using a context passed by parameter