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

Add custom attributes to SQLCommenter comments in pg instrumentation #1353

Open
joelmukuthu opened this issue Jan 12, 2023 · 4 comments
Open

Comments

@joelmukuthu
Copy link

Is your feature request related to a problem? Please describe

Support for attaching SQLComment comments to SQL statements handled by the pg module was recently added in #1286. This issue proposes adding support for custom attributes to the SQL comments, besides tracestate and traceparent, which are now automatically generated by pg instrumentation (if the addSqlCommenterCommentToQueries config is enabled).

Examples of the custom attributes (as suggested by the spec) are action, controller, framework and route.

Describe the solution you'd like to see

As suggested in #1286 (comment), one approach would be to allow the instrumentation to extract the custom attributes from the active context when a query is run (perhaps controlled by another config option). With this approach, one question that comes to mind is whether or not the attributes should be changeable from span to span.

Describe alternatives you've considered

Not using pg instrumentation to handle SQLCommenter comments, and instead appending the comments myself, where I can add whichever attributes I'd like.

Additional context

I'm creating this issue to get some thoughts on:

  1. whether or not this makes sense for pg instrumentation
  2. if 1, what approach would be best for implementing this
  3. if 1 and 2, pointers on where to get started so I or someone else can get started on a PR
@github-actions
Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@joelmukuthu
Copy link
Author

Don't close.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Jun 12, 2023
@github-actions
Copy link
Contributor

This issue was closed because it has been stale for 14 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2023
@blumamir blumamir reopened this Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants