pinpoint-apm/pinpoint · warning

Unknown FileDescriptorMetric : {}

Error message

Unknown FileDescriptorMetric : {}

What it means

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.

Source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/stat/filedescriptor/FileDescriptorMetricProvider.java:144

        return osType;
    }

    private FileDescriptorMetric createFileDescriptorMetric(String classToLoad) {
        if (classToLoad == null) {
            return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;
        }
        if (UNSUPPORTED_METRIC.equals(classToLoad)) {
            return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;
        }

        try {
            @SuppressWarnings("unchecked")
            Class<FileDescriptorMetric> fileDescriptorMetricClass = (Class<FileDescriptorMetric>) Class.forName(classToLoad);
            try {
                Constructor<FileDescriptorMetric> fileDescriptorMetricConstructor = fileDescriptorMetricClass.getConstructor();
                return fileDescriptorMetricConstructor.newInstance();
            } catch (NoSuchMethodException e) {
                logger.warn("Unknown FileDescriptorMetric : {}", classToLoad);
                return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;
            }
        } catch (ReflectiveOperationException e) {
            logger.warn("Error creating FileDescriptorMetric [{}]", classToLoad);
            return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;
        }
    }
}

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Ensure the logged class exposes a public no-arg constructor
  2. If it is a custom implementation, refactor it to take no constructor arguments and fetch MBeans internally
  3. Check for version mismatch between agent jar and any locally patched classes
  4. Accept the unsupported-metric fallback if fd metrics are not required

Example fix

// before
DefaultFileDescriptorMetric(OperatingSystemMXBean os) { ... }
// after
public DefaultFileDescriptorMetric() { this(getOsBean()); }
DefaultFileDescriptorMetric(OperatingSystemMXBean os) { ... }
Defensive patterns

Strategy: fallback

Validate before calling

Class<?> c = Class.forName("com.navercorp.pinpoint.profiler.context.provider.stat.filedescriptor.FileDescriptorMetricProvider"); // verify target metric class: Class.forName(selectedName).getConstructor();

Try / catch

try { return fileDescriptorMetricConstructor.newInstance(); } catch (NoSuchMethodException e) { logger.warn("Unknown FileDescriptorMetric : {}", classToLoad); return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC; }

Prevention

When it happens

Trigger: 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.

Common situations: Custom FileDescriptorMetric implementation requiring constructor arguments; Pinpoint version upgrade where platform classes changed constructor visibility.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/d3878c87608bc3ba. Report an issue: GitHub.