apache/druid · error · IllegalStateException
Failed to parse metric dimensions and types
Error message
Failed to parse metric dimensions and types
What it means
Sentinel-style failure in DropwizardConverter.readMap(): the dimension/type mapping file referenced by dimensionMapPath could not be opened or deserialized into Map<String, DropwizardMetricSpec> (bad path, unreadable file, or invalid JSON structure). The converter cannot map incoming metric names to dropwizard names/types/dimensions without this file, so it aborts with this message and the underlying cause attached.
Solutions
- Check dimensionMapPath points to an existing, readable file with valid JSON matching Map<String, DropwizardMetricSpec>.
- Validate the mapping file's syntax and required fields (dimensions, type).
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardConverter.java:88 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/11e053a7ba54a17d.
Report an issue: GitHub.
Appendix: source
Thrown at extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardConverter.java:88
for (String dim : metricSpec.getDimensions()) {
if (userDims.containsKey(dim)) {
filteredDimensions.put(dim, userDims.get(dim).toString());
}
}
return metricSpec;
} else {
// No mapping found for given metric, return null
return null;
}
}
private Map<String, DropwizardMetricSpec> readMap(ObjectMapper mapper, String dimensionMapPath)
{
try (final InputStream is = openDimensionMapFile(dimensionMapPath)) {
return mapper.readerFor(new TypeReference<Map<String, DropwizardMetricSpec>>() {}).readValue(is);
}
catch (IOException e) {
throw new ISE(e, "Failed to parse metric dimensions and types");
}
}
private InputStream openDimensionMapFile(@Nullable String dimensionMapPath) throws IOException
{
if (Strings.isNullOrEmpty(dimensionMapPath)) {
log.info("Using default metric dimension and types");
return this.getClass().getClassLoader().getResourceAsStream("defaultMetricDimensions.json");
} else {
log.info("Using metric dimensions at types at [%s]", dimensionMapPath);
return new FileInputStream(dimensionMapPath);
}
}
}
View on GitHub (pinned to 9b90983fd2)