avast/datadog4s

Compatibility with Windows

nb-ceffa opened this issue · 2 comments

running datadog4s on windows returns this cast exception:

17:56:47.310 [zio-default-async-1-40688307] ERROR com.avast.skyring.common.zio.ZIOFailureReporter$ - Uncaught exception on thread zio-default-async-1-40688307
zio.FiberFailure: Fiber failed.
A checked error was not handled.
java.lang.ClassCastException: class com.sun.management.internal.OperatingSystemImpl cannot be cast to class com.sun.management.UnixOperatingSystemMXBean (com.sun.management.internal.OperatingSystemImpl and com.sun.management.UnixOperatingSystemMXBean are in module jdk.management of loader 'bootstrap')
	at com.avast.datadog4s.extension.jvm.JvmReporter.<init>(JvmReporter.scala:36)
	at com.avast.datadog4s.extension.jvm.JvmMonitoring$.$anonfun$configured$5(JvmMonitoring.scala:29)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at zio.internal.FiberContext.evaluateNow(FiberContext.scala:295)
	at zio.internal.FiberContext.$anonfun$fork$1(FiberContext.scala:595)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

So after some investigation - i havent find a way to enable these on windows. I assume you are using this only for development and run your app on linux. What i will do is disable these metrics on windows so that you don't get errors

can you pls try running tests on windows jvm from branch #71 ?