UnifiedMetrics icon indicating copy to clipboard operation
UnifiedMetrics copied to clipboard

Forge support

Open ExerciseBook opened this issue 2 years ago • 20 comments

Notice Forge support is still under developing.

link to #40

Preview

Test on our FTB Stone Block3 server. image

Something need to discuss

  1. 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
  2. For compatibility, we downgrade gradle version and relocate more package. @exercisebook
  3. If we support many forge version, how the submodule naming.

Feel free to code review, we are trying to make it better.

ExerciseBook avatar Jan 06 '23 15:01 ExerciseBook

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.

Cubxity avatar Jan 06 '23 16:01 Cubxity

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.

Cubxity avatar Jan 06 '23 16:01 Cubxity

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.

nicognaW avatar Jan 07 '23 01:01 nicognaW

image

After migrating to loom, It can work on my server

But ping count and login count is wrong.

ExerciseBook avatar Mar 27 '23 14:03 ExerciseBook

if we set shadowjar after remap, manifest will be overwrite. We can only set mixin cfg manually.

ExerciseBook avatar Mar 28 '23 12:03 ExerciseBook

Is this PR ready for review? Are metric issues resolved yet?

Cubxity avatar Apr 06 '23 09:04 Cubxity

yes, this pr ready now image

image

ExerciseBook avatar Apr 06 '23 13:04 ExerciseBook

@eaglesemanation If there is any problem when you try this branch, feel free to cantact me.

ExerciseBook avatar Apr 15 '23 07:04 ExerciseBook

@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.

eaglesemanation avatar Apr 15 '23 07:04 eaglesemanation

Last quarter was tiring, finally got some time to test this. Looks like it's working, tested on Vault Hunters server. Screenshot from 2023-05-04 02-52-55 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 avatar May 04 '23 06:05 eaglesemanation

@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.

ExerciseBook avatar May 05 '23 07:05 ExerciseBook

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 =)

eaglesemanation avatar May 05 '23 08:05 eaglesemanation

I've ran this in production for about a month now. 0 issues. Looks really good!

mja00 avatar Jun 18 '23 17:06 mja00

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 avatar Jun 29 '24 12:06 dark-penguin

@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 avatar Jun 30 '24 03:06 ExerciseBook

@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 avatar Jun 30 '24 13:06 dark-penguin

@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.

ExerciseBook avatar Jul 01 '24 02:07 ExerciseBook

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 avatar Jul 01 '24 16:07 dark-penguin

@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.

ExerciseBook avatar Jul 03 '24 04:07 ExerciseBook

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 ?

iTrooz avatar Aug 15 '24 00:08 iTrooz