-
Notifications
You must be signed in to change notification settings - Fork 7
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
Ability to add tracing options to auto-wired libraries #61
Comments
@ahmed-mez thoughts on this? |
That sounds like a reasonable feature to have. There's in my opinion some stuff regarding the API there that could use a little tweaking... Like to a certain extent you could envision the The implementation could have special behavior when |
I also just realized that if you add |
I like this suggestion, especially the fact that by having "special" tags, it implies "all-other" tags are just normal tags, and there is no need to prepend |
For the sake of simplicity, I think |
In search of being able to set the service name on the tracer of my
database/sql
client, it came to my attention that there is no current way to set the options through orchestrion. After digging a little deeper into the internals, I noticed the underlying tracer function (coming from gopkg.in/DataDog/dd-trace-go.v1/contrib/database/sql) is variadic, with the ability to pass 0 or many options, so it is pretty straightforward to add, if only there is a way to tell orchestrion what to add as options.Proposal
I would like to propose adding another "magic comment" in orchestrion called
//dd:options
that can be used directly above an instantiation of one of the supported auto-wire libs. It would be used like so,Doing so would generate the following code,
This proposal requires the
instrument.Open
function that currently accepts 2 params and is non-variadic to accept 2+ params with the last param being variadic and accept 0 or many options. This function is fordatabase/sql
, but the same general need applies to the other supported libs.Some other questions that should be discussed and answered,
I got a bit ahead of myself and put together a PR, but can change as necessary if the broader proposal is accepted.
The PR: #60
The text was updated successfully, but these errors were encountered: