I would like to know if there is a known way of keeping track of a transaction across a graph (monolith or supergraph - from the gateway to the database)?
I can be useful for auditing or debugging purpose to keep an historic of the transaction. (data sent, response given, subgrap used, database transaction… All would be referenced with the same Transaction ID)
I was thinking of something like creating a middleware on the gateway that will create a UUID and send it down to the subgraphs and send the data to my logging server (such as graphana) at every level(very bad for performance)
Or gathering the data from the subgraph somehow and once the response comes back to the gateway, i send the information at once.
The bad thing would be the performance that will be reduced.
Any other idea or existing solution?