UnifiedMetrics
UnifiedMetrics copied to clipboard
Forge support
Notice Forge support is still under developing.
link to #40
Preview
Test on our FTB Stone Block3 server.
Something need to discuss
- Which forge version we should support? Now we are prepare to support 1.12 1.16 1.18, but we are not sure whether 1.19 can reuse 1.18's code. So it may add not less than 3 submodules @warmthdawn
- For compatibility, we downgrade gradle version and relocate more package. @exercisebook
- If we support many forge version, how the submodule naming.
Feel free to code review, we are trying to make it better.
Great work, thanks for the contribution!
For compatibility, we downgrade gradle version and relocate more package.If we support many forge version, how the submodule naming.
Are there no other workarounds? I would ideally like to stick to the latest version of Gradle.
If we support many forge version, how the submodule naming.
forge-{minor version}
, e.g. forge-18
, forge-19
I will be reviewing the code later on.
I recommend looking into https://github.com/architectury/architectury-loom instead of forgegradle. Forgegradle uses many Gradle internals, thus being incompatible with the latest version of Gradle.
I recommend looking into https://github.com/architectury/architectury-loom instead of forgegradle. Forgegradle uses many Gradle internals, thus being incompatible with the latest version of Gradle.
I think @warmthdawn had tried architectury-loom (if you look through this commit), but it didn't work, so he refactored the plugin to forgegradle so it could build successfully.
We will continue to experiment with architecture-loom in the hopes that it will work.
After migrating to loom, It can work on my server
But ping count and login count is wrong.
if we set shadowjar after remap, manifest will be overwrite. We can only set mixin cfg manually.
Is this PR ready for review? Are metric issues resolved yet?
yes, this pr ready now
@eaglesemanation If there is any problem when you try this branch, feel free to cantact me.
@ExerciseBook I'm not sure if I can actually build it, I'm not that familiar with minecraft mod development. Just really excited to get metrics on my forge server =) Maybe I'll have some time on Sunday.
Last quarter was tiring, finally got some time to test this. Looks like it's working, tested on Vault Hunters server.
I'm not sure why TPS and MSPT graphs work in overview, but don't work in server section. That's probably my misconfiguration, same thing happens to my PaperMC server
@eaglesemanation Here is my TPS and MSPT expression. Maybe we are different in the metrics query.
TPS
rate(minecraft_tick_duration_seconds_count{instance=~"^$instance$",exported_job=~"^$job$"}[$__interval])
MSPT
histogram_quantile(0.99, sum(rate(minecraft_tick_duration_seconds_bucket{instance=~"^$instance$",exported_job=~"^$job$"}[$__interval])) by (le))
histogram_quantile(0.95, sum(rate(minecraft_tick_duration_seconds_bucket{instance=~"^$instance$",exported_job=~"^$job$"}[$__interval])) by (le))
histogram_quantile(0.75, sum(rate(minecraft_tick_duration_seconds_bucket{instance=~"^$instance$",exported_job=~"^$job$"}[$__interval])) by (le))
histogram_quantile(0.50, sum(rate(minecraft_tick_duration_seconds_bucket{instance=~"^$instance$",exported_job=~"^$job$"}[$__interval])) by (le))
https://grafana.com/grafana/dashboards/18584-unifiedmetrics-0-3-x-prometheus/? I use this template.
Interesting, your queries did not work for me as well, but I found out the fix - replacing $__interval with $__rate_interval worked. I'm really new to Prometheus, so I have no clue if that's an actual fix, but at least it shows something =)
I've ran this in production for about a month now. 0 issues. Looks really good!
Hi @ExerciseBook ! I'm trying to use this, but I'm somewhat new to the Java ecosystem. I'm following the build guide in README.md . I'm running Forge 1.12.2 on Oracle JRE 1.8.0_251, so that's what I'm targeting.
- Is 1.12.2 supported? Should I specify any flags to build for 1.12.2 ?
- I'm getting this error:
An exception occurred applying plugin request [id: 'fabric-loom', version: '1.0.16']
> Failed to apply plugin 'fabric-loom'.
> You are using an outdated version of Java (8). Java 17 or higher is required.
I'm not sure that everything would be fine if I build on OpenJDK 17, and then run on Oracle JRE 1.8.0. I don't need fabric support (the one that requires 16+) - only Forge, so 1.8 should be fine, right? Is there a way to disable building parts I don't need?
@dark-penguin
You could try it. the build script I wrote is just a model after Dynmap's build script. so in my memory, it needs to be built on jdk17 and run on jdk8.
@ExerciseBook I've built it with openjdk-17-jdk on Debian Bookworm. I guess I should look for the output under platforms/
, but:
$ ls platforms
bukkit bungee fabric forge-1.18.2 minestom velocity
How do I specify Forge-1.12.2 ? Or could it be that 1.18.2 is the only one supported?
gradlew projects
returns:
Root project 'UnifiedMetrics' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-api' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-common' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-core' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-driver-influx' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-driver-prometheus' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-platform-bukkit' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-platform-bungee' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-platform-fabric' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-platform-forge-1.18.2' - Fully featured metrics collector agent for Minecraft servers.
+--- Project ':unifiedmetrics-platform-minestom' - Fully featured metrics collector agent for Minecraft servers.
\--- Project ':unifiedmetrics-platform-velocity' - Fully featured metrics collector agent for Minecraft servers.
@dark-penguin I am so sorry about my response. Because I did not use this plugin for a long time I forgot what I wrote before.
I look a glance on my code. Only the 1.18.2 is available. 1.12.2 is stuck on buildscript, I didn’t find a way to pack it up yet. So maybe you could try to workout it.
I am very appreciate that you could help me to solve this problem.
Normally, I would be happy to try, but as you can see, with Java I'm barely able to build something by following instructions. :slightly_smiling_face:
But just in case, what should I do to initiate an 1.12.2 build? Is it possible to build only that, without the other targets?
@dark-penguin
I am so sorry for my late response, I was busy yesterday.
In fact, I didn't successfully build 1.12.2 ever. So maybe you could try to find the way out.
I tried to compile this for 1.19.2 but I keep getting the error Failed to read /META-INF/versions/19/org/lwjgl/panama/Test.class
Does anyone know how to fix this ?