Re: POC: Extension for adding distributed tracing - pg_tracing

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: POC: Extension for adding distributed tracing - pg_tracing
Дата
Msg-id CAGRY4nzV1vK5C9jO5rD8Em5wgvENfiHj2YcGHDKC0xLdw5PgPA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: POC: Extension for adding distributed tracing - pg_tracing  (Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>)
Ответы Re: POC: Extension for adding distributed tracing - pg_tracing  (Nikita Malakhov <hukutoc@gmail.com>)
Список pgsql-hackers
Hi all

Just saw this thread.

I cooked up a PoC distributed tracing support in Pg years ago as part of the 2ndQuadrant BDR project.

I used GUCs to set the `opentelemtery_trace_id` and `opentelemetry_span_id`. These can be sent as protocol-level messages by the client driver if the client driver has native trace integration enabled, in which case the user doesn't need to see or care. And for other drivers, the application can use `SET` or `SET LOCAL` to assign them.

This approach avoids the need to rewrite SQL or give special meaning to SQL comments.

Within the server IIRC I used the existing postgres resource owner and memory context stacks to maintain some internal nested traces.

My implementation used the C++ opentelemetry client library to emit traces, so it was never going to be able to land in core. But IIRC the current BDR/PGD folks are now using an OpenTelemetry sidecar process instead. I think they send it UDP packets to emit metrics and events. Petr or Markus might be able to tell you more about how they're doing that.

I'd love to see OpenTelemetry integration in Pg.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: unconstify()/unvolatize() vs g++/clang++
Следующее
От: Greg Sabino Mullane
Дата:
Сообщение: Adding comments to help understand psql hidden queries