apache/seatunnel · warning

The connector option 'flush_interval' has been removed and…

Error message

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.

What it means

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.

Solutions

  1. Remove 'flush_interval' from the sink config block
  2. Add 'sink.flush.interval' to the job 'env' block (Zeta only)
  3. On Spark/Flink, tune 'batch_size' instead since there is no periodic timer flush
  4. Run the job with --check or --dry-run to catch leftover unknown keys before production runs

Example fix

// before
sink {
  Prometheus {
    flush_interval = 5000
  }
}
// after
env {
  sink.flush.interval = 5000
}
sink {
  Prometheus {
  }
}
Defensive patterns

Strategy: validation

Validate before calling

if (sinkConfig.containsKey("flush_interval")) { throw new IllegalArgumentException("flush_interval removed; use env-level sink.flush.interval"); }

Prevention

When it happens

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

Common situations: 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.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/4bc6d32ec2600e1d. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusWriter.java:84

        super(seaTunnelRowType, httpParameter);
        this.batchList = new ArrayList<>();
        this.sinkConfig = PrometheusSinkConfig.loadConfig(pluginConfig);
        this.batchSize = sinkConfig.getBatchSize();
        this.serializer =
                new PrometheusSerializer(
                        seaTunnelRowType,
                        sinkConfig.getKeyTimestamp(),
                        sinkConfig.getKeyLabel(),
                        sinkConfig.getKeyValue());
        this.httpClient = new HttpClientProvider(httpParameter);
        // The connector-level `flush_interval` option was removed in favor of the engine-level
        // `sink.flush.interval`. A leftover key in an upgraded job config is silently ignored on a
        // direct job run (only `--check`/`--dry-run` reject unknown keys), so warn here (once per
        // writer instance) to give operators a signal instead of silently dropping periodic
        // flushing.
        if (pluginConfig.getSourceMap().containsKey(REMOVED_FLUSH_INTERVAL_KEY)) {
            log.warn(
                    "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.");
        }
        // Opt in to engine-level timer flush. On Zeta the engine invokes this action on the normal
        // Sink input-processing path when a FlushSignal arrives, so there is no connector-owned
        // scheduler thread and no concurrency with write/checkpoint/close. On Spark and Flink the
        // Context does not implement registerFlushAction (it keeps the interface's no-op default),
        // so there is no periodic timer flush there; the buffer is flushed on batch_size and on
        // close(). The null-check is defensive for non-standard/test call sites that may not supply
        // a context.
        if (context != null) {
            context.registerFlushAction(this::flush);
        }
    }

    @Override

View on GitHub (pinned to cf67b549a7)