Replies: 1 comment 1 reply
-
For timing and SQL executed, you can override Database#log_connection_yield. This won't give you the table name unless you try parsing it out of the SQL, and not all SQL statements have table names. To get something akin to table names, you'd need to override at the Dataset layer. Dataset#fetch_rows is called for SELECTs, but there are other methods for other statement types. Note that that will only provide table names if the user was using the Dataset API to execute the queries (e.g. Someone was trying to contribute Sequel support to opentelemetry, but it stalled about a year ago: |
Beta Was this translation helpful? Give feedback.
-
Hello! What is the best place in code to grab the table name & sql statement to attach them into current thread of request & then inside connection pool to get query execution time?
It's just a thoughts, maybe there is more convenient option...
Actually I need to send Yabeda metrics about number of queries & their duration aka:
table_1#select - 12331
table_1#select - 20ms
P.S. I know about logging & caller_logging extension, and also there is no such open telemetry extension yet.
Beta Was this translation helpful? Give feedback.
All reactions