Skip to content

Commit 72da963

Browse files
authored
Merge pull request #4 from stackify/SF-6621
SF-6621 - adding 'start' attribute to Trace annotation to support cus…
2 parents b482ab4 + 25f34c3 commit 72da963

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,24 @@ file (stackify-apm.json) to your application.
3737
name can be a `String` and can also include the variables `{{ClassName}}`, `{{MethodName}}` and `{{MethodParameters[#]}}`
3838
(where `#` is an `int` referencing the parameter index on the annotated method, index starts at 0).
3939

40+
#### Custom Trace Entry Point
41+
Stackify by default generates traces from web-requests on [supported application servers](http://support.stackify.com/hc/en-us/articles/209709913-What-Java-Application-Containers-and-Frameworks-are-Supported-)
42+
and non-web-requests from [supported frameworks](http://support.stackify.com/hc/en-us/articles/209709913-What-Java-Application-Containers-and-Frameworks-are-Supported-).
43+
You can extend support by using `@Trace(start = true)` on a method; which will start a new trace.
4044

4145
```
4246
import com.stackify.apm.Trace;
4347
4448
@Trace
4549
public class ClassToBeInstrumented
4650
{
51+
52+
@Trace(start = true)
53+
public void methodToStartNewTrace()
54+
{
55+
...
56+
}
57+
4758
@Trace
4859
public void methodToBeInstrumented()
4960
{
@@ -77,7 +88,7 @@ public class ClassToBeInstrumented
7788

7889
## License
7990

80-
Copyright 2016 Stackify, LLC.
91+
Copyright 2017 Stackify, LLC.
8192

8293
Licensed under the Apache License, Version 2.0 (the "License");
8394
you may not use this file except in compliance with the License.

src/main/java/com/stackify/apm/Trace.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Stackify
2+
* Copyright 2017 Stackify
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,6 +35,13 @@
3535
* {@literal @}Trace
3636
* public class ClassToBeInstrumented
3737
* {
38+
*
39+
* {@literal @}Trace(start = true)
40+
* public void methodToStartNewTrace()
41+
* {
42+
* ...
43+
* }
44+
*
3845
* {@literal @}Trace
3946
* public void methodToBeInstrumented()
4047
* {
@@ -90,9 +97,10 @@
9097
String trackedFunctionName() default "";
9198

9299
String category() default "Java";
93-
100+
94101
String subcategory() default "Other";
95-
102+
96103
boolean action() default false;
97-
104+
105+
boolean start() default false;
98106
}

0 commit comments

Comments
 (0)