Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Samuron opened this issue Mar 27, 2024 · 1 comment
Open

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

Samuron opened this issue Mar 27, 2024 · 1 comment

Comments

@Samuron
Copy link
Contributor

Samuron commented Mar 27, 2024

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

@maryliag
Copy link
Contributor

maryliag commented Apr 3, 2024

So the proposal is to simplify the logic and generate the same span name for all the queries

I don't think that would be helpful, since this would now allow any type of filtering/search if they're all the same.
We can maybe use the beginning of the query (with a limit of amount of strings), that can be a little more helpful.

Another option would allow some sort of tag for queries, so users can add labels to the queries they care the most, making it easier to find them later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants