-
Notifications
You must be signed in to change notification settings - Fork 226
Open
Labels
featureNew feature or requestNew feature or requestkeepEnsures stale-bot keeps this issue/PR openEnsures stale-bot keeps this issue/PR open
Description
When executing sql through ORM (e.g. active_record and sequel), I'd like to inject some comments (e.g. trace context) into sql query before hitting the sql database server.
The most important comment is the traceparent that is consisted of trace context information (i.e. 00-%<trace_id>s-%<span_id>s-%<trace_flags>.2d), which is for trace correlation.
# uninjected query
SELECT "posts".* FROM "posts"
# injected query
SELECT "posts".* FROM "posts" /*action='index',application='SqlcommenterRailsDemo',controller='posts',db_driver='ActiveRecord::ConnectionAdapters::SQLite3Adapter',framework='rails_v6.0.0.rc1',route='/posts',traceparent='00-828f28f7fb3df3dd07ee6478b2016b2a-a52cad0a8d1425ab-01'*/
# example from https://github.com/open-telemetry/opentelemetry-sqlcommenter/tree/main/ruby/sqlcommenter-ruby/sqlcommenter_rails_demo#get-postsMarginalia and sqlcommenter should handle the case if both marginalia and sqlcommenter is required from end user.
Will opentelemetry-ruby integrate the marginalia and sqlcommenter into the codebase in the future so that end user doesn't need to require in their side (as automatic as possible)?
I created the pr for opentelemtery integration with marginalia here (i.e. extension of marginalia).
fluffyf-x, renchap and ymtdzzz
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or requestkeepEnsures stale-bot keeps this issue/PR openEnsures stale-bot keeps this issue/PR open