{"record":{"id":"4bc6d32ec2600e1d","repo":"apache/seatunnel","slug":"the-connector-option-flush-interval-has-been-rem","errorCode":null,"errorMessage":"The connector option 'flush_interval' has been removed and is ignored. Use the engine-level 'sink.flush.interval' in the job 'env' block instead. Engine-level timer flush is supported only by Zeta; on Spark and Flink there is no periodic flush, so tune 'batch_size' instead.","messagePattern":"The connector option 'flush_interval' has been removed and is ignored\\. Use the engine-level 'sink\\.flush\\.interval' in the job 'env' block instead\\. Engine-level timer flush is supported only by Zeta; on Spark and Flink there is no periodic flush, so tune 'batch_size' instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusWriter.java","lineNumber":84,"sourceCode":"\n        super(seaTunnelRowType, httpParameter);\n        this.batchList = new ArrayList<>();\n        this.sinkConfig = PrometheusSinkConfig.loadConfig(pluginConfig);\n        this.batchSize = sinkConfig.getBatchSize();\n        this.serializer =\n                new PrometheusSerializer(\n                        seaTunnelRowType,\n                        sinkConfig.getKeyTimestamp(),\n                        sinkConfig.getKeyLabel(),\n                        sinkConfig.getKeyValue());\n        this.httpClient = new HttpClientProvider(httpParameter);\n        // The connector-level `flush_interval` option was removed in favor of the engine-level\n        // `sink.flush.interval`. A leftover key in an upgraded job config is silently ignored on a\n        // direct job run (only `--check`/`--dry-run` reject unknown keys), so warn here (once per\n        // writer instance) to give operators a signal instead of silently dropping periodic\n        // flushing.\n        if (pluginConfig.getSourceMap().containsKey(REMOVED_FLUSH_INTERVAL_KEY)) {\n            log.warn(\n                    \"The connector option 'flush_interval' has been removed and is ignored. Use the \"\n                            + \"engine-level 'sink.flush.interval' in the job 'env' block instead. \"\n                            + \"Engine-level timer flush is supported only by Zeta; on Spark and \"\n                            + \"Flink there is no periodic flush, so tune 'batch_size' instead.\");\n        }\n        // Opt in to engine-level timer flush. On Zeta the engine invokes this action on the normal\n        // Sink input-processing path when a FlushSignal arrives, so there is no connector-owned\n        // scheduler thread and no concurrency with write/checkpoint/close. On Spark and Flink the\n        // Context does not implement registerFlushAction (it keeps the interface's no-op default),\n        // so there is no periodic timer flush there; the buffer is flushed on batch_size and on\n        // close(). The null-check is defensive for non-standard/test call sites that may not supply\n        // a context.\n        if (context != null) {\n            context.registerFlushAction(this::flush);\n        }\n    }\n\n    @Override","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusWriter.java#L66-L102","documentation":"The Prometheus sink's connector-level 'flush_interval' option was removed in favor of the engine-level 'sink.flush.interval' setting in the job 'env' block. A leftover key in an upgraded job config is silently ignored on direct job runs (only --check/--dry-run reject unknown keys), so the writer logs this warning once per writer instance to signal that periodic flushing at the connector level is no longer happening.","triggerScenarios":"A Prometheus sink job config still contains the 'flush_interval' key under the sink options; the key is detected in pluginConfig.getSourceMap() when PrometheusWriter is opened.","commonSituations":"Upgrading SeaTunnel from a version where connector-level flush_interval existed without cleaning the job config; copying old batch config templates; expecting periodic flush on Spark/Flink where only batch_size applies.","solutions":["Remove 'flush_interval' from the sink config block","Add 'sink.flush.interval' to the job 'env' block (Zeta only)","On Spark/Flink, tune 'batch_size' instead since there is no periodic timer flush","Run the job with --check or --dry-run to catch leftover unknown keys before production runs"],"exampleFix":"// before\nsink {\n  Prometheus {\n    flush_interval = 5000\n  }\n}\n// after\nenv {\n  sink.flush.interval = 5000\n}\nsink {\n  Prometheus {\n  }\n}","handlingStrategy":"validation","validationCode":"if (sinkConfig.containsKey(\"flush_interval\")) { throw new IllegalArgumentException(\"flush_interval removed; use env-level sink.flush.interval\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Grep job configs for 'flush_interval' before upgrading","Use --check/--dry-run to surface removed keys","Move flush settings to the env block on Zeta","Tune batch_size on Spark/Flink instead of expecting timer flush"],"tags":["config","deprecated","prometheus"],"backgroundTag":"deprecated-api-usage","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}