Spring Cloud Gateway: Actuator API (actuator API)

The /gateway actuator endpoint allows you to monitor and interact with Spring Cloud Gateway applications. For remote access, this endpoint must be enabled in the application properties and exposed via HTTP or JMX. The following example shows how to configure:

application.yaml

management:
  endpoint:
    gateway:
      enabled: true # 默认值
  endpoints:
    web:
      exposure:
        include: gateway

In the above example, management.endpoint.gateway.enabled is set to true, which means the gateway endpoint is enabled. management.endpoints.web.exposure.include is set to gateway to ensure the gateway endpoint can be accessed remotely.

This configuration allows you to use the Actuator API to monitor and manage Spring Cloud Gateway applications. By accessing the /actuator/gateway endpoint, you can get information about routing, dynamically modify routing configuration, and other gateway-related information.

Note that this configuration is just an example, and you can customize it according to your actual needs. In practical applications, please configure the disclosure and protection of Actuator endpoints according to security and access requirements.

1.Verbose Actuator Format (detailed Actuator format)

A more detailed format has been added to Spring Cloud Gateway, making it possible to view on each route the assertions and filters associated with it and any configuration available. The following example configures the /actuator/gateway/routes endpoint:

[
  {
    "predicate": "(Hosts: [**.addrequestheader.org] &

Guess you like

Origin blog.csdn.net/qq_29901385/article/details/131340222