Skip to content

Missing context in WithInstance method #1159

Open
@maksim77

Description

@maksim77

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions