golang-migrate / migrate

Database migrations. CLI and Golang library.
Other
15.49k stars 1.41k forks source link

Missing context in WithInstance method #1159

Open maksim77 opened 2 months ago

maksim77 commented 2 months ago

Is your feature request related to a problem? Please describe. If the db.DB object is instrumented to work with Opentelemtry, the postgres.WithInstance method spawns a span (Ping method) learned from context.Background which is thus not bound to any trace.

Describe the solution you'd like It would probably be cool to have a method like WithInstanceContext or something similar that takes a context as an argument and uses it in particular in the Ping method call

joschi commented 1 month ago

Kind of related to https://github.com/golang-migrate/migrate/pull/1132.