Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system.cpu.usage missing with OpenJ9 0.33.0 #3349

Closed
BingTang70 opened this issue Aug 10, 2022 · 1 comment
Closed

system.cpu.usage missing with OpenJ9 0.33.0 #3349

BingTang70 opened this issue Aug 10, 2022 · 1 comment
Labels
bug A general bug module: micrometer-core An issue that is related to our core module
Milestone

Comments

@BingTang70
Copy link

Hi,

There is a recently changes in OpenJ9 the method getSystemCpuLoad() removed from com.ibm.lang.management.OperatingSystemMXBean and inherited from com.sun.management.OperatingSystemMXBean
this cause the ProcessorMetrics.java stop working, which can not return the metric system.cpu.usage

The method detectMethod invoke getDeclaredMethod() it does not return the inherite methods , if change to getMethod will resolve this issue.

    @Nullable
    private Method detectMethod(String name) {
        requireNonNull(name);
        if (operatingSystemBeanClass == null) {
            return null;
        }
        try {
            // ensure the Bean we have is actually an instance of the interface
            operatingSystemBeanClass.cast(operatingSystemBean);
            return operatingSystemBeanClass.getDeclaredMethod(name);
        }
        catch (ClassCastException | NoSuchMethodException | SecurityException e) {
            return null;
        }
    }

Thanks

Bing

@BingTang70 BingTang70 changed the title The method getSystemCpuLoad() removed from OperatingSystemMXBean.java in v0.33.0 cause ProcessorMetrics does not return metric system.cpu.usage The method getSystemCpuLoad() removed from OpenJ9 OperatingSystemMXBean.java in v0.33.0 cause ProcessorMetrics does not return metric system.cpu.usage Aug 10, 2022
@shakuzen shakuzen added bug A general bug module: micrometer-core An issue that is related to our core module labels Aug 15, 2022
@shakuzen shakuzen added this to the 1.8.10 milestone Aug 15, 2022
@shakuzen shakuzen changed the title The method getSystemCpuLoad() removed from OpenJ9 OperatingSystemMXBean.java in v0.33.0 cause ProcessorMetrics does not return metric system.cpu.usage system.cpu.usage missing with OpenJ9 0.33.0 Aug 15, 2022
@shakuzen
Copy link
Member

Thanks for reporting the issue and sorry for the trouble. I don't think there was a good reason I used getDeclaredMethod instead of getMethod so we can fix that.
Linking to eclipse-openj9/openj9#15685

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A general bug module: micrometer-core An issue that is related to our core module
Projects
None yet
Development

No branches or pull requests

2 participants