{"record":{"id":"4d59301f750ff362","repo":"alibaba/Sentinel","slug":"interval-should-be-less-than-5-min","errorCode":null,"errorMessage":"Interval should be less than 5 min: ","messagePattern":"Interval should be less than 5 min: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sentinel-core/src/main/java/com/alibaba/csp/sentinel/eagleeye/StatLoggerBuilder.java","lineNumber":110,"sourceCode":"        return StatLogController.createLoggerIfNotExists(this);\n    }\n\n    static void validateInterval(final long intervalSeconds) throws IllegalArgumentException {\n        if (intervalSeconds < 1) {\n            throw new IllegalArgumentException(\"Interval cannot be less than 1\" + intervalSeconds);\n        } else if (intervalSeconds < 60) {\n            if (60 % intervalSeconds != 0) {\n                throw new IllegalArgumentException(\"Invalid second interval (cannot divide by 60): \" + intervalSeconds);\n            }\n        } else if (intervalSeconds <= 5 * 60) {\n            if (intervalSeconds % 60 != 0) {\n                throw new IllegalArgumentException(\"Invalid second interval (cannot divide by 60): \" + intervalSeconds);\n            }\n            if (60 % intervalSeconds != 0) {\n                throw new IllegalArgumentException(\"Invalid second interval (cannot divide by 60): \" + intervalSeconds);\n            }\n        } else if (intervalSeconds > 5 * 60) {\n            throw new IllegalArgumentException(\"Interval should be less than 5 min: \" + intervalSeconds);\n        }\n    }\n}\n","sourceCodeStart":92,"sourceCodeEnd":114,"githubUrl":"https://github.com/alibaba/Sentinel/blob/a3f40ba8e900c8489bd520274739f17235a7721c/sentinel-core/src/main/java/com/alibaba/csp/sentinel/eagleeye/StatLoggerBuilder.java#L92-L114","documentation":"The final rule of StatLoggerBuilder.validateInterval: flush intervals above 5 minutes (300 seconds) are rejected. EagleEye stat loggers are designed for near-real-time monitoring output, and long intervals would also delay file rolling and daemon flushing disproportionately, so the builder throws IllegalArgumentException for any value over 300.","triggerScenarios":"Calling intervalSeconds(n) with n > 300 — e.g. 360 (6 min), 600 (10 min), or a milliseconds-vs-seconds unit mistake (e.g. passing 6000 intending 6000ms = 6s, or 600 for '10 minutes').","commonSituations":"Unit confusion: a milliseconds value from config is passed where seconds are expected, producing large numbers. Aggressive batching strategies that want 10-15 minute flushes. Defaults migrated from log-rotation policies measured in minutes.","solutions":["Keep the interval at or below 300 seconds — and given the other rules, effectively at most 60 seconds.","If a milliseconds config feeds the builder, divide by 1000 and clamp to [1, 60].","If coarse aggregation is truly needed, aggregate downstream from the stat files instead of stretching the flush interval."],"exampleFix":"// before\nbuilder.intervalSeconds(600); // > 300 -> throws\n\n// after\nbuilder.intervalSeconds(60);","handlingStrategy":"validation","validationCode":"int sec = Math.toIntExact(Math.min(Math.max(1, intervalMillis / 1000), 60));\nbuilder.intervalSeconds(sec);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp configured intervals to [1, 60] seconds before calling the builder.","Double-check ms-vs-s units on every interval config migration.","Move coarse aggregation downstream instead of stretching flush intervals."],"tags":["eagleeye","stat-logger","config","interval","validation","illegal-argument","sentinel"],"backgroundTag":null,"analyzedSha":"a3f40ba8e900c8489bd520274739f17235a7721c","analyzedAt":"2026-08-14T11:10:30.678Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}