diff --git a/gradle.properties b/gradle.properties index 2cc408f..0e1ffcd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=2.16.2 +version=2.16.3 diff --git a/tw-entrypoints-starter/src/main/java/com/transferwise/common/entrypoints/EntryPointsAutoConfiguration.java b/tw-entrypoints-starter/src/main/java/com/transferwise/common/entrypoints/EntryPointsAutoConfiguration.java index 0bdac0e..351c83b 100644 --- a/tw-entrypoints-starter/src/main/java/com/transferwise/common/entrypoints/EntryPointsAutoConfiguration.java +++ b/tw-entrypoints-starter/src/main/java/com/transferwise/common/entrypoints/EntryPointsAutoConfiguration.java @@ -14,10 +14,12 @@ import com.transferwise.common.entrypoints.tableaccessstatistics.DefaultTasQueryParsingListener; import com.transferwise.common.entrypoints.tableaccessstatistics.TableAccessStatisticsBeanPostProcessor; import com.transferwise.common.entrypoints.tableaccessstatistics.TasFlywayConfigurationCustomizer; +import com.transferwise.common.entrypoints.tableaccessstatistics.TasMeterFilter; import com.transferwise.common.entrypoints.tableaccessstatistics.TasParsedQueryRegistry; import com.transferwise.common.entrypoints.tableaccessstatistics.TasQueryParsingInterceptor; import com.transferwise.common.entrypoints.tableaccessstatistics.TasQueryParsingListener; import com.transferwise.common.entrypoints.transactionstatistics.TransactionStatisticsBeanPostProcessor; +import com.transferwise.common.entrypoints.transactionstatistics.TsMeterFilter; import io.micrometer.core.instrument.MeterRegistry; import org.springframework.beans.factory.BeanFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -63,7 +65,9 @@ public static DatabaseAccessStatisticsBeanPostProcessor twEntryPointsDatabaseAcc @Bean @ConditionalOnProperty(name = "tw-entrypoints.tas.enabled", havingValue = "true", matchIfMissing = true) @ConditionalOnMissingBean - public static TableAccessStatisticsBeanPostProcessor twEntryPointsTableAccessStatisticsBeanPostProcessor(BeanFactory beanFactory) { + public static TableAccessStatisticsBeanPostProcessor twEntryPointsTableAccessStatisticsBeanPostProcessor(BeanFactory beanFactory, + MeterRegistry meterRegistry) { + meterRegistry.config().meterFilter(new TasMeterFilter()); return new TableAccessStatisticsBeanPostProcessor(beanFactory); } @@ -105,7 +109,9 @@ public TasFlywayConfigurationCustomizer tasFlywayConfigurationCustomizer() { @Bean @ConditionalOnProperty(name = "tw-entrypoints.ts.enabled", havingValue = "true", matchIfMissing = true) @ConditionalOnMissingBean - public static TransactionStatisticsBeanPostProcessor twEntryPointsTransactionStatisticsBeanPostProcessor(BeanFactory beanFactory) { + public static TransactionStatisticsBeanPostProcessor twEntryPointsTransactionStatisticsBeanPostProcessor(BeanFactory beanFactory, + MeterRegistry meterRegistry) { + meterRegistry.config().meterFilter(new TsMeterFilter()); return new TransactionStatisticsBeanPostProcessor(beanFactory); } diff --git a/tw-entrypoints/src/main/java/com/transferwise/common/entrypoints/tableaccessstatistics/TableAccessStatisticsSpyqlListener.java b/tw-entrypoints/src/main/java/com/transferwise/common/entrypoints/tableaccessstatistics/TableAccessStatisticsSpyqlListener.java index 42379d8..7df1e60 100644 --- a/tw-entrypoints/src/main/java/com/transferwise/common/entrypoints/tableaccessstatistics/TableAccessStatisticsSpyqlListener.java +++ b/tw-entrypoints/src/main/java/com/transferwise/common/entrypoints/tableaccessstatistics/TableAccessStatisticsSpyqlListener.java @@ -95,7 +95,6 @@ public TableAccessStatisticsSpyqlListener(IMeterCache meterCache, ExecutorServic this.tasQueryParsingListener = tasQueryParsingListener; final MeterRegistry meterRegistry = meterCache.getMeterRegistry(); - meterRegistry.config().meterFilter(new TasMeterFilter()); sqlParseResultsCache = Caffeine.newBuilder().maximumWeight(entryPointsProperties.getTas().getSqlParser().getCacheSizeMib() * MIB).recordStats() .executor(executorService) diff --git a/tw-entrypoints/src/main/java/com/transferwise/common/entrypoints/transactionstatistics/TransactionsStatisticsSpyqlListener.java b/tw-entrypoints/src/main/java/com/transferwise/common/entrypoints/transactionstatistics/TransactionsStatisticsSpyqlListener.java index 895e951..c963827 100644 --- a/tw-entrypoints/src/main/java/com/transferwise/common/entrypoints/transactionstatistics/TransactionsStatisticsSpyqlListener.java +++ b/tw-entrypoints/src/main/java/com/transferwise/common/entrypoints/transactionstatistics/TransactionsStatisticsSpyqlListener.java @@ -67,7 +67,6 @@ public class TransactionsStatisticsSpyqlListener implements SpyqlDataSourceListe public TransactionsStatisticsSpyqlListener(IMeterCache meterCache, String databaseName) { this.dbTag = Tag.of(EntryPointsMetrics.TAG_DATABASE, databaseName); this.meterCache = meterCache; - meterCache.getMeterRegistry().config().meterFilter(new TsMeterFilter()); } @Override