{"record":{"id":"d3878c87608bc3ba","repo":"pinpoint-apm/pinpoint","slug":"unknown-filedescriptormetric","errorCode":null,"errorMessage":"Unknown FileDescriptorMetric : {}","messagePattern":"Unknown FileDescriptorMetric : (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/stat/filedescriptor/FileDescriptorMetricProvider.java","lineNumber":144,"sourceCode":"        return osType;\n    }\n\n    private FileDescriptorMetric createFileDescriptorMetric(String classToLoad) {\n        if (classToLoad == null) {\n            return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;\n        }\n        if (UNSUPPORTED_METRIC.equals(classToLoad)) {\n            return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;\n        }\n\n        try {\n            @SuppressWarnings(\"unchecked\")\n            Class<FileDescriptorMetric> fileDescriptorMetricClass = (Class<FileDescriptorMetric>) Class.forName(classToLoad);\n            try {\n                Constructor<FileDescriptorMetric> fileDescriptorMetricConstructor = fileDescriptorMetricClass.getConstructor();\n                return fileDescriptorMetricConstructor.newInstance();\n            } catch (NoSuchMethodException e) {\n                logger.warn(\"Unknown FileDescriptorMetric : {}\", classToLoad);\n                return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;\n            }\n        } catch (ReflectiveOperationException e) {\n            logger.warn(\"Error creating FileDescriptorMetric [{}]\", classToLoad);\n            return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;\n        }\n    }\n}\n","sourceCodeStart":126,"sourceCodeEnd":153,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/stat/filedescriptor/FileDescriptorMetricProvider.java#L126-L153","documentation":"FileDescriptorMetricProvider.createFileDescriptorMetric logs 'Unknown FileDescriptorMetric' when the loaded metric class lacks a public no-arg constructor (NoSuchMethodException). It returns FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC, so the agent runs without file-descriptor metrics. This is the constructor-shape branch, separate from the general reflective failure branch.","triggerScenarios":"The class name selected for the current OS/JVM points to a class whose no-arg constructor was removed or made non-public during refactoring.","commonSituations":"Custom FileDescriptorMetric implementation requiring constructor arguments; Pinpoint version upgrade where platform classes changed constructor visibility.","solutions":["Ensure the logged class exposes a public no-arg constructor","If it is a custom implementation, refactor it to take no constructor arguments and fetch MBeans internally","Check for version mismatch between agent jar and any locally patched classes","Accept the unsupported-metric fallback if fd metrics are not required"],"exampleFix":"// before\nDefaultFileDescriptorMetric(OperatingSystemMXBean os) { ... }\n// after\npublic DefaultFileDescriptorMetric() { this(getOsBean()); }\nDefaultFileDescriptorMetric(OperatingSystemMXBean os) { ... }","handlingStrategy":"fallback","validationCode":"Class<?> c = Class.forName(\"com.navercorp.pinpoint.profiler.context.provider.stat.filedescriptor.FileDescriptorMetricProvider\"); // verify target metric class: Class.forName(selectedName).getConstructor();","typeGuard":null,"tryCatchPattern":"try { return fileDescriptorMetricConstructor.newInstance(); } catch (NoSuchMethodException e) { logger.warn(\"Unknown FileDescriptorMetric : {}\", classToLoad); return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC; }","preventionTips":["Keep custom metric classes public with a public no-arg constructor","After agent upgrades, grep logs for 'Unknown FileDescriptorMetric' to catch mapping drift","Pin plugin/metric class versions to the agent version","Add a unit test asserting the provider's getMetricClassName mapping yields instantiable classes"],"tags":["reflection","metrics","constructor","file-descriptors"],"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-14T11:17:12.474Z"}