Info (info
)
info
端点提供有关应用程序的常规信息。
获取信息
要获取有关应用程序的信息,向 /actuator/info
发送 GET
请求,如下面的基于 curl 的示例所示:
$ curl 'http://localhost:8080/actuator/info' -i -X GET
响应结果类似于以下内容:
HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 1109
{
"git" : {
"branch" : "main",
"commit" : {
"id" : "df027cf",
"time" : "2025-05-25T10:02:41Z"
}
},
"build" : {
"artifact" : "application",
"version" : "1.0.3",
"group" : "com.example"
},
"os" : {
"name" : "Mac OS X",
"version" : "15.4.1",
"arch" : "aarch64"
},
"process" : {
"pid" : 78509,
"parentPid" : 69443,
"owner" : "zhaiyongchao",
"cpus" : 10,
"memory" : {
"heap" : {
"used" : 78643200,
"init" : 268435456,
"committed" : 140509184,
"max" : 1073741824
},
"nonHeap" : {
"used" : 100417528,
"init" : 7667712,
"committed" : 104202240,
"max" : -1
}
}
},
"java" : {
"version" : "21.0.7",
"vendor" : {
"name" : "Amazon.com Inc.",
"version" : "Corretto-21.0.7.6.1"
},
"runtime" : {
"name" : "OpenJDK Runtime Environment",
"version" : "21.0.7+6-LTS"
},
"jvm" : {
"name" : "OpenJDK 64-Bit Server VM",
"vendor" : "Amazon.com Inc.",
"version" : "21.0.7+6-LTS"
}
}
}
响应结构
响应包含有关应用程序的常规信息。
响应的每个部分都由 InfoContributor
提供。
Spring Boot 提供了几个贡献者,如下所述。
Build 响应结构
下表描述了响应中 build
部分的结构:
Path | Type | Description |
---|---|---|
|
|
Artifact ID of the application, if any. |
|
|
Group ID of the application, if any. |
|
|
Name of the application, if any. |
|
|
Version of the application, if any. |
|
|
Timestamp of when the application was built, if any. |
Git 响应结构
下表描述了响应中 git
部分的结构:
Path | Type | Description |
---|---|---|
|
|
Name of the Git branch, if any. |
|
|
Details of the Git commit, if any. |
|
|
Timestamp of the commit, if any. |
|
|
ID of the commit, if any. |
注意:这是"简单"输出。 贡献者也可以配置为输出所有可用数据。
OS 响应结构
下表描述了响应中 os
部分的结构:
Path | Type | Description |
---|---|---|
|
|
Name of the operating system (as obtained from the 'os.name' system property). |
|
|
Version of the operating system (as obtained from the 'os.version' system property). |
|
|
Architecture of the operating system (as obtained from the 'os.arch' system property). |
Process 响应结构
下表描述了响应中 process
部分的结构:
Path | Type | Description |
---|---|---|
|
|
Process ID. |
|
|
Parent Process ID (or -1). |
|
|
Process owner. |
|
|
Number of CPUs available to the process. |
|
|
Memory information. |
|
|
Heap memory. |
|
|
Number of bytes initially requested by the JVM. |
|
|
Number of bytes currently being used. |
|
|
Number of bytes committed for JVM use. |
|
|
Maximum number of bytes that can be used by the JVM (or -1). |
|
|
Non-heap memory. |
|
|
Number of bytes initially requested by the JVM. |
|
|
Number of bytes currently being used. |
|
|
Number of bytes committed for JVM use. |
|
|
Maximum number of bytes that can be used by the JVM (or -1). |
Java 响应结构
下表描述了响应中 java
部分的结构:
Path | Type | Description |
---|---|---|
|
|
Java version, if available. |
|
|
Vendor details. |
|
|
Vendor name, if available. |
|
|
Vendor version, if available. |
|
|
Runtime details. |
|
|
Runtime name, if available. |
|
|
Runtime version, if available. |
|
|
JVM details. |
|
|
JVM name, if available. |
|
|
JVM vendor, if available. |
|
|
JVM version, if available. |