Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metrics to SE quickstarts #7114

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ curl -X GET http://localhost:8080/greet/Jose
<value key="groupId">jakarta.json</value>
<value key="artifactId">jakarta.json-api</value>
</map>
<map order="999">
<value key="groupId">io.helidon.nima.observe</value>
<value key="artifactId">helidon-nima-observe-metrics</value>
</map>
<map order="999">
<value key="groupId">io.helidon.metrics</value>
<value key="artifactId">helidon-metrics</value>
</map>
</list>
<list key="Main-helidon-imports">
<value>io.helidon.health.checks.DeadlockHealthCheck</value>
Expand All @@ -76,7 +84,7 @@ curl -X GET http://localhost:8080/greet/Jose
<list key="Main-routing">
<value><![CDATA[
ObserveFeature observe = ObserveFeature.builder()
.useSystemServices(false)
.useSystemServices(true)
.addProvider(HealthObserveProvider.create(HealthFeature.builder()
.useSystemServices(false)
.addCheck(HeapMemoryHealthCheck.create())
Expand Down Expand Up @@ -121,6 +129,13 @@ curl -X GET http://localhost:8080/greet/Jose
assertThat(response.status(), is(Http.Status.NO_CONTENT_204));
}
}

@Test
void testMetricsObserver() {
try (Http1ClientResponse response = client.get("/observe/metrics").request()) {
assertThat(response.status(), is(Http.Status.OK_200));
}
}
]]></value>
</list>
</model>
Expand Down
8 changes: 8 additions & 0 deletions examples/quickstarts/helidon-quickstart-se/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
<groupId>io.helidon.nima.observe</groupId>
<artifactId>helidon-nima-observe-health</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.nima.observe</groupId>
<artifactId>helidon-nima-observe-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.metrics</groupId>
<artifactId>helidon-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.nima.openapi</groupId>
<artifactId>helidon-nima-openapi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,11 @@ void testDeadlockHealthCheck() {
assertThat(response.status(), is(Http.Status.NO_CONTENT_204));
}
}

@Test
void testMetricsObserver() {
try (Http1ClientResponse response = client.get("/observe/metrics").request()) {
assertThat(response.status(), is(Http.Status.OK_200));
}
}
}
8 changes: 8 additions & 0 deletions examples/quickstarts/helidon-standalone-quickstart-se/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@
<groupId>io.helidon.nima.observe</groupId>
<artifactId>helidon-nima-observe-health</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.nima.observe</groupId>
<artifactId>helidon-nima-observe-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.metrics</groupId>
<artifactId>helidon-metrics</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-yaml</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ void testHealthObserver() {
assertThat(response.status(), is(Http.Status.NO_CONTENT_204));
}
}

@Test
void testDeadlockHealthCheck() {
try (Http1ClientResponse response = client.get("/observe/health/live/deadlock").request()) {
assertThat(response.status(), is(Http.Status.NO_CONTENT_204));
}
}

@Test
void testMetricsObserver() {
try (Http1ClientResponse response = client.get("/observe/metrics").request()) {
assertThat(response.status(), is(Http.Status.OK_200));
}
}
}