apache/seatunnel · error · PrometheusConnectorException
CommonErrorCode.UNSUPPORTED_METHOD
CommonErrorCode.UNSUPPORTED_METHOD
Error message
unsupported query type
What it means
PrometheusSourceReader.collect converts query results based on the configured query type (Range or Instant); an unknown QueryType falls through the switch default and throws UNSUPPORTED_METHOD with 'unsupported query type'.
Solutions
- Set query_type to a supported value (Range or Instant)
- Fix spelling/casing of the query_type config value
- Check the connector docs for currently supported query types
- Upgrade the connector if your config predates the current enum
Example fix
// before query_type = "range_query" // after query_type = "Range"
Defensive patterns
Strategy: validation
Validate before calling
String qt = config.getString("query_type");
if (!"Range".equals(qt) && !"Instant".equals(qt)) throw new IllegalArgumentException("query_type must be Range or Instant, got: " + qt); Type guard
boolean isSupportedQueryType(String qt) { return "Range".equals(qt) || "Instant".equals(qt); } Try / catch
try { reader.pollAndCollectData(); } catch (PrometheusConnectorException e) { if (CommonErrorCode.UNSUPPORTED_METHOD.equals(e.getErrorCode())) { LOG.error("Invalid query_type config"); } throw e; } Prevention
- Validate query_type against the supported enum at config load time
- Copy enum names exactly from connector documentation
- Pin connector versions to avoid enum renames between releases
When it happens
Trigger: The source's configured query type value resolves to something other than the supported Range/Instant enum values.
Common situations: Misspelled query_type in config (e.g. 'range_query' or 'instant_query' instead of Range/Instant); case-sensitivity issues; config from an older connector version with different enum names.
Related errors
- Airtable API rate limit reached, retry
- At least one source plugin must be configured.
- BigtableSourceSplitEnumerator already closed; cannot create…
- BigtableSourceSplitEnumerator closed during client creation
- CLICKHOUSE_GET_TABLE_LIST_CONFIG_ERROR
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/b2e865969f0e988b.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/source/PrometheusSourceReader.java:128
Thread.sleep(httpParameter.getPollIntervalMillis());
}
}
}
}
private void collect(Collector<SeaTunnelRow> output, String data) throws IOException {
if (contentJson != null) {
data = JsonUtils.stringToJsonNode(getPartOfJson(data)).toString();
}
switch (queryType) {
case Range:
convertRangePoints(data, output);
break;
case Instant:
convertInstantPoints(data, output);
break;
default:
throw new PrometheusConnectorException(
CommonErrorCode.UNSUPPORTED_METHOD, "unsupported query type");
}
}
private void convertRangePoints(String data, Collector<SeaTunnelRow> output) {
List<RangePoint> rangePoints = JsonUtils.toList(data, RangePoint.class);
if (CollectionUtils.isEmpty(rangePoints)) {
return;
}
rangePoints.forEach(
rangePoint -> {
Map<String, String> metric = rangePoint.getMetric();
rangePoint
.getValues()
.forEach(
value -> {
double timestampDouble =
Double.valueOf(String.valueOf(value.get(0)));View on GitHub (pinned to cf67b549a7)