pinpoint-apm/pinpoint · warning
Error creating CpuLoadMetric [{}]
Error message
Error creating CpuLoadMetric [{}] What it means
CpuLoadMetricProvider logs this when reflective instantiation of the CPU load metric class fails with any ReflectiveOperationException (ClassNotFoundException, IllegalAccessException, InvocationTargetException, InstantiationException). The provider falls back to CpuLoadMetric.UNSUPPORTED_CPU_LOAD_METRIC, disabling CPU load collection while the agent keeps running.
Source
Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/stat/cpu/CpuLoadMetricProvider.java:89
return null;
}
private CpuLoadMetric createCpuLoadMetric(String classToLoad) {
if (classToLoad == null) {
return CpuLoadMetric.UNSUPPORTED_CPU_LOAD_METRIC;
}
try {
@SuppressWarnings("unchecked")
Class<CpuLoadMetric> cpuLoadMetricClass = (Class<CpuLoadMetric>) Class.forName(classToLoad);
try {
Constructor<CpuLoadMetric> cpuLoadMetricConstructor = cpuLoadMetricClass.getConstructor();
return cpuLoadMetricConstructor.newInstance();
} catch (NoSuchMethodException e) {
logger.warn("Unknown CpuLoadMetric : {}", classToLoad);
return CpuLoadMetric.UNSUPPORTED_CPU_LOAD_METRIC;
}
} catch (ReflectiveOperationException e) {
logger.warn("Error creating CpuLoadMetric [" + classToLoad + "]");
return CpuLoadMetric.UNSUPPORTED_CPU_LOAD_METRIC;
}
}
}
View on GitHub (pinned to 744c3d3075)
Solutions
- Read the chained exception to distinguish ClassNotFoundException from InvocationTargetException
- Confirm the expected metric class exists in the deployed pinpoint agent jar (jar tf / unzip -l)
- Fix the constructor if it throws (e.g. guard against missing com.sun.management.OperatingSystemMXBean)
- If the platform lacks the required MXBeans, accept the unsupported-metric fallback
Defensive patterns
Strategy: fallback
Validate before calling
jar tf pinpoint-agent.jar | grep -i CpuLoadMetric; // and confirm com.sun.management.OperatingSystemMXBean is reachable on the JVM
Try / catch
try { return ctor.newInstance(); } catch (ReflectiveOperationException e) { logger.warn("Error creating CpuLoadMetric [{}]", classToLoad, e); return CpuLoadMetric.UNSUPPORTED_CPU_LOAD_METRIC; } Prevention
- Deploy the full, unmodified Pinpoint agent distribution for your platform
- Confirm the platform exposes the com.sun.management CPU MXBeans
- Log the chained cause so load-vs-construct failures are distinguishable
- Accept the unsupported fallback on platforms without CPU MXBeans instead of patching
When it happens
Trigger: Class.forName cannot find the metric class on the agent classpath; the constructor is not accessible; the constructor throws during instantiation.
Common situations: Corrupt or trimmed agent deployment missing platform-specific metric classes; running on an OS/JVM combination whose metric class was never packaged; constructor throwing due to unavailable com.sun.management beans.
Related errors
- Unknown CpuLoadMetric : {}
- Error creating FileDescriptorMetric [{}]
- Error creating ShutdownHookRegister [{}]
- BufferMetric initialize fail: {}
- Unknown FileDescriptorMetric : {}
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/01930bdcc96b9daa.
Report an issue: GitHub.