This InfoContributor exposes information about the process of the application through actuator's info endpoint as part of the Enhanced Observability effort: https://github.com/spring-projects/spring-boot/issues/25476

When configured, it looks like this:

"process": {
    "pid": 91379,
    "parentPid": 42323,
    "owner": "jonatan",
    "cpus": 16
}

The feature can be enabled by setting: management.info.process.enabled=true.

Next to the cpu I would also like to add memory (heap) information so that users can see what is the max heap size the jvm can use and what is the total heap size right now (can be interesting in a containerized environment just like the cpu count) but maybe in another PR since that can raise more questions/might need more feedback.

Also, there might be an issue with the current implementation. ProcessInfo assumes that pid, parentPid and owner will not change throughout the application lifecycle which is a fair assumption except if you do checkpoint and restore (crac).

Comment From: mhalbritter

Thanks Jonatan!