-
Notifications
You must be signed in to change notification settings - Fork 848
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
Annotations support for non-auto instrumented code #3035
Comments
We've discussed writing an annotation processor that would enable this, but no one has had time to tackle that yet. If you're interested, I'd love to see a contribution of this! |
Can you pls let me know, Is there any references to implement the this? |
There are lots of examples of annotation processors out in the wild, but nothing specifically like this that I know of. Do you have any ideas of what approach you might take? I can see several options:
@jsuereth do you have any thoughts on how you'd approach this? You've mentioned that you have some experience with annotation processing. |
I dug a bit into this and I believe that @jkwatson listed all of the possibilities.
Looking at the alternatives in my opinion 2 - small agent implementing bytecode modifications for annotated methods looks as the best way. Introduces least friction, we have knowledge how to do it right and can reuse already implemented code. Let me know what you think. |
@jkwatson @kubawach @chandru-kumar what is the status of this issue? I'd like to contribute if possible. |
Would still love someone to try something out and show it off, so if you're interested, please do so. :) |
@jkwatson @kubawach I've started work on this and I think I need a tool to find methods (and classes) annotated with Do you recommend a library for scanning classes in order to find methods annotated with |
I don't have any recommendations here. How does spring do it, I wonder? |
Thanks for the hint with Spring - I'll check their code. Anyway, I can always use |
@jkwatson @kubawach @piotr-sumo I have created Method level Annotations(Runtime) to create and export traces. Used AspectJ features to make it. Here is the code demo link - https://github.com/chandru-kumar/opentelemetry-annotation-example. Please have a look and share your thoughts. Note : If anyone uses this Annotation, they need to include the aspectj maven plugin for build.. |
Hi @jkwatson ..Did you get a chance to look into this code? https://github.com/chandru-kumar/opentelemetry-annotation-example. Can you provide some inputs if you have any?? |
I took a quick peek. Curious why you used your own annotations, rather than the one in this project, but other than that it seemed like a fine approach. Is there a gradle equivalent to doing the aspectj work? |
I just see one Annotation WithSpan in the existing OpenTelemetry code. So created my own annotations to InjectSpanToContext create the span and adds to the existing context and makes it as current span. InjectChildSpanToContext - Adds span as child span and doesn't make it as current span. (Thinking to extend for passing Attributes, Events and Baggages, if find time) Looking for options to create gradle equivalent example..I'll update here once i create it.. |
Just a question - Do we have any example to create span for a method with Annotations.? I see @WithSpan in extension for auto instrumenting..But i dont see any annotations for adding spans in code.
Will we support for non-autoinstrumented solutions? If not, do we have any references to create custom annotations to create spans for methods using annotations.
The text was updated successfully, but these errors were encountered: