apache/druid · error · IllegalStateException
Unknown Metric Type [ ]
Error message
Unknown Metric Type [%s]
What it means
updateMetric switches on the metric spec's configured type (meter, timer, counter, histogram, gauge); an unrecognized type value reaches the default branch and is rejected - usually a typo or unsupported type in the dropwizard metrics mapping file.
Solutions
- Fix the `type` field in the dropwizard metrics mapping to one of meter/timer/counter/histogram/gauge.
- Verify the type value parses into the expected enum as intended.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardEmitter.java:159 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/21da0e899c13c985.
Report an issue: GitHub.
Appendix: source
Thrown at extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardEmitter.java:159
case meter:
metricsRegistry.meter(name).mark(value.longValue());
break;
case timer:
metricsRegistry.timer(name)
.update(value.longValue(), metricSpec.getTimeUnit());
break;
case counter:
metricsRegistry.counter(name).inc(value.longValue());
break;
case histogram:
metricsRegistry.histogram(name).update(value.longValue());
break;
case gauge:
SettableGauge gauge = (SettableGauge) metricsRegistry.gauge(name, () -> new SettableGauge(value));
gauge.setValue(value);
break;
default:
throw new ISE("Unknown Metric Type [%s]", metricSpec.getType());
}
}
@Override
public void flush()
{
for (DropwizardReporter reporter : reporters) {
reporter.flush();
}
}
@Override
public void close()
{
final boolean wasStarted = started.getAndSet(false);
if (wasStarted) {
for (DropwizardReporter reporter : reporters) {
reporter.close();View on GitHub (pinned to 9b90983fd2)