forked from zokusai/openshift-cartridge-newrelic-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension-example.xml
125 lines (113 loc) · 4.38 KB
/
extension-example.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is an example of a custom instrumentation extension XML file. -->
<extension xmlns="https://newrelic.com/docs/java/xsd/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="newrelic-extension extension.xsd " name="extension-example"
version="1.0" enabled="true">
<instrumentation>
<!-- This point cut instruments some of the methods in the class com.sample.SampleArrayList. -->
<pointcut transactionStartPoint="true"
excludeFromTransactionTrace="false" ignoreTransaction="false">
<className>com.sample.SampleArrayList</className>
<!-- Instruments the method clear() -->
<method>
<name>clear</name>
<parameters />
<!-- The parameters node should be specified if there are no input parameters
and you only want to match clear(). Not specifying the parameters node will
match all methods named clear on the class regardless of the input parameters.
In other words it would match clear(int) clear(long) clear(int, long). -->
</method>
<!-- Instruments the method Object get(int index) -->
<method>
<name>get</name>
<parameters>
<!-- Primitives should written using their name: byte, short, int, long,
float, double, boolean, char -->
<type>int</type>
</parameters>
</method>
<!-- Instruments the method boolean addAll(int index, Collection c) -->
<method>
<name>addAll</name>
<parameters>
<!-- Make sure your parameters are listed in order. -->
<type>int</type>
<type>java.util.Collection</type>
</parameters>
</method>
</pointcut>
<!-- This point cut instruments some of the methods in the class com.sample.SampleString. -->
<pointcut transactionStartPoint="true">
<className>com.sample.SampleString</className>
<!-- Instruments the method boolean startsWith(String prefix) -->
<method>
<name>startsWith</name>
<parameters>
<type>java.lang.String</type>
</parameters>
</method>
<!-- Instruments the method String valueOf(char[] data, int offset, int
count) -->
<method>
<name>valueOf</name>
<parameters>
<!-- Be sure to use brackets for arrays. -->
<type>char[]</type>
<type>int</type>
<type>int</type>
</parameters>
</method>
</pointcut>
<!-- This point cut instruments all of the methods in the class com.sample.SampleString
that are named startsWith, ignoring the input parameters and return type. -->
<pointcut transactionStartPoint="true">
<className>com.sample.SampleString</className>
<method>
<name>startsWith</name>
</method>
</pointcut>
<!-- This point cut instruments the method startsWith in the class com.sample.SampleString.
By adding the <nameTransaction/> element, the class and method specified
in this pointcut will be used to name transactions which hit this pointcut.
Without this, the default convention is to name transctions with the class
and method from the transaction start point. -->
<pointcut transactionStartPoint="false">
<nameTransaction />
<className>com.sample.SampleString</className>
<!-- Instruments the method boolean startsWith(String prefix) -->
<method>
<name>startsWith</name>
<parameters>
<type>java.lang.String</type>
</parameters>
</method>
</pointcut>
<!-- This point cut instruments the method startsWith(String prefix) for
all implementations of the interface com.sample.SampleStringInterface. -->
<pointcut transactionStartPoint="true">
<interfaceName>com.sample.SampleStringInterface</interfaceName>
<!-- Instruments the method boolean startsWith(String prefix) -->
<method>
<name>startsWith</name>
<parameters>
<type>java.lang.String</type>
</parameters>
</method>
</pointcut>
<!-- This point cut instruments some of the methods in the class com.sample.SampleString
based on return type. -->
<pointcut transactionStartPoint="true">
<className>com.sample.SampleString</className>
<!-- Instruments all methods in the class whose return type is ResultSet -->
<method>
<returnType>com.example.ResultSet</returnType>
</method>
</pointcut>
<!-- This point cut instruments all of the methods which have the annotation
com.example.myAnnotation. -->
<pointcut transactionStartPoint="true">
<methodAnnotation>com.example.myAnnotation</methodAnnotation>
</pointcut>
</instrumentation>
</extension>