{"record":{"id":"0231621fe4c14e07","repo":"prestodb/presto","slug":"prometheus-max-query-duration-must-be-greater-than","errorCode":null,"errorMessage":"prometheus.max-query-duration must be greater than prometheus.query-chunk-duration","messagePattern":"prometheus\\.max-query-duration must be greater than prometheus\\.query-chunk-duration","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusConnectorConfig.java","lineNumber":120,"sourceCode":"    {\n        return Optional.ofNullable(bearerTokenFile);\n    }\n\n    @Config(\"prometheus.bearer-token-file\")\n    @ConfigDescription(\"File holding bearer token if needed for access to Prometheus\")\n    public PrometheusConnectorConfig setBearerTokenFile(File bearerTokenFile)\n    {\n        this.bearerTokenFile = bearerTokenFile;\n        return this;\n    }\n\n    @PostConstruct\n    public void checkConfig()\n    {\n        long maxQueryRangeDuration = (long) getMaxQueryRangeDuration().getValue(TimeUnit.SECONDS);\n        long queryChunkSizeDuration = (long) getQueryChunkSizeDuration().getValue(TimeUnit.SECONDS);\n        if (maxQueryRangeDuration < queryChunkSizeDuration) {\n            throw new ConfigurationException(ImmutableList.of(new Message(\"prometheus.max-query-duration must be greater than prometheus.query-chunk-duration\")));\n        }\n    }\n    public boolean isTlsEnabled()\n    {\n        return tlsEnabled;\n    }\n\n    @Config(\"prometheus.tls.enabled\")\n    public PrometheusConnectorConfig setTlsEnabled(boolean tlsEnabled)\n    {\n        this.tlsEnabled = tlsEnabled;\n        return this;\n    }\n\n    public String getTrustStorePath()\n    {\n        return trustStorePath;\n    }","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusConnectorConfig.java#L102-L138","documentation":"PostConstruct consistency check in PrometheusConnectorConfig: the configured prometheus.max-query-duration must exceed prometheus.query-chunk-duration because query time ranges are split into chunks; with max <= chunk, no valid split ranges can be produced. Throws IllegalStateException during connector configuration.","triggerScenarios":"Thrown at presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusConnectorConfig.java:120 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase prometheus.max-query-duration above prometheus.query-chunk-duration","Or lower prometheus.query-chunk-duration so chunks fit within the max query range"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}