[FEATURE] improve tracing #84

Open
opened 2024-10-10 22:49:10 +03:00 by vtolstov · 0 comments
Owner

https://www.gabriel-koch.dev/posts/observability/postgresql-tracing/

  1. add traceparent at the end of query /traceparent='00-866e8698eac009878483cfd029f62af9-bb14062982c63db3-01'/
  2. query from the pg_stat_statements view or log_statement = 'all' creates log entries for each SQL command sent to the server, including the duration
  3. with the auto_explain module we can automatically log query plans. To reduce the amount of log entries generated, we have the options to only log the query plan for slow queries or to enable sampling
shared_preload_libraries = 'auto_explain'
auto_explain.log_min_duration = 0 # e.g. 10ms
auto_explain.log_format = 'json'
auto_explain.log_analyze = true
auto_explain.log_buffers = true
  1. pgtraceconnector - https://github.com/elessar-ch/pgtraceconnector/tree/main
https://www.gabriel-koch.dev/posts/observability/postgresql-tracing/ 1) add traceparent at the end of query /*traceparent='00-866e8698eac009878483cfd029f62af9-bb14062982c63db3-01'*/ 2) query from the pg_stat_statements view or log_statement = 'all' creates log entries for each SQL command sent to the server, including the duration 3) with the auto_explain module we can automatically log query plans. To reduce the amount of log entries generated, we have the options to only log the query plan for slow queries or to enable sampling ``` shared_preload_libraries = 'auto_explain' auto_explain.log_min_duration = 0 # e.g. 10ms auto_explain.log_format = 'json' auto_explain.log_analyze = true auto_explain.log_buffers = true ``` 4) pgtraceconnector - https://github.com/elessar-ch/pgtraceconnector/tree/main
vtolstov self-assigned this 2024-10-10 22:49:30 +03:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: unistack-org/micro-wrapper-sql#84
No description provided.