Skip to content

JVM File Descriptor gauge reporting issue in Java 10 #100

@envybee

Description

@envybee

We started seeing these issues once we moved to Java 10:

ERROR o.c.metrics.datadog.DatadogReporter - Error reporting gauge metric (name: jvm.fd, tags: []) to Datadog, continuing reporting other metrics.\njava.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getOpenFileDescriptorCount() accessible: module jdk.management does not \"opens com.sun.management.internal\" to unnamed module @49ff7d8c\n\tat java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:337)\n\tat java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:281)\n\tat java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198)\n\tat java.base/java.lang.reflect.Method.setAccessible(Method.java:192)\n\tat com.codahale.metrics.jvm.FileDescriptorRatioGauge.invoke(FileDescriptorRatioGauge.java:48)\n\tat com.codahale.metrics.jvm.FileDescriptorRatioGauge.getRatio(FileDescriptorRatioGauge.java:35)\n\tat com.codahale.metrics.RatioGauge.getValue(RatioGauge.java:64)\n\tat com.codahale.metrics.RatioGauge.getValue(RatioGauge.java:11)\n\tat org.coursera.metrics.datadog.DatadogReporter.reportGauge(DatadogReporter.java:210)\n\tat org.coursera.metrics.datadog.DatadogReporter.report(DatadogReporter.java:90)\n\tat com.codahale.metrics.ScheduledReporter.report(ScheduledReporter.java:162)\n\tat com.codahale.metrics.ScheduledReporter$1.run(ScheduledReporter.java:117)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)\n\tat java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)\n\tat java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base/java.lang.Thread.run(Thread.java:844)

Is there a way this can be fixed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions