JMX Metrics for Regions #398

Open
opened 2025-09-24 04:44:46 +02:00 by whimxiqal · 0 comments
whimxiqal commented 2025-09-24 04:44:46 +02:00 (Migrated from github.com)

Paper allows for enabling JMX monitoring using the enable-jmx-monitoring flag. This is very helpful for setting up dashboards to externally view the performance of the server. However, in Folia, this has been disabled. These MBeans are still exposed, though, resulting in consistently empty or 0 values.

Describe the solution you'd like.

Since the existing metrics averageTickTime and tickTimes aren't helpful as global fields anymore, it would be neat to have data available for region information by editing net\minecraft\util\monitoring\jmx\MinecraftServerStatistics.java to include TabularData metrics, with a row for each region and columns for the region identifier, average tick rate, and also some other helpful things in folia-server\src\minecraft\java\io\papermc\paper\threadedregions\TickRegions$RegionStats like entityCount, playerCount, and chunkCount.

Describe alternatives you've considered.

Some plugins try to expose these things, but Folia's API currently doesn't support a lot of these types of metrics and since there's already some MBeans being exposed, I don't think it would be too messy to change what data the existing MBeans point to.

Other

No response

### Is your feature request related to a problem? Paper allows for enabling JMX monitoring using the [enable-jmx-monitoring](https://docs.papermc.io/paper/reference/server-properties/#enable_jmx_monitoring) flag. This is very helpful for setting up dashboards to externally view the performance of the server. However, in Folia, [this has been disabled](https://github.com/PaperMC/Folia/blob/7a1c5c7c7c86a0071654e03d7bf82120d113ef38/folia-server/minecraft-patches/features/0001-Region-Threading-Base.patch#L8724). These MBeans are still exposed, though, resulting in consistently empty or 0 values. ### Describe the solution you'd like. Since the existing metrics `averageTickTime` and `tickTimes` aren't helpful as global fields anymore, it would be neat to have data available for region information by editing `net\minecraft\util\monitoring\jmx\MinecraftServerStatistics.java` to include [`TabularData`](https://[docs.oracle.com/cd/E19698-01/816-7609/openmbean-4/index.html](https://docs.oracle.com/cd/E19698-01/816-7609/openmbean-4/index.html)) metrics, with a row for each region and columns for the region identifier, average tick rate, and also some other helpful things in `folia-server\src\minecraft\java\io\papermc\paper\threadedregions\TickRegions$RegionStats` like `entityCount`, `playerCount`, and `chunkCount`. ### Describe alternatives you've considered. Some plugins try to expose these things, but Folia's API currently doesn't support a lot of these types of metrics and since there's already some MBeans being exposed, I don't think it would be too messy to change what data the existing MBeans point to. ### Other _No response_
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Minecraft/Folia#398
No description provided.