{"record":{"id":"809f94fd1b39a69b","repo":"pinpoint-apm/pinpoint","slug":"custommetricname-must-consist-of-groupname-metr","errorCode":null,"errorMessage":"customMetricName must consist of {GroupName}/{MetricName}/LabelName}","messagePattern":"customMetricName must consist of (.+?)/(.+?)/LabelName\\}","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/monitor/metric/CustomMetricIdGenerator.java","lineNumber":76,"sourceCode":"            }\n\n            boolean contains = metricNameToIdMap.containsKey(metricName);\n            if (contains) {\n                return NOT_REGISTERED;\n            }\n\n            ++currentId;\n            metricNameToIdMap.put(metricName, currentId);\n            return currentId;\n        }\n    }\n\n    private boolean checkValidCustomMetricName(String customMetricName) {\n        try {\n            String[] split = customMetricName.split(\"/\", 3);\n\n            if (split.length != 3) {\n                throw new IllegalArgumentException(\"customMetricName must consist of {GroupName}/{MetricName}/LabelName}\");\n            }\n\n            for (String eachName : split) {\n                if (!IdValidateUtils.validateId(eachName, 64)) {\n                    return false;\n                }\n            }\n\n            return true;\n        } catch (Exception e) {\n            logger.warn(\"Inserted customMetricName({}) is not valid. cause:{}\", customMetricName, e.getMessage(), e);\n        }\n        return false;\n    }\n\n}\n","sourceCodeStart":58,"sourceCodeEnd":93,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/monitor/metric/CustomMetricIdGenerator.java#L58-L93","documentation":"CustomMetricIdGenerator.create() requires custom metric names in the strict format {GroupName}/{MetricName}/LabelName. checkValidCustomMetricName splits on '/' with limit 3 and throws IllegalArgumentException if the split does not yield exactly 3 parts.","triggerScenarios":"Calling the custom-metric registration API with a name that has fewer or more than 2 '/' separators — e.g. 'myMetric' or 'group/metric/label/extra'.","commonSituations":"Developers registering custom metrics forget the label segment, pass a metric name with spaces or extra slashes, or copy a 2-part name from examples of other APM tools.","solutions":["Format the name as GroupName/MetricName/LabelName with exactly two slashes, e.g. 'app/orderCount/success'","Ensure each segment passes IdValidateUtils.validateId (alphanumeric allowed chars, max 64 chars)","Validate the name with the same split('/')==3 check before calling the API","Trim accidental leading/trailing slashes which create empty segments"],"exampleFix":"// before\nString name = \"orderCount\";\n// after\nString name = \"MyApp/orderCount/success\";","handlingStrategy":"validation","validationCode":"boolean isValidCustomMetricName(String name) {\n    String[] parts = name.split(\"/\", 3);\n    if (parts.length != 3) return false;\n    for (String p : parts) if (!IdValidateUtils.validateId(p, 64)) return false;\n    return true;\n}","typeGuard":null,"tryCatchPattern":"try { generator.create(rawName); } catch (IllegalArgumentException e) { logger.warn(\"Bad custom metric name '{}': must be Group/Metric/Label\", rawName); }","preventionTips":["Always format names as GroupName/MetricName/LabelName","Keep each segment <=64 chars and composed of allowed id characters","Sanitize user-supplied metric names before registration"],"tags":["validation","custom-metrics","naming","pinpoint"],"backgroundTag":"invalid-argument-format","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"}