Skip to content

Commit eb6624b

Browse files
authored
remove duplication in tomcat JMX config (#12172)
1 parent 1ab2dbf commit eb6624b

File tree

1 file changed

+11
-70
lines changed
  • instrumentation/jmx-metrics/javaagent/src/main/resources/jmx/rules

1 file changed

+11
-70
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,11 @@
11
---
22
# For Tomcat, the default JMX domain is "Catalina:", however with some deployments like embedded in spring-boot
3-
# we can have the "Tomcat:" domain used, thus we have to duplicate metrics definitions as using a wildcard
4-
# would match too broadly
3+
# we can have the "Tomcat:" domain used, thus we use both MBean names for the metrics.
54

65
rules:
7-
- bean: Catalina:type=GlobalRequestProcessor,name=*
8-
unit: "1"
9-
prefix: http.server.tomcat.
10-
metricAttribute:
11-
name: param(name)
12-
mapping:
13-
errorCount:
14-
metric: errorCount
15-
type: gauge
16-
desc: The number of errors per second on all request processors
17-
requestCount:
18-
metric: requestCount
19-
type: gauge
20-
desc: The number of requests per second across all request processors
21-
maxTime:
22-
metric: maxTime
23-
type: gauge
24-
unit: ms
25-
desc: The longest request processing time
26-
processingTime:
27-
metric: processingTime
28-
type: counter
29-
unit: ms
30-
desc: Total time for processing all requests
31-
bytesReceived:
32-
metric: traffic
33-
type: counter
34-
unit: By
35-
desc: The number of bytes transmitted
36-
metricAttribute:
37-
direction: const(received)
38-
bytesSent:
39-
metric: traffic
40-
type: counter
41-
unit: By
42-
desc: The number of bytes transmitted
43-
metricAttribute:
44-
direction: const(sent)
45-
- bean: Tomcat:type=GlobalRequestProcessor,name=*
6+
- beans:
7+
- Catalina:type=GlobalRequestProcessor,name=*
8+
- Tomcat:type=GlobalRequestProcessor,name=*
469
unit: "1"
4710
prefix: http.server.tomcat.
4811
metricAttribute:
@@ -81,17 +44,9 @@ rules:
8144
metricAttribute:
8245
direction: const(sent)
8346

84-
- bean: Catalina:type=Manager,host=localhost,context=*
85-
unit: "1"
86-
prefix: http.server.tomcat.
87-
type: updowncounter
88-
metricAttribute:
89-
context: param(context)
90-
mapping:
91-
activeSessions:
92-
metric: sessions.activeSessions
93-
desc: The number of active sessions
94-
- bean: Tomcat:type=Manager,host=localhost,context=*
47+
- beans:
48+
- Catalina:type=Manager,host=localhost,context=*
49+
- Tomcat:type=Manager,host=localhost,context=*
9550
unit: "1"
9651
prefix: http.server.tomcat.
9752
type: updowncounter
@@ -102,24 +57,9 @@ rules:
10257
metric: sessions.activeSessions
10358
desc: The number of active sessions
10459

105-
- bean: Catalina:type=ThreadPool,name=*
106-
unit: "{threads}"
107-
prefix: http.server.tomcat.
108-
type: updowncounter
109-
metricAttribute:
110-
name: param(name)
111-
mapping:
112-
currentThreadCount:
113-
metric: threads
114-
desc: Thread Count of the Thread Pool
115-
metricAttribute:
116-
state: const(idle)
117-
currentThreadsBusy:
118-
metric: threads
119-
desc: Thread Count of the Thread Pool
120-
metricAttribute:
121-
state: const(busy)
122-
- bean: Tomcat:type=ThreadPool,name=*
60+
- beans:
61+
- Catalina:type=ThreadPool,name=*
62+
- Tomcat:type=ThreadPool,name=*
12363
unit: "{threads}"
12464
prefix: http.server.tomcat.
12565
type: updowncounter
@@ -136,3 +76,4 @@ rules:
13676
desc: Thread Count of the Thread Pool
13777
metricAttribute:
13878
state: const(busy)
79+

0 commit comments

Comments
 (0)