Skip to content

Commit c2ace1a

Browse files
committed
session max duration
1 parent 57a552f commit c2ace1a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package io.opentelemetry.contrib.jmxscraper.target_systems;
77

8+
import static io.opentelemetry.contrib.jmxscraper.target_systems.MetricAssertions.assertGaugeWithAttributes;
89
import static io.opentelemetry.contrib.jmxscraper.target_systems.MetricAssertions.assertSumWithAttributes;
910

1011
import io.opentelemetry.contrib.jmxscraper.JmxScraperContainer;
@@ -63,6 +64,13 @@ protected void verifyMetrics() {
6364
"jetty.session.time.total",
6465
"The total time sessions have been active.",
6566
"s",
67+
attrs -> attrs.containsKey("resource")),
68+
metric ->
69+
assertGaugeWithAttributes(
70+
metric,
71+
"jetty.session.time.max",
72+
"The maximum amount of time a session has been active.",
73+
"s",
6674
attrs -> attrs.containsKey("resource")));
6775
}
6876
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ rules:
1717
type: counter
1818
unit: s
1919
desc: The total time sessions have been active.
20+
sessionTimeMax:
21+
metric: time.max
22+
# here a 'counter' metric type would suit better, but gauge reflects
23+
# how it's currently implemented in jetty.groovy
24+
type: gauge
25+
unit: s
26+
desc: The maximum amount of time a session has been active.

0 commit comments

Comments
 (0)