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

String

Artifact ID of the application, if any.

group

String

Group ID of the application, if any.

name

String

Name of the application, if any.

version

String

Version of the application, if any.

time

Varies

Timestamp of when the application was built, if any.

Git 响应结构

下表描述了响应中 git 部分的结构:

Path Type Description

branch

String

Name of the Git branch, if any.

commit

Object

Details of the Git commit, if any.

commit.time

Varies

Timestamp of the commit, if any.

commit.id

String

ID of the commit, if any.

注意:这是"简单"输出。 贡献者也可以配置为输出所有可用数据。

OS 响应结构

下表描述了响应中 os 部分的结构:

Path Type Description

name

String

Name of the operating system (as obtained from the 'os.name' system property).

version

String

Version of the operating system (as obtained from the 'os.version' system property).

arch

String

Architecture of the operating system (as obtained from the 'os.arch' system property).

Process 响应结构

下表描述了响应中 process 部分的结构:

Path Type Description

pid

Number

Process ID.

parentPid

Number

Parent Process ID (or -1).

owner

String

Process owner.

cpus

Number

Number of CPUs available to the process.

memory

Object

Memory information.

memory.heap

Object

Heap memory.

memory.heap.init

Number

Number of bytes initially requested by the JVM.

memory.heap.used

Number

Number of bytes currently being used.

memory.heap.committed

Number

Number of bytes committed for JVM use.

memory.heap.max

Number

Maximum number of bytes that can be used by the JVM (or -1).

memory.nonHeap

Object

Non-heap memory.

memory.nonHeap.init

Number

Number of bytes initially requested by the JVM.

memory.nonHeap.used

Number

Number of bytes currently being used.

memory.nonHeap.committed

Number

Number of bytes committed for JVM use.

memory.nonHeap.max

Number

Maximum number of bytes that can be used by the JVM (or -1).

Java 响应结构

下表描述了响应中 java 部分的结构:

Path Type Description

version

String

Java version, if available.

vendor

Object

Vendor details.

vendor.name

String

Vendor name, if available.

vendor.version

String

Vendor version, if available.

runtime

Object

Runtime details.

runtime.name

String

Runtime name, if available.

runtime.version

String

Runtime version, if available.

jvm

Object

JVM details.

jvm.name

String

JVM name, if available.

jvm.vendor

String

JVM vendor, if available.

jvm.version

String

JVM version, if available.