Skip to content

Commit 905ea68

Browse files
committed
simplify technical metric attributes
1 parent 141263b commit 905ea68

File tree

2 files changed

+30
-51
lines changed

2 files changed

+30
-51
lines changed

instrumentation/jmx-metrics/library/jetty.md

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,36 @@ The metrics captured and their respective attributes depend on the Jetty version
1010

1111
Those metrics require the following Jetty modules to be enabled : `jmx`, `http`, `statistics`, `sessions` and at least one of `ee8-deploy`, `ee9-deploy` or `ee10-deploy`.
1212

13-
| Metric Name | Type | Attributes | Description |
14-
|-------------------------|---------------|--------------------------------------------|-------------------------------------------|
15-
| jetty.thread.count | UpDownCounter | jetty.thread.pool.id, jetty.thread.context | The current number of threads |
16-
| jetty.thread.limit | UpDownCounter | jetty.thread.pool.id, jetty.thread.context | The maximum number of threads in the pool |
17-
| jetty.thread.busy.count | UpDownCounter | jetty.thread.pool.id, jetty.thread.context | The current number of busy threads |
18-
| jetty.thread.idle.count | UpDownCounter | jetty.thread.pool.id, jetty.thread.context | The current number of idle threads |
19-
| jetty.thread.queue.size | UpDownCounter | jetty.thread.pool.id, jetty.thread.context | The current job queue size |
20-
| jetty.io.select.count | Counter | jetty.selector.context, jetty.selector.id | The number of select calls |
21-
| jetty.session.count | UpDownCounter | jetty.context, jetty.session.cache.id | Current number of active sessions |
22-
| jetty.session.count.max | Gauge | jetty.context, jetty.session.cache.id | Maximum number of active sessions |
13+
| Metric Name | Type | Attributes | Description |
14+
|-------------------------|---------------|---------------|-------------------------------------------|
15+
| jetty.thread.count | UpDownCounter | | The current number of threads |
16+
| jetty.thread.limit | UpDownCounter | | The maximum number of threads in the pool |
17+
| jetty.thread.busy.count | UpDownCounter | | The current number of busy threads |
18+
| jetty.thread.idle.count | UpDownCounter | | The current number of idle threads |
19+
| jetty.thread.queue.size | UpDownCounter | | The current job queue size |
20+
| jetty.io.select.count | Counter | | The number of select calls |
21+
| jetty.session.count | UpDownCounter | jetty.context | Current number of active sessions |
22+
| jetty.session.count.max | Gauge | jetty.context | Maximum number of active sessions (*) |
2323

2424
- `jetty.context` corresponds to the deployed application subfolder in `webapps` folder.
25-
- `jetty.selector.context` is a technical string identifier, high cardinality with values like `HTTP_1_1@7674f035` but stable per Jetty process instance
26-
- `jetty.selector.id` is a technical numeric identifier, usually with low cardinality between `0` and `9`.
27-
- `jetty.session.cache.id` is a technical numeric identifier, usually single `0` value is used
28-
- `jetty.thread.context` is a technical string identifier, high cardinality with values like `Server@5a411614` but stable per Jetty process instance
29-
- `jetty.thread.pool.id` is a technical numeric identifier, usually single `0` value is used
25+
- `jetty.session.count.max` metric produces unpredictable values when more than one `org.eclipse.jetty.session:context=*,type=defaultsessioncache,id=*` MBean is present, the default Jetty deployment includes a single one.
3026

3127
## Jetty 9 to 11
3228

3329
Those metrics require the following Jetty modules to be enabled : `jmx`, `http` and `stats`.
3430

35-
| Metric Name | Type | Attributes | Description |
36-
|-----------------------------|---------------|-------------------------------------------|-------------------------------------------|
37-
| jetty.thread.count | UpDownCounter | jetty.thread.pool.id | The current number of threads |
38-
| jetty.thread.limit | UpDownCounter | jetty.thread.pool.id | The maximum number of threads in the pool |
39-
| jetty.thread.busy.count | UpDownCounter | jetty.thread.pool.id | The current number of busy threads |
40-
| jetty.thread.idle.count | UpDownCounter | jetty.thread.pool.id | The current number of idle threads |
41-
| jetty.thread.queue.size | UpDownCounter | jetty.thread.pool.id | The current job queue size |
42-
| jetty.io.select.count | Counter | jetty.selector.context, jetty.selector.id | The number of select calls |
43-
| jetty.session.created.count | Counter | jetty.context, jetty.session.handler.id | The total number of created sessions |
44-
| jetty.session.duration.sum | Gauge | jetty.context, jetty.session.handler.id | The cumulated session duration |
45-
| jetty.session.duration.max | Gauge | jetty.context, jetty.session.handler.id | The maximum session duration |
46-
| jetty.session.duration.mean | Gauge | jetty.context, jetty.session.handler.id | The mean session duration |
31+
| Metric Name | Type | Attributes | Description |
32+
|-----------------------------|---------------|---------------|-------------------------------------------|
33+
| jetty.thread.count | UpDownCounter | | The current number of threads |
34+
| jetty.thread.limit | UpDownCounter | | The maximum number of threads in the pool |
35+
| jetty.thread.busy.count | UpDownCounter | | The current number of busy threads |
36+
| jetty.thread.idle.count | UpDownCounter | | The current number of idle threads |
37+
| jetty.thread.queue.size | UpDownCounter | | The current job queue size |
38+
| jetty.io.select.count | Counter | | The number of select calls |
39+
| jetty.session.created.count | Counter | jetty.context | The total number of created sessions |
40+
| jetty.session.duration.sum | Gauge | jetty.context | The cumulated session duration |
41+
| jetty.session.duration.max | Gauge | jetty.context | The maximum session duration |
42+
| jetty.session.duration.mean | Gauge | jetty.context | The mean session duration |
4743

4844
- `jetty.context` corresponds to the deployed application subfolder in `webapps` folder.
49-
- `jetty.selector.context` is a technical string identifier, high cardinality with values like `HTTP_1_1@7674f035` but stable per Jetty process instance
50-
- `jetty.selector.id` is a technical numeric identifier, usually with low cardinality between `0` and `9`.
51-
- `jetty.session.cache.id` is a technical numeric identifier, usually single `0` value is used
52-
- `jetty.thread.pool.id` is a technical numeric identifier, usually single `0` value is used
53-
- `jetty.session.handler.id` is a technical numeric identifier, usually single `0` value is used
45+
- `jetty.session.duration.sum`, `jetty.session.duration.max`, `jetty.session.duration.mean` metrics will produce unpredictable results when more than one `org.eclipse.jetty.server.session:context=*,type=sessionhandler,id=*` MBean is present, the default Jetty deployment includes a single one.

instrumentation/jmx-metrics/library/src/main/resources/jmx/rules/jetty.yaml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@ rules:
33

44
# Thread metrics for Jetty 12 and later
55
- bean: org.eclipse.jetty.util.thread:context=*,type=queuedthreadpool,id=*
6+
# usually a single mbean instance exists, thus the metric is aggregated (sum for updowncounter)
67
prefix: jetty.thread.
78
unit: "{thread}"
89
type: updowncounter
9-
metricAttribute:
10-
# 'id' is a "technical ID" with a single '0' value by default
11-
jetty.thread.pool.id: param(id)
12-
# 'context' is a high cardinality value like 'Server@5a411614' but likely stable for the
13-
# duration of the jetty process lifecycle
14-
jetty.thread.context: param(context)
1510
mapping:
1611
# jetty.thread.count
1712
threads:
@@ -36,12 +31,10 @@ rules:
3631

3732
# Thread metrics for Jetty 9 to 11
3833
- bean: org.eclipse.jetty.util.thread:type=queuedthreadpool,id=*
34+
# usually a single mbean instance exists, thus the metric is aggregated (sum for updowncounter)
3935
prefix: jetty.thread.
4036
unit: "{thread}"
4137
type: updowncounter
42-
metricAttribute:
43-
# 'id' is a "technical ID" with a single '0' value by default
44-
jetty.thread.pool.id: param(id)
4538
mapping:
4639
# jetty.thread.count
4740
threads:
@@ -65,12 +58,6 @@ rules:
6558
desc: The current job queue size
6659

6760
- bean: org.eclipse.jetty.io:context=*,type=managedselector,id=*
68-
metricAttribute:
69-
# 'context' is a high cardinality value like 'HTTP_1_1@7674f035' but likely stable for the
70-
# duration of the jetty process lifecycle
71-
jetty.selector.context: param(context)
72-
# 'id' is a numerical value in [0,9] by default
73-
jetty.selector.id: param(id)
7461
mapping:
7562
# jetty.select.count
7663
selectCount:
@@ -81,13 +68,13 @@ rules:
8168

8269
# Session metrics for Jetty 12
8370
- bean: org.eclipse.jetty.session:context=*,type=defaultsessioncache,id=*
71+
# usually a single mbean instance exists per context, thus the metric is aggregated: sum for counter,
72+
# gauge metrics will return invalid (last-value) if more than one mbean instance exists.
8473
prefix: jetty.session.
8574
unit: "{session}"
8675
metricAttribute:
8776
# 'context' corresponds to the webapp context path
8877
jetty.context: param(context)
89-
# 'id' is a "technical ID" with a single '0' value by default
90-
jetty.session.cache.id: param(id)
9178
mapping:
9279
# jetty.session.count
9380
sessionsCurrent:
@@ -103,12 +90,12 @@ rules:
10390

10491
# Session metrics for Jetty 9 to 11
10592
- bean: org.eclipse.jetty.server.session:context=*,type=sessionhandler,id=*
93+
# usually a single mbean instance exists per context, thus the metric is aggregated: sum for counter,
94+
# gauge metrics will return invalid (last-value) if more than one mbean instance exists.
10695
prefix: jetty.session.
10796
metricAttribute:
10897
# 'context' corresponds to the webapp context path
10998
jetty.context: param(context)
110-
# 'id' is a "technical ID" with a single '0' value by default
111-
jetty.session.handler.id: param(id)
11299
mapping:
113100
# jetty.session.created.count
114101
sessionsCreated:

0 commit comments

Comments
 (0)