Skip to content

Commit 9378dcf

Browse files
committed
jetty threads
1 parent eacaeab commit 9378dcf

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/JettyIntegrationTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ protected void verifyMetrics() {
7474
"s",
7575
attrs -> attrs.containsKey("resource")),
7676
metric ->
77-
assertSum(metric, "jetty.select.count", "The number of select calls.", "{operations}"));
77+
assertSum(metric, "jetty.select.count", "The number of select calls.", "{operations}"),
78+
metric ->
79+
assertGaugeWithAttributes(
80+
metric,
81+
"jetty.thread.count",
82+
"The current number of threads.",
83+
"{threads}",
84+
attrs -> attrs.containsEntry("state", "busy"),
85+
attrs -> attrs.containsEntry("state", "idle")));
7886
}
7987
}

jmx-scraper/src/main/resources/jetty.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,18 @@ rules:
3232
type: gauge
3333
unit: s
3434
desc: The maximum amount of time a session has been active.
35+
36+
- bean: org.eclipse.jetty.util.thread:type=queuedthreadpool,id=*
37+
prefix: jetty.thread.
38+
unit: "{threads}"
39+
mapping:
40+
busyThreads:
41+
metric: count
42+
desc: The current number of threads.
43+
metricAttribute:
44+
state: const(busy)
45+
idleThreads:
46+
metric: count
47+
desc: The current number of threads.
48+
metricAttribute:
49+
state: const(idle)

0 commit comments

Comments
 (0)