Re: POC: Extension for adding distributed tracing - pg_tracing

From: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>
To: Nikita Malakhov <hukutoc(at)gmail(dot)com>
Cc: Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: POC: Extension for adding distributed tracing - pg_tracing
Date: 2023-09-15 08:04:45
Message-ID: CAO6_Xqp8h38qRyN63=JwWaaL2M1OHA3q+FRHupTg05kkY_g0OA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
utility_stmt.png image/png 124.0 KB
pg-tracing-v6.patch application/octet-stream 180.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2023-09-15 08:13:10 Re: bug fix and documentation improvement about vacuumdb
Previous Message Jim Jones 2023-09-15 07:37:23 Re: [PATCH] Add inline comments to the pg_hba_file_rules view