Skip to content

intrumentation-pg: do not infer query type in span name #2054

@Samuron

Description

@Samuron

Currently instumentation-pg tries to infer query type (SELECT/INSERT/UPDATE) from the sql text. This logic is not very robust as you can see on the screenshot. It just takes the first word of the query and adds it to span name. Even when operation is deduced successfully I personally do not find it very meaningful to have it in span name. When there are few queries it can provide some benefit by speeding up the navigation I find that most often I need to check each span with its attributes to find the one I am interested in.

So the proposal is to simplify the logic and generate the same span name for all the queries, like pg.query or something similar. With this instrumentation being one of the most used in our setup it may also provide the benefit of reducing allocations

For reference
#2029 (comment)

image

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