sladkoff/minecraft-prometheus-exporter

[Feature Request] Folia support

Netherwhal opened this issue · 8 comments

Would be great if Folia could be supported with this plugin.

Notes for further development:

As of right now the documentation on Folia Plugin development is rather limited and the whole subject is not quite stable. Let's keep this open for the near future.

I had a more in-depth look at this as it seems to be a requested topic.

Open questions and challenges for implementing Folia support

  • ⚒️ Metrics mc_entities_total, mc_villagers_total will need to be re-implemented to use the new RegionScheduler class. It is no longer possible to call World#getEntities from the main thread.
    • If we use the regionised scheduling, we can add the label region to the metric and the total entity counts can be aggregated by Prometheus/Grafana.
    • It should also be possible to use an event-based approach (see #226). Basically, we can subscribe to entity load/unload events and count entities that way.
  • ⚠️ Metrics mc_tps and mc_tick_duration_* will not be supported because there is no Folia API to get the TPS for a given region/thread (see PaperMC/Folia#31)
    • Edit: see comments below on how this could be implemented manually.
  • ⚒️ Any changes should be backward compatible with Paper/Spigot

You can get that information with thread-access in folia-dev. Look at spark implementation of Folia.

You can get that information with thread-access in folia-dev. Look at spark implementation of Folia.

I think I found the relevant commit. @PedroMPagani That's a nice source, thank you.

The current plan is to release a new version soon which will include rudimentary support for Folia - only a small set of metrics will be provided.

I will create additional tasks for making the Folia implementation more feature-complete.

@Netherwhal Rudimentary Folia support is now available in v3.0.0. Lots of metrics are still missing though, it will require some more work to get those to work.

The open tasks are tracked here:

thanks so much - this is great! I think TPS is most important now because with JMX also not showing TPS with Folia its currently not possible to measure that.