@Configuration
static class CustomDataSourcePublicMetrics {
@Bean
public DataSourcePublicMetrics myDataSourcePublicMetrics() {
return new DataSourcePublicMetrics() {
@Override
protected String createPrefix(String dataSourceName,
DataSource dataSource, boolean primary) {
return (primary ? "ds.first." : "ds.second");
}