@Traced annotation
See original GitHub issueI was wondering if it was ever discuss to have a @Traced
method-level annotation?
It would allow to easily start/stop a span around a method (using AOP). We could even capture the args and return value at some point.
Something like this:
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface Traced {
boolean withActiveSpanOnly() default true;
String component() default "java-traced-annotation";
String operationName() default "";
}
Apache SkyWalking offers this: https://github.com/apache/incubator-skywalking/blob/master/apm-application-toolkit/apm-toolkit-trace/src/main/java/org/apache/skywalking/apm/toolkit/trace/Trace.java
And it could be similar to the @Timed
annotation from DropWizard http://metrics.dropwizard.io/3.1.0/apidocs/com/codahale/metrics/annotation/Timed.html
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:18 (10 by maintainers)
Top Results From Across the Web
Traced (MicroProfile 2.0.1-SNAPSHOT API)
Annotation Type Traced ... This annotation allows fine-tuned control over which classes and methods create OpenTracing spans. By default, all JAX-RS methods ...
Read more >Java agent API: Instrument using annotation
Annotating a method with @Trace tells the Java agent that measurements should be taken for that method. To add a method call as...
Read more >Enabling explicit distributed tracing code instrumentation - IBM
Use the @Traced annotation to instrument classes and methods for OpenTracing. ... Apply the @Traced annotation to specify a class or method to...
Read more >Trace (newrelic-api 7.11.0 API)
If you annotate a method with the Trace annotation it will be automatically timed by the New Relic agent with the following measurements:....
Read more >Annotation - OpenCensus
Attributes, A set of attributes to articulate the annotate ... We'll add an annotation to a span in the excerpts with a couple...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am happy to review/merge if it’s not controversial.
I’m looking for the same feature. It would be nice to not mess with business logic code.