Hi!
Here's a new version with a good batch of changes.
Renaming/Refactoring:
- All spans are now tracked in the palloced current_trace_spans buffer
compared to top_span and parse_span being kept in a static variable
before.
- I've renamed query_spans to top_span. A top_span serves as the
parent for all spans in a specific nested level.
- More debugging information and assertions. Spans now track their
nested level, if they've been ended and if they are a top_span.
Changes:
- I've added the subxact_count to the span's metadata. This can help
identify the moment a subtransaction was started.
- I've reworked nested queries and utility statements. Previously, I
made the assumptions that we could only have one top_span per nested
level which is not the case. Some utility statements can execute
multiple queries in the same nested level. Tracing utility statement
now works better (see image of tracing a create extension).
Regards,
Anthonin