官术网_书友最值得收藏!

Exposing application information

In Spring Boot, Actuator also provides arbitrary application information by using the /info endpoint. If you make a GET request call to the /info endpoint, by default it will return empty JSON, {}.

The empty JSON means Spring Boot doesn't provide default information for your application. The /info endpoint provides any information for your Spring application that you want to expose to your client or the public. You can add any information about your application to this endpoint in application.properties or application.yml as follows:

application.properties

info.app.name=Spring Boot Actuator Application info.app.description=This is my first Working Spring Actuator Examples info.app.version=0.0.1-SNAPSHOT info.helpline.email=admin@dineshonjava.com info.helpline.phone=0120-000001100
application.yml
info: app: name: Spring Boot Actuator Application description: This is my first Working Spring Actuator Examples version: 0.0.1-SNAPSHOT helpline: email: admin@dineshonjava.com phone: 0120-000001100

In the preceding examples, you can see that we want to provide some information about our application such as application name, description, version, email, and helpline number in the /info endpoint response. Now let's request the /info endpoint; you'll get the following response:

{
  helpline:
 {
   email: "admin@dineshonjava.com",
   phone: "0120-00000110"
 },
 app:
 {
   description: "This is my first Working Spring Actuator Examples",
   version: "0.0.1-SNAPSHOT",
    name: "Spring Boot Actuator Application"
  }
} 

As shown, the Spring Boot Actuator /info endpoint exposes information about your application to the outside of your application. This information might be useful for callers.

Let's see in the next section how to kill your application using an Actuator's endpoint.

主站蜘蛛池模板: 乌兰察布市| 肇东市| 南投市| 柳州市| 城固县| 麟游县| 岐山县| 宁明县| 壤塘县| 会同县| 嫩江县| 拜城县| 平果县| 台前县| 宽甸| 奇台县| 云浮市| 海伦市| 阿图什市| 威海市| 哈尔滨市| 巍山| 汝南县| 南开区| 东源县| 奎屯市| 乌海市| 双牌县| 嘉义市| 达日县| 黔南| 聂荣县| 铜陵市| 富源县| 大港区| 台江县| 南投市| 松潘县| 百色市| 义乌市| 大丰市|