we have a context hierarchy and the data sources are in a parent context.
DataSourcePublicMetrics retrieves DataSource's like that:
for (Map.Entry<String, DataSource> entry : this.applicationContext
.getBeansOfType(DataSource.class).entrySet()) {
it does not find the DataSource's in parent contexts,
I had to copy the code and change this line to :
for (Map.Entry<String, DataSource> entry : BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext.getBeanFactory(),DataSource.class).entrySet()) {