Consider providing Java annotations to automatically add tags or start a child span.
Several people have mentioned this idea, so I wanted to open an issue. We could provide method-level Java annotations to conveniently modify the current context when a method is called. The annotations probably couldn't be as powerful as the existing API, but they could be easier to use in some situations.
We could at least cover these use cases:
- Add one or more literal tags to the current context.
- Start a child span with a literal name.
What would be responsible for reading the annotation? Would this be a general purpose solution or something that's specific to a specific framework e.g. Spring?
I submitted a PR to do this within the context of Spring, https://github.com/census-instrumentation/opencensus-java/pull/1314
/cc @dinooliva