opencensus-java icon indicating copy to clipboard operation
opencensus-java copied to clipboard

Consider providing Java annotations to automatically add tags or start a child span.

Open sebright2 opened this issue 7 years ago • 3 comments

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.

sebright2 avatar Jun 28 '18 19:06 sebright2

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?

savaki avatar Jul 12 '18 00:07 savaki

I submitted a PR to do this within the context of Spring, https://github.com/census-instrumentation/opencensus-java/pull/1314

savaki avatar Jul 16 '18 00:07 savaki

/cc @dinooliva

sebright2 avatar Jul 23 '18 18:07 sebright2