-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
(4.0.x) Enhance "/actuator/gateway" endpoint #3147
(4.0.x) Enhance "/actuator/gateway" endpoint #3147
Conversation
We shouldnt really need a separate PR for main, so I think we can close #3148 and just merge this one forward. |
@@ -88,6 +100,53 @@ public AbstractGatewayControllerEndpoint(RouteDefinitionLocator routeDefinitionL | |||
this.routeLocator = routeLocator; | |||
} | |||
|
|||
private List<GatewayEndpointInfo> getAvailableEndpointsForClass(String className) { | |||
try { | |||
MetadataReader metadataReader = new SimpleMetadataReaderFactory().getMetadataReader(className); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to instantiate SimpleMetadataReaderFactory
every time this method is called
@@ -61,6 +71,8 @@ public class AbstractGatewayControllerEndpoint implements ApplicationEventPublis | |||
|
|||
private static final Log log = LogFactory.getLog(GatewayControllerEndpoint.class); | |||
|
|||
private static final String ENDPOINT_PREFIX = "/actuator/gateway"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actuator endpoints won't necessarily be at /actuator
. What happens if they are configured to be at a different endpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testClient.get().uri("http://localhost:" + port + "/actuator/gateway").exchange().expectStatus().isOk() | ||
.expectBody(List.class).consumeWith(result -> { | ||
List<String> responseBody = result.getResponseBody(); | ||
assertThat(responseBody).isNotEmpty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to validate that we are getting all the endpoints we expect
Solves: #3128