From 24045acf1a83458d286184160332098122ee7025 Mon Sep 17 00:00:00 2001 From: Gang Li Date: Wed, 17 Jul 2024 19:44:49 +0800 Subject: [PATCH] Revert "Make MetricsProducers default" This reverts commit 9fa6dfd5408f7b9aeca54daaea02331cad4ebaa2. --- .../core/metric/ClientMetricsProducer.java | 19 +++++++++++++++++-- pom.xml | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/core-java/src/main/java/org/commonjava/indy/client/core/metric/ClientMetricsProducer.java b/core-java/src/main/java/org/commonjava/indy/client/core/metric/ClientMetricsProducer.java index 4e312e6..9dd1e2f 100644 --- a/core-java/src/main/java/org/commonjava/indy/client/core/metric/ClientMetricsProducer.java +++ b/core-java/src/main/java/org/commonjava/indy/client/core/metric/ClientMetricsProducer.java @@ -15,39 +15,54 @@ */ package org.commonjava.indy.client.core.metric; +import org.commonjava.cdi.util.weft.config.DefaultWeftConfig; +import org.commonjava.cdi.util.weft.config.WeftConfig; import org.commonjava.o11yphant.metrics.TrafficClassifier; import org.commonjava.o11yphant.metrics.conf.DefaultMetricsConfig; import org.commonjava.o11yphant.metrics.conf.MetricsConfig; import org.commonjava.o11yphant.metrics.sli.GoldenSignalsMetricSet; import org.commonjava.o11yphant.metrics.system.StoragePathProvider; +import javax.enterprise.inject.Alternative; import javax.enterprise.inject.Produces; /** - * This producer is used to provide the missing CDI deps for indy client metrics sets. User can specify - * customized producers with @Alternative to provide alternative functions. + * This producer is used to provide the missing CDI deps for indy client metrics sets. Now all + * produces provided alternative ones, because it will break indy metrics providers. In future the + * indy-client libs will be extracted to a single lib, so then we will set these providers as default. */ public class ClientMetricsProducer { @Produces + @Alternative public TrafficClassifier getClientTrafficClassifier() { return new ClientTrafficClassifier(); } @Produces + @Alternative public GoldenSignalsMetricSet getClientMetricSet() { return new ClientGoldenSignalsMetricSet(); } @Produces + @Alternative public MetricsConfig getMetricsConfig() { return new DefaultMetricsConfig(); } @Produces + @Alternative + public WeftConfig getWeftConfig() + { + return new DefaultWeftConfig(); + } + + @Produces + @Alternative public StoragePathProvider getStoragePathProvider() { return () -> null; diff --git a/pom.xml b/pom.xml index cd74b80..3f08c69 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 1.12 1.1.1 1.5 - 1.9.2-SNAPSHOT + 1.9.1 4.5.13 1.7.36 2.11.0