No qualifying bean of type MetricRegistry. Spring Boot 2

Full text exception text:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.codahale.metrics.MetricRegistry] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.

Spring Boot 2 is no longer support MetricsRegistry by default.

If you want to continue using the MetricsRegistry for your own purposes, just create a new bean:

public MetricRegistry metricRegistry() {
	return new MetricRegistry();
Telegram channel

If you still have any questions, feel free to ask me in the comments under this article or write me at

If I saved your day, you can support me 🤝