Skip to content

AsyncPG Instrumentation Span Names are too long when using query string #1170

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

Closed
theelderbeever opened this issue Jun 28, 2022 · 2 comments · Fixed by #1324
Closed

AsyncPG Instrumentation Span Names are too long when using query string #1170

theelderbeever opened this issue Jun 28, 2022 · 2 comments · Fixed by #1324

Comments

@theelderbeever
Copy link

Is your feature request related to a problem?
Not a problem per se however, the asyncpg instrumentation uses sets span names as the query string which results in some very messing looking trace names in jaeger, datadog, etc and outright doesn't work with promscale due to long queries exhaust the available bytes for btree indexes.

Describe the solution you'd like

  • The ability to change the name of the span with a hook or something similar. The httpx instrumentation provides hooks that receive the span and the name can be updated there.
  • Just use a shorter or truncated version of the query as the name.

Which alternative solutions or features have you considered?
Not using the asyncpg instrumentation and manually instrumenting specific queries.

@krnr
Copy link
Contributor

krnr commented Sep 7, 2022

psycopg instrumentation uses only the first word of the statement. i think i can do the same with asyncpg.

@srikanthccv srikanthccv added help wanted Extra attention is needed instrumentation labels Sep 9, 2022
@srikanthccv
Copy link
Member

span name shouldn't be a high cardinal value such as a statement. feel free to send a patch.

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

Successfully merging a pull request may close this issue.

3 participants