{"record":{"id":"4d9327ae68364611","repo":"pinpoint-apm/pinpoint","slug":"unknown-cpuloadmetric","errorCode":null,"errorMessage":"Unknown CpuLoadMetric : {}","messagePattern":"Unknown CpuLoadMetric : (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/stat/cpu/CpuLoadMetricProvider.java","lineNumber":85,"sourceCode":"\n        if (jvmType == JvmType.IBM) {\n            return IBM_CPU_LOAD_METRIC;\n        }\n        return null;\n    }\n\n    private CpuLoadMetric createCpuLoadMetric(String classToLoad) {\n        if (classToLoad == null) {\n            return CpuLoadMetric.UNSUPPORTED_CPU_LOAD_METRIC;\n        }\n        try {\n            @SuppressWarnings(\"unchecked\")\n            Class<CpuLoadMetric> cpuLoadMetricClass = (Class<CpuLoadMetric>) Class.forName(classToLoad);\n            try {\n                Constructor<CpuLoadMetric> cpuLoadMetricConstructor = cpuLoadMetricClass.getConstructor();\n                return cpuLoadMetricConstructor.newInstance();\n            } catch (NoSuchMethodException e) {\n                logger.warn(\"Unknown CpuLoadMetric : {}\", classToLoad);\n                return CpuLoadMetric.UNSUPPORTED_CPU_LOAD_METRIC;\n            }\n        } catch (ReflectiveOperationException e) {\n            logger.warn(\"Error creating CpuLoadMetric [\" + classToLoad + \"]\");\n            return CpuLoadMetric.UNSUPPORTED_CPU_LOAD_METRIC;\n        }\n    }\n}\n","sourceCodeStart":67,"sourceCodeEnd":94,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/stat/cpu/CpuLoadMetricProvider.java#L67-L94","documentation":"CpuLoadMetricProvider.createCpuLoadMetric logs 'Unknown CpuLoadMetric' when Class.forName succeeds but the loaded class has no public no-arg constructor (NoSuchMethodException). It returns CpuLoadMetric.UNSUPPORTED_CPU_LOAD_METRIC so the agent continues without CPU load metrics. This branch is distinct from the general ReflectiveOperationException branch that logs 'Error creating CpuLoadMetric'.","triggerScenarios":"A CPU load metric class name (built from OS/JVM type/version mapping) resolves to a class that changed its constructor signature or was replaced with one requiring arguments.","commonSituations":"JVM/OS mapping table points at a class refactored between Pinpoint versions; custom CpuLoadMetric implementation without a no-arg constructor configured for the platform.","solutions":["Verify the class named in the log has a public no-arg constructor; add one if it is your custom implementation","Check whether your Pinpoint version's class map matches the target OS/JVM and upgrade the agent if the platform is newer than the mapping","Confirm the fallback UNSUPPORTED_CPU_LOAD_METRIC is acceptable — if CPU metrics matter, provide a compatible implementation"],"exampleFix":"// before\nclass MyCpuLoadMetric implements CpuLoadMetric {\n    MyCpuLoadMetric(OperatingSystemMXBean os) { ... }\n}\n// after\nclass MyCpuLoadMetric implements CpuLoadMetric {\n    public MyCpuLoadMetric() { this(getPlatformBean()); }\n    MyCpuLoadMetric(OperatingSystemMXBean os) { ... }\n}","handlingStrategy":"fallback","validationCode":"try { Class<?> c = Class.forName(metricClassName); c.getConstructor(); } catch (ClassNotFoundException | NoSuchMethodException e) { /* resolve before enabling cpu metrics */ }","typeGuard":null,"tryCatchPattern":"try { return ctor.newInstance(); } catch (NoSuchMethodException e) { logger.warn(\"Unknown CpuLoadMetric : {}\", classToLoad); return CpuLoadMetric.UNSUPPORTED_CPU_LOAD_METRIC; }","preventionTips":["Give custom CpuLoadMetric implementations a public no-arg constructor","Keep the OS/JVM -> metric-class mapping in sync when upgrading the agent","Test the metric constructor on all target JVM vendors (HotSpot, OpenJ9, etc.)","Check CPU metric presence in collector UI after JVM upgrades"],"tags":["reflection","metrics","constructor","cpu"],"backgroundTag":"class-not-found","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}