diff --git a/config/checkstyle/checkstyle-suppressions.xml b/config/checkstyle/checkstyle-suppressions.xml
index c1bb51b877..2eaf847a00 100644
--- a/config/checkstyle/checkstyle-suppressions.xml
+++ b/config/checkstyle/checkstyle-suppressions.xml
@@ -7,5 +7,4 @@
- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *
- * https://www.apache.org/licenses/LICENSE-2.0 - *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.env.EnvironmentPostProcessor;
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.MapPropertySource;
-import org.springframework.core.env.MutablePropertySources;
-import org.springframework.core.env.PropertySource;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * @author Dave Syer
- */
-public class MetricsEnvironmentPostProcessor implements EnvironmentPostProcessor {
-
- private static final Log log = LogFactory.getLog(MetricsEnvironmentPostProcessor.class);
-
- @Override
- public void postProcessEnvironment(ConfigurableEnvironment environment,
- SpringApplication application) {
- // Make spring AOP default to target class so RestTemplates can be customized,
- // @Scheduled instrumented
- log.debug("Setting 'spring.aop.proxyTargetClass=true' to make spring AOP default to target class so RestTemplates can be customized");
- addDefaultProperty(environment, "spring.aop.proxyTargetClass", "true");
- }
-
- private void addDefaultProperty(ConfigurableEnvironment environment, String name,
- String value) {
- MutablePropertySources sources = environment.getPropertySources();
- Map
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring;
-
-import io.micrometer.core.annotation.Timed;
-import io.micrometer.core.annotation.TimedSet;
-import org.springframework.core.annotation.AnnotationUtils;
-
-import java.lang.reflect.AnnotatedElement;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-public final class TimedUtils {
- private TimedUtils() {
- }
-
- public static Set
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.async;
-
-import io.micrometer.core.instrument.FunctionCounter;
-import io.micrometer.core.instrument.Gauge;
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.Tag;
-import io.micrometer.core.instrument.binder.MeterBinder;
-import io.micrometer.core.lang.NonNullApi;
-import io.micrometer.core.lang.NonNullFields;
-import io.micrometer.core.lang.Nullable;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ThreadPoolExecutor;
-
-import static java.util.Arrays.asList;
-
-/**
- * Monitors the status of {@link ThreadPoolTaskExecutor} pools. Does not record timings on operations executed in the
- * {@link ExecutorService}, as this requires the instance to be wrapped. Timings are provided separately by wrapping
- * the executor service with {@link TimedThreadPoolTaskExecutor}.
- *
- * @author David Held
- */
-@NonNullApi
-@NonNullFields
-public class ThreadPoolTaskExecutorMetrics implements MeterBinder {
- private final String name;
- private final Iterable
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.async;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.Tag;
-import io.micrometer.core.instrument.Timer;
-import io.micrometer.core.lang.NonNullApi;
-import io.micrometer.core.lang.NonNullFields;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import org.springframework.util.concurrent.ListenableFuture;
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.Future;
-
-/**
- * A {@link ThreadPoolTaskExecutor} which is timed
- *
- * @author David Held
- */
-@NonNullApi
-@NonNullFields
-public class TimedThreadPoolTaskExecutor extends ThreadPoolTaskExecutor {
- private final MeterRegistry registry;
- private final String name;
- private final Iterable
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
-
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.context.annotation.Import;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for a
- * {@link CompositeMeterRegistry}.
- *
- * @author Andy Wilkinson
- */
-@Import({ NoOpMeterRegistryConfiguration.class,
- CompositeMeterRegistryConfiguration.class })
-@ConditionalOnClass(CompositeMeterRegistry.class)
-public class CompositeMeterRegistryAutoConfiguration {
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/CompositeMeterRegistryConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/CompositeMeterRegistryConfiguration.java
deleted file mode 100644
index 8ede476bd6..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/CompositeMeterRegistryConfiguration.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate;
-import org.springframework.boot.autoconfigure.condition.NoneNestedConditions;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Conditional;
-import org.springframework.context.annotation.Primary;
-
-import java.util.List;
-
-/**
- * Configuration for a {@link CompositeMeterRegistry}.
- *
- * @author Andy Wilkinson
- */
-@Conditional(CompositeMeterRegistryConfiguration.MultipleNonPrimaryMeterRegistriesCondition.class)
-class CompositeMeterRegistryConfiguration {
-
- @Bean
- @Primary
- public CompositeMeterRegistry compositeMeterRegistry(Clock clock, List
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics;
-import io.micrometer.core.instrument.binder.jvm.JvmGcMetrics;
-import io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics;
-import io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for JVM metrics.
- *
- * @author Jon Schneider
- * @author Stephane Nicoll
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnClass(MeterRegistry.class)
-@ConditionalOnBean(MeterRegistry.class)
-@ConditionalOnProperty(value = "management.metrics.binders.jvm.enabled", matchIfMissing = true)
-public class JvmMetricsAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public JvmGcMetrics jvmGcMetrics() {
- return new JvmGcMetrics();
- }
-
- @Bean
- @ConditionalOnMissingBean
- public JvmMemoryMetrics jvmMemoryMetrics() {
- return new JvmMemoryMetrics();
- }
-
- @Bean
- @ConditionalOnMissingBean
- public JvmThreadMetrics jvmThreadMetrics() {
- return new JvmThreadMetrics();
- }
-
- @Bean
- @ConditionalOnMissingBean
- public ClassLoaderMetrics classLoaderMetrics() {
- return new ClassLoaderMetrics();
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/Log4J2MetricsAutoConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/Log4J2MetricsAutoConfiguration.java
deleted file mode 100644
index 9b7af4ab03..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/Log4J2MetricsAutoConfiguration.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.binder.logging.Log4j2Metrics;
-import org.apache.logging.log4j.core.LoggerContext;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for Log4J2 metrics.
- *
- * @author Jon Schneider
- * @author Andy Wilkinson
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnClass({ Log4j2Metrics.class, LoggerContext.class })
-@ConditionalOnBean(MeterRegistry.class)
-@ConditionalOnProperty(value = "management.metrics.binders.log4j2.enabled", matchIfMissing = true)
-public class Log4J2MetricsAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public Log4j2Metrics log4j2Metrics() {
- return new Log4j2Metrics();
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/LogbackMetricsAutoConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/LogbackMetricsAutoConfiguration.java
deleted file mode 100644
index 333df7a9ec..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/LogbackMetricsAutoConfiguration.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionMessage;
-import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ConditionContext;
-import org.springframework.context.annotation.Conditional;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.type.AnnotatedTypeMetadata;
-
-import ch.qos.logback.classic.LoggerContext;
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.binder.logging.LogbackMetrics;
-import io.micrometer.spring.autoconfigure.LogbackMetricsAutoConfiguration.LogbackLoggingCondition;
-import org.slf4j.ILoggerFactory;
-import org.slf4j.LoggerFactory;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for Logback metrics.
- *
- * @author Jon Schneider
- * @author Stephane Nicoll
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnClass({ MeterRegistry.class, LoggerContext.class, LoggerFactory.class })
-@ConditionalOnBean(MeterRegistry.class)
-@Conditional(LogbackLoggingCondition.class)
-@ConditionalOnProperty(value = "management.metrics.binders.logback.enabled", matchIfMissing = true)
-public class LogbackMetricsAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public LogbackMetrics logbackMetrics() {
- return new LogbackMetrics();
- }
-
- static class LogbackLoggingCondition extends SpringBootCondition {
-
- @Override
- public ConditionOutcome getMatchOutcome(ConditionContext context,
- AnnotatedTypeMetadata metadata) {
- ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
- ConditionMessage.Builder message = ConditionMessage
- .forCondition("LogbackLoggingCondition");
- if (loggerFactory instanceof LoggerContext) {
- return ConditionOutcome.match(
- message.because("ILoggerFactory is a Logback LoggerContext"));
- }
- return ConditionOutcome
- .noMatch(message.because("ILoggerFactory is an instance of "
- + loggerFactory.getClass().getCanonicalName()));
- }
-
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/MeterRegistryConfigurer.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/MeterRegistryConfigurer.java
deleted file mode 100644
index 77229edef0..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/MeterRegistryConfigurer.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.Metrics;
-import io.micrometer.core.instrument.binder.MeterBinder;
-import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
-import io.micrometer.core.instrument.config.MeterFilter;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.springframework.beans.factory.ObjectProvider;
-
-/**
- * Applies {@link MeterRegistryCustomizer customizers}, {@link MeterFilter filters},
- * {@link MeterBinder binders} and {@link Metrics#addRegistry
- * global registration} to {@link MeterRegistry meter registries}.
- *
- * @author Jon Schneider
- * @author Phillip Webb
- */
-class MeterRegistryConfigurer {
-
- private final ObjectProvider
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import io.micrometer.core.instrument.Meter;
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.lang.NonNullApi;
-
-/**
- * Callback interface that can be used to customize the primary auto-configured {@link MeterRegistry}.
- *
- * Configurers are guaranteed to be applied before any {@link Meter} is registered with
- * the registry.
- *
- * @author Jon Schneider
- */
-@FunctionalInterface
-@NonNullApi
-public interface MeterRegistryCustomizer
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.binder.MeterBinder;
-import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
-import io.micrometer.core.instrument.config.MeterFilter;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.context.ApplicationContext;
-
-import java.util.List;
-
-/**
- * {@link BeanPostProcessor} that delegates to a lazily created
- * {@link MeterRegistryConfigurer} to post-process {@link MeterRegistry} beans.
- *
- * @author Jon Schneider
- * @author Phillip Webb
- * @author Andy Wilkinson
- */
-class MeterRegistryPostProcessor implements BeanPostProcessor {
-
- private final ObjectProvider
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import java.time.Duration;
-import java.util.concurrent.TimeUnit;
-
-import io.micrometer.core.instrument.Meter;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-
-/**
- * A meter value that is used when configuring micrometer. Can be a String representation
- * of either a {@link Long} (applicable to timers and distribution summaries) or a
- * {@link Duration} (applicable to only timers).
- *
- * @author Phillip Webb
- */
-final class MeterValue {
-
- private static final StringToDurationConverter durationConverter = new StringToDurationConverter();
-
- private final Object value;
-
- MeterValue(long value) {
- this.value = value;
- }
-
- MeterValue(Duration value) {
- this.value = value;
- }
-
- /**
- * Return the underlying value of the SLA in form suitable to apply to the given meter
- * type.
- * @param meterType the meter type
- * @return the value or {@code null} if the value cannot be applied
- */
- public Long getValue(Meter.Type meterType) {
- if (meterType == Meter.Type.DISTRIBUTION_SUMMARY) {
- return getDistributionSummaryValue();
- }
- if (meterType == Meter.Type.TIMER) {
- return getTimerValue();
- }
- return null;
- }
-
- private Long getDistributionSummaryValue() {
- if (this.value instanceof Long) {
- return (Long) this.value;
- }
- return null;
- }
-
- private Long getTimerValue() {
- if (this.value instanceof Long) {
- return TimeUnit.MILLISECONDS.toNanos((long) this.value);
- }
- if (this.value instanceof Duration) {
- return ((Duration) this.value).toNanos();
- }
- return null;
- }
-
- /**
- * Return a new {@link MeterValue} instance for the given String value. The value may
- * contain a simple number, or a {@link Duration duration string}.
- * @param value the source value
- * @return a {@link MeterValue} instance
- */
- public static MeterValue valueOf(String value) {
- if (isNumber(value)) {
- return new MeterValue(Long.parseLong(value));
- }
- return new MeterValue(durationConverter.convert(value));
- }
-
- /**
- * Return a new {@link MeterValue} instance for the given long value.
- * @param value the source value
- * @return a {@link MeterValue} instance
- */
- public static MeterValue valueOf(long value) {
- return new MeterValue(value);
- }
-
- private static boolean isNumber(String value) {
- return value.chars().allMatch(Character::isDigit);
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/MetricsAutoConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/MetricsAutoConfiguration.java
deleted file mode 100644
index c4506c8048..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/MetricsAutoConfiguration.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import java.util.List;
-
-import io.micrometer.core.annotation.Timed;
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.binder.MeterBinder;
-import io.micrometer.core.instrument.binder.hystrix.HystrixMetricsBinder;
-import io.micrometer.core.instrument.config.MeterFilter;
-import io.micrometer.spring.integration.SpringIntegrationMetrics;
-import io.micrometer.spring.scheduling.ScheduledMethodMetrics;
-
-import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
-import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.condition.SearchStrategy;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.annotation.Order;
-import org.springframework.integration.config.EnableIntegrationManagement;
-import org.springframework.integration.support.management.IntegrationManagementConfigurer;
-
-/**
- * {@link EnableAutoConfiguration} for Micrometer-based metrics.
- *
- * @author Jon Schneider
- */
-@Configuration
-@ConditionalOnClass(Timed.class)
-@EnableConfigurationProperties(MetricsProperties.class)
-@AutoConfigureAfter({
- DataSourceAutoConfiguration.class,
- RabbitAutoConfiguration.class,
- CacheAutoConfiguration.class
-})
-@AutoConfigureBefore(CompositeMeterRegistryAutoConfiguration.class)
-public class MetricsAutoConfiguration {
- @Bean
- @ConditionalOnMissingBean
- public Clock micrometerClock() {
- return Clock.SYSTEM;
- }
-
- @Bean
- public static MeterRegistryPostProcessor meterRegistryPostProcessor(
- ObjectProvider
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * {@link ConfigurationProperties} for configuring Micrometer-based metrics.
- *
- * @author Jon Schneider
- * @author Alexander Abramov
- */
-@ConfigurationProperties("management.metrics")
-public class MetricsProperties {
-
- private final Web web = new Web();
- private final Distribution distribution = new Distribution();
-
- /**
- * If {@code false}, the matching meter(s) are no-op.
- */
- private final Map
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.context.annotation.Bean;
-
-/**
- * Configuration for a no-op meter registry when the context does not contain an
- * auto-configured {@link MeterRegistry}.
- *
- * @author Andy Wilkinson
- */
-@ConditionalOnBean(Clock.class)
-@ConditionalOnMissingBean(MeterRegistry.class)
-class NoOpMeterRegistryConfiguration {
-
- @Bean
- public CompositeMeterRegistry noOpMeterRegistry(Clock clock) {
- return new CompositeMeterRegistry(clock);
- }
-}
\ No newline at end of file
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/OnlyOnceLoggingDenyMeterFilter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/OnlyOnceLoggingDenyMeterFilter.java
deleted file mode 100644
index bd1e0845c1..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/OnlyOnceLoggingDenyMeterFilter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.function.Supplier;
-
-import org.springframework.util.Assert;
-
-import io.micrometer.core.instrument.Meter;
-import io.micrometer.core.instrument.config.MeterFilter;
-import io.micrometer.core.instrument.config.MeterFilterReply;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * {@link MeterFilter} to log only once a warning message and deny a {@link Meter}
- * {@link Meter.Id}.
- *
- * @author Jon Schneider
- * @author Dmytro Nosan
- */
-public final class OnlyOnceLoggingDenyMeterFilter implements MeterFilter {
-
- private static final Log logger = LogFactory
- .getLog(OnlyOnceLoggingDenyMeterFilter.class);
-
- private final AtomicBoolean alreadyWarned = new AtomicBoolean(false);
-
- private final Supplier
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import io.micrometer.core.instrument.Meter;
-import io.micrometer.core.instrument.Meter.Id;
-import io.micrometer.core.instrument.Tag;
-import io.micrometer.core.instrument.Tags;
-import io.micrometer.core.instrument.config.MeterFilter;
-import io.micrometer.core.instrument.config.MeterFilterReply;
-import io.micrometer.core.instrument.distribution.DistributionStatisticConfig;
-import io.micrometer.spring.autoconfigure.MetricsProperties.Distribution;
-import org.springframework.util.Assert;
-import org.springframework.util.StringUtils;
-
-import java.util.Arrays;
-import java.util.Map;
-import java.util.Objects;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
-
-/**
- * {@link MeterFilter} to apply settings from {@link MetricsProperties}.
- *
- * @author Jon Schneider
- * @author Phillip Webb
- * @author Stephane Nicoll
- * @author Artsiom Yudovin
- * @author Alexander Abramov
- */
-public class PropertiesMeterFilter implements MeterFilter {
-
- private final MetricsProperties properties;
-
- private final MeterFilter mapFilter;
-
- public PropertiesMeterFilter(MetricsProperties properties) {
- Assert.notNull(properties, "Properties must not be null");
- this.properties = properties;
- this.mapFilter = createMapFilter(properties.getTags());
- }
-
- private static MeterFilter createMapFilter(Map
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import io.micrometer.core.instrument.Meter;
-
-import java.time.Duration;
-
-/**
- * A service level agreement boundary for use when configuring Micrometer. Can be
- * specified as either a {@link Long} (applicable to timers and distribution summaries) or
- * a {@link Duration} (applicable to only timers).
- *
- * @author Phillip Webb
- */
-public final class ServiceLevelAgreementBoundary {
-
- private final MeterValue value;
-
- ServiceLevelAgreementBoundary(MeterValue value) {
- this.value = value;
- }
-
- /**
- * Return the underlying value of the SLA in form suitable to apply to the given meter
- * type.
- * @param meterType the meter type
- * @return the value or {@code null} if the value cannot be applied
- */
- public Long getValue(Meter.Type meterType) {
- return this.value.getValue(meterType);
- }
-
- /**
- * Return a new {@link ServiceLevelAgreementBoundary} instance for the given long
- * value.
- * @param value the source value
- * @return a {@link ServiceLevelAgreementBoundary} instance
- */
- public static ServiceLevelAgreementBoundary valueOf(long value) {
- return new ServiceLevelAgreementBoundary(MeterValue.valueOf(value));
- }
-
- /**
- * Return a new {@link ServiceLevelAgreementBoundary} instance for the given long
- * value.
- * @param value the source value
- * @return a {@link ServiceLevelAgreementBoundary} instance
- */
- public static ServiceLevelAgreementBoundary valueOf(String value) {
- return new ServiceLevelAgreementBoundary(MeterValue.valueOf(value));
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/SystemMetricsAutoConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/SystemMetricsAutoConfiguration.java
deleted file mode 100644
index 9dabf5a3e9..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/SystemMetricsAutoConfiguration.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure;
-
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.binder.system.FileDescriptorMetrics;
-import io.micrometer.core.instrument.binder.system.ProcessorMetrics;
-import io.micrometer.core.instrument.binder.system.UptimeMetrics;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for system metrics.
- *
- * @author Jon Schneider
- * @author Stephane Nicoll
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnClass(MeterRegistry.class)
-@ConditionalOnBean(MeterRegistry.class)
-public class SystemMetricsAutoConfiguration {
-
- @Bean
- @ConditionalOnProperty(value = "management.metrics.binders.uptime.enabled", matchIfMissing = true)
- @ConditionalOnMissingBean
- public UptimeMetrics uptimeMetrics() {
- return new UptimeMetrics();
- }
-
- @Bean
- @ConditionalOnProperty(value = "management.metrics.binders.processor.enabled", matchIfMissing = true)
- @ConditionalOnMissingBean
- public ProcessorMetrics processorMetrics() {
- return new ProcessorMetrics();
- }
-
- @Bean
- @ConditionalOnProperty(name = "management.metrics.binders.files.enabled", matchIfMissing = true)
- @ConditionalOnMissingBean
- public FileDescriptorMetrics fileDescriptorMetrics() {
- return new FileDescriptorMetrics();
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/cache/CacheMeterBinderProvidersConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/cache/CacheMeterBinderProvidersConfiguration.java
deleted file mode 100644
index 2463b1e16d..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/cache/CacheMeterBinderProvidersConfiguration.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2012-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.micrometer.spring.autoconfigure.cache;
-
-import com.hazelcast.core.Hazelcast;
-import com.hazelcast.spring.cache.HazelcastCache;
-import io.micrometer.core.instrument.binder.MeterBinder;
-import io.micrometer.spring.cache.*;
-import net.sf.ehcache.Ehcache;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.cache.caffeine.CaffeineCache;
-import org.springframework.cache.ehcache.EhCacheCache;
-import org.springframework.cache.jcache.JCacheCache;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * Configure {@link CacheMeterBinderProvider} beans.
- *
- * @author Stephane Nicoll
- */
-@Configuration
-@ConditionalOnClass(MeterBinder.class)
-class CacheMeterBinderProvidersConfiguration {
-
- @Configuration
- @ConditionalOnClass({CaffeineCache.class,
- com.github.benmanes.caffeine.cache.Cache.class})
- static class CaffeineCacheMeterBinderProviderConfiguration {
-
- @Bean
- public CaffeineCacheMeterBinderProvider caffeineCacheMeterBinderProvider() {
- return new CaffeineCacheMeterBinderProvider();
- }
-
- }
-
- @Configuration
- @ConditionalOnClass({EhCacheCache.class, Ehcache.class})
- static class EhCache2CacheMeterBinderProviderConfiguration {
-
- @Bean
- public EhCache2CacheMeterBinderProvider ehCache2CacheMeterBinderProvider() {
- return new EhCache2CacheMeterBinderProvider();
- }
-
- }
-
- @Configuration
- @ConditionalOnClass({HazelcastCache.class, Hazelcast.class})
- static class HazelcastCacheMeterBinderProviderConfiguration {
-
- @Bean
- public HazelcastCacheMeterBinderProvider hazelcastCacheMeterBinderProvider() {
- return new HazelcastCacheMeterBinderProvider();
- }
-
- }
-
- @Configuration
- @ConditionalOnClass({JCacheCache.class, javax.cache.CacheManager.class})
- static class JCacheCacheMeterBinderProviderConfiguration {
-
- @Bean
- public JCacheCacheMeterBinderProvider jCacheCacheMeterBinderProvider() {
- return new JCacheCacheMeterBinderProvider();
- }
-
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/cache/CacheMetricsAutoConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/cache/CacheMetricsAutoConfiguration.java
deleted file mode 100644
index 6b369fec5e..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/cache/CacheMetricsAutoConfiguration.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2012-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.micrometer.spring.autoconfigure.cache;
-
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.cache.Cache;
-import org.springframework.cache.CacheManager;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for metrics on all available
- * {@link Cache caches}.
- *
- * @author Stephane Nicoll
- * @since 1.2.0
- */
-@Configuration
-@AutoConfigureAfter({MetricsAutoConfiguration.class, CacheAutoConfiguration.class})
-@ConditionalOnBean(CacheManager.class)
-@Import({CacheMeterBinderProvidersConfiguration.class,
- CacheMetricsRegistrarConfiguration.class})
-public class CacheMetricsAutoConfiguration {
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/cache/CacheMetricsRegistrarConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/cache/CacheMetricsRegistrarConfiguration.java
deleted file mode 100644
index 86f35e4149..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/cache/CacheMetricsRegistrarConfiguration.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2012-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.micrometer.spring.autoconfigure.cache;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.Tag;
-import io.micrometer.spring.cache.CacheMeterBinderProvider;
-import io.micrometer.spring.cache.CacheMetricsRegistrar;
-import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.cache.Cache;
-import org.springframework.cache.CacheManager;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Conditional;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.util.StringUtils;
-
-import javax.annotation.PostConstruct;
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * Configure a {@link CacheMetricsRegistrar} and register all available {@link Cache
- * caches}.
- *
- * @author Stephane Nicoll
- * @author Johnny Lim
- */
-@Configuration
-@Conditional(CacheMetricsRegistrarConfiguration.CacheMetricsRegistrarConditionalOnBeans.class)
-class CacheMetricsRegistrarConfiguration {
-
- private static final String CACHE_MANAGER_SUFFIX = "cacheManager";
-
- private final MeterRegistry registry;
-
- private final CacheMetricsRegistrar cacheMetricsRegistrar;
-
- private final Map
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export;
-
-import io.micrometer.core.instrument.util.StringUtils;
-import io.micrometer.core.lang.Nullable;
-import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
-import org.springframework.core.annotation.Order;
-import org.springframework.core.convert.converter.Converter;
-
-import java.time.Duration;
-import java.time.format.DateTimeParseException;
-import java.util.Optional;
-import java.util.function.Function;
-
-/**
- * A {@link Converter} to create a {@link Duration} from a {@link String}.
- *
- * @author Jon Schneider
- * @author Andy Wilkinson
- */
-@ConfigurationPropertiesBinding
-@Order(0)
-public class StringToDurationConverter implements Converter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export;
-
-import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
-import org.springframework.core.annotation.Order;
-import org.springframework.core.convert.converter.Converter;
-
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author Nicolas Portmann
- */
-@ConfigurationPropertiesBinding
-@Order(0)
-public class StringToTimeUnitConverter implements Converter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.appoptics;
-
-import io.micrometer.appoptics.AppOpticsConfig;
-import io.micrometer.appoptics.AppOpticsMeterRegistry;
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to AppOptics.
- *
- * @author Hunter Sherman
- * @author Stephane Nicoll
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureBefore({ CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class })
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(AppOpticsMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.appoptics", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(AppOpticsProperties.class)
-@Import(StringToDurationConverter.class)
-public class AppOpticsMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public AppOpticsConfig appOpticsConfig(AppOpticsProperties appOpticsProperties) {
- return new AppOpticsPropertiesConfigAdapter(appOpticsProperties);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public AppOpticsMeterRegistry appOpticsMeterRegistry(AppOpticsConfig config,
- Clock clock) {
- return new AppOpticsMeterRegistry(config, clock);
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/appoptics/AppOpticsProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/appoptics/AppOpticsProperties.java
deleted file mode 100644
index a4cb5d6277..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/appoptics/AppOpticsProperties.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.appoptics;
-
-import java.time.Duration;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring AppOptics metrics export.
- *
- * @author Hunter Sherman
- * @author Stephane Nicoll
- * @since 1.1.0
- */
-@ConfigurationProperties(prefix = "management.metrics.export.appoptics")
-public class AppOpticsProperties extends StepRegistryProperties {
-
- /**
- * URI to ship metrics to.
- */
- private String uri = "https://api.appoptics.com/v1/measurements";
-
- /**
- * AppOptics API token.
- */
- private String apiToken;
-
- /**
- * Tag that will be mapped to "@host" when shipping metrics to AppOptics.
- */
- private String hostTag = "instance";
-
- /**
- * Number of measurements per request to use for this backend. If more measurements
- * are found, then multiple requests will be made.
- */
- private Integer batchSize = 500;
-
- /**
- * Connection timeout for requests to this backend.
- */
- private Duration connectTimeout = Duration.ofSeconds(5);
-
- public String getUri() {
- return this.uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-
- public String getApiToken() {
- return this.apiToken;
- }
-
- public void setApiToken(String apiToken) {
- this.apiToken = apiToken;
- }
-
- public String getHostTag() {
- return this.hostTag;
- }
-
- public void setHostTag(String hostTag) {
- this.hostTag = hostTag;
- }
-
- @Override
- public Integer getBatchSize() {
- return this.batchSize;
- }
-
- @Override
- public void setBatchSize(Integer batchSize) {
- this.batchSize = batchSize;
- }
-
- @Override
- public Duration getConnectTimeout() {
- return this.connectTimeout;
- }
-
- @Override
- public void setConnectTimeout(Duration connectTimeout) {
- this.connectTimeout = connectTimeout;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/appoptics/AppOpticsPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/appoptics/AppOpticsPropertiesConfigAdapter.java
deleted file mode 100644
index fe14b4335c..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/appoptics/AppOpticsPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.appoptics;
-
-import io.micrometer.appoptics.AppOpticsConfig;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-
-/**
- * Adapter to convert {@link AppOpticsProperties} to an {@link AppOpticsConfig}.
- *
- * @author Hunter Sherman
- * @author Stephane Nicoll
- */
-class AppOpticsPropertiesConfigAdapter
- extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.atlas;
-
-import com.netflix.spectator.atlas.AtlasConfig;
-import io.micrometer.atlas.AtlasMeterRegistry;
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to Atlas.
- *
- * @author Jon Schneider
- * @author Andy Wilkinson
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(AtlasMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.atlas", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(AtlasProperties.class)
-@Import(StringToDurationConverter.class)
-public class AtlasMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean(AtlasConfig.class)
- public AtlasConfig atlasConfig(AtlasProperties atlasProperties) {
- return new AtlasPropertiesConfigAdapter(atlasProperties);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public AtlasMeterRegistry atlasMeterRegistry(AtlasConfig config, Clock clock) {
- return new AtlasMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/atlas/AtlasProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/atlas/AtlasProperties.java
deleted file mode 100644
index 278ec1d45d..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/atlas/AtlasProperties.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.atlas;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.time.Duration;
-
-/**
- * {@link ConfigurationProperties} for configuring Atlas metrics export.
- *
- * @author Jon Schneider
- */
-@ConfigurationProperties(prefix = "management.metrics.export.atlas")
-public class AtlasProperties extends StepRegistryProperties {
-
- /**
- * URI of the Atlas server.
- */
- private String uri = "http://localhost:7101/api/v1/publish";
-
- /**
- * Time to live for meters that do not have any activity. After this period the meter
- * will be considered expired and will not get reported.
- */
- private Duration meterTimeToLive = Duration.ofMinutes(15);
-
- /**
- * Whether to enable streaming to Atlas LWC.
- */
- private boolean lwcEnabled;
-
- /**
- * Frequency for refreshing config settings from the LWC service.
- */
- private Duration configRefreshFrequency = Duration.ofSeconds(10);
-
- /**
- * Time to live for subscriptions from the LWC service.
- */
- private Duration configTimeToLive = Duration.ofSeconds(150);
-
- /**
- * URI for the Atlas LWC endpoint to retrieve current subscriptions.
- */
- private String configUri = "http://localhost:7101/lwc/api/v1/expressions/local-dev";
-
- /**
- * URI for the Atlas LWC endpoint to evaluate the data for a subscription.
- */
- private String evalUri = "http://localhost:7101/lwc/api/v1/evaluate";
-
- public String getUri() {
- return this.uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-
- public Duration getMeterTimeToLive() {
- return this.meterTimeToLive;
- }
-
- public void setMeterTimeToLive(Duration meterTimeToLive) {
- this.meterTimeToLive = meterTimeToLive;
- }
-
- public boolean isLwcEnabled() {
- return this.lwcEnabled;
- }
-
- public void setLwcEnabled(boolean lwcEnabled) {
- this.lwcEnabled = lwcEnabled;
- }
-
- public Duration getConfigRefreshFrequency() {
- return this.configRefreshFrequency;
- }
-
- public void setConfigRefreshFrequency(Duration configRefreshFrequency) {
- this.configRefreshFrequency = configRefreshFrequency;
- }
-
- public Duration getConfigTimeToLive() {
- return this.configTimeToLive;
- }
-
- public void setConfigTimeToLive(Duration configTimeToLive) {
- this.configTimeToLive = configTimeToLive;
- }
-
- public String getConfigUri() {
- return this.configUri;
- }
-
- public void setConfigUri(String configUri) {
- this.configUri = configUri;
- }
-
- public String getEvalUri() {
- return this.evalUri;
- }
-
- public void setEvalUri(String evalUri) {
- this.evalUri = evalUri;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/atlas/AtlasPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/atlas/AtlasPropertiesConfigAdapter.java
deleted file mode 100644
index e9eece5b28..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/atlas/AtlasPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.atlas;
-
-import com.netflix.spectator.atlas.AtlasConfig;
-import io.micrometer.spring.autoconfigure.export.properties.PropertiesConfigAdapter;
-
-import java.time.Duration;
-
-/**
- * Adapter to convert {@link AtlasProperties} to an {@link AtlasConfig}.
- *
- * @author Jon Schneider
- * @author Phillip Webb
- */
-class AtlasPropertiesConfigAdapter extends PropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.azuremonitor;
-
-import com.microsoft.applicationinsights.TelemetryConfiguration;
-import io.micrometer.azuremonitor.AzureMonitorConfig;
-import io.micrometer.azuremonitor.AzureMonitorMeterRegistry;
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.core.instrument.util.StringUtils;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Auto-configuration for exporting metrics to Azure Monitor.
- *
- * @author Dhaval Doshi
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(AzureMonitorMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.azuremonitor", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(AzureMonitorProperties.class)
-@Import(StringToDurationConverter.class)
-public class AzureMonitorMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public AzureMonitorConfig azureMonitorConfig(AzureMonitorProperties properties) {
- return new AzureMonitorPropertiesConfigAdapter(properties);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public TelemetryConfiguration telemetryConfiguration(AzureMonitorConfig config) {
- // Gets the active instance of TelemetryConfiguration either created by starter or xml
- TelemetryConfiguration telemetryConfiguration = TelemetryConfiguration.getActive();
- if (StringUtils.isEmpty(telemetryConfiguration.getInstrumentationKey())) {
- telemetryConfiguration.setInstrumentationKey(config.instrumentationKey());
- }
- return telemetryConfiguration;
- }
-
- @Bean
- @ConditionalOnMissingBean
- public AzureMonitorMeterRegistry azureMeterRegistry(AzureMonitorConfig config, TelemetryConfiguration configuration, Clock clock) {
- return AzureMonitorMeterRegistry.builder(config)
- .clock(clock)
- .telemetryConfiguration(configuration)
- .build();
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/azuremonitor/AzureMonitorProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/azuremonitor/AzureMonitorProperties.java
deleted file mode 100644
index c6a2c416a7..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/azuremonitor/AzureMonitorProperties.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.azuremonitor;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring Azure Monitor metrics export.
- *
- * @author Dhaval Doshi
- * @since 1.1.0
- */
-@ConfigurationProperties(prefix = "management.metrics.export.azuremonitor")
-public class AzureMonitorProperties extends StepRegistryProperties {
-
- /**
- * Instrumentation key.
- */
- private String instrumentationKey;
-
- public String getInstrumentationKey() {
- return this.instrumentationKey;
- }
-
- public void setInstrumentationKey(String instrumentationKey) {
- this.instrumentationKey = instrumentationKey;
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/azuremonitor/AzureMonitorPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/azuremonitor/AzureMonitorPropertiesConfigAdapter.java
deleted file mode 100644
index 05499dcabe..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/azuremonitor/AzureMonitorPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.azuremonitor;
-
-import io.micrometer.azuremonitor.AzureMonitorConfig;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-
-/**
- * Adapter to convert {@link AzureMonitorProperties} to an {@link AzureMonitorConfig}.
- *
- * @author Dhaval Doshi
- */
-class AzureMonitorPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.datadog;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.datadog.DatadogConfig;
-import io.micrometer.datadog.DatadogMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to Datadog.
- *
- * @author Jon Schneider
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(DatadogMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.datadog", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(DatadogProperties.class)
-@Import(StringToDurationConverter.class)
-public class DatadogMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public DatadogConfig datadogConfig(DatadogProperties props) {
- return new DatadogPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public DatadogMeterRegistry datadogMeterRegistry(DatadogConfig config, Clock clock) {
- return new DatadogMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/datadog/DatadogProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/datadog/DatadogProperties.java
deleted file mode 100644
index 4a682f1d5e..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/datadog/DatadogProperties.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.datadog;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring Datadog metrics export.
- *
- * @author Jon Schneider
- */
-@ConfigurationProperties(prefix = "management.metrics.export.datadog")
-public class DatadogProperties extends StepRegistryProperties {
-
- /**
- * Datadog API key.
- */
- private String apiKey;
-
- /**
- * Datadog application key. Not strictly required, but improves the Datadog experience
- * by sending meter descriptions, types, and base units to Datadog.
- */
- private String applicationKey;
-
- /**
- * Whether to publish descriptions metadata to Datadog. Turn this off to minimize the
- * amount of metadata sent.
- */
- private boolean descriptions = true;
-
- /**
- * Tag that will be mapped to "host" when shipping metrics to Datadog.
- */
- private String hostTag = "instance";
-
- /**
- * URI to ship metrics to. If you need to publish metrics to an internal proxy
- * en-route to Datadog, you can define the location of the proxy with this.
- */
- private String uri = "https://app.datadoghq.com";
-
- public String getApiKey() {
- return this.apiKey;
- }
-
- public void setApiKey(String apiKey) {
- this.apiKey = apiKey;
- }
-
- public String getApplicationKey() {
- return this.applicationKey;
- }
-
- public void setApplicationKey(String applicationKey) {
- this.applicationKey = applicationKey;
- }
-
- public boolean isDescriptions() {
- return this.descriptions;
- }
-
- public void setDescriptions(boolean descriptions) {
- this.descriptions = descriptions;
- }
-
- public String getHostTag() {
- return this.hostTag;
- }
-
- public void setHostTag(String hostTag) {
- this.hostTag = hostTag;
- }
-
- public String getUri() {
- return this.uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/datadog/DatadogPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/datadog/DatadogPropertiesConfigAdapter.java
deleted file mode 100644
index a046bf3816..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/datadog/DatadogPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.datadog;
-
-import io.micrometer.datadog.DatadogConfig;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-
-/**
- * Adapter to convert {@link DatadogProperties} to a {@link DatadogConfig}.
- *
- * @author Jon Schneider
- * @author Phillip Webb
- */
-class DatadogPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.dynatrace;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.dynatrace.DynatraceConfig;
-import io.micrometer.dynatrace.DynatraceMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to Dynatrace.
- *
- * @author Oriol Barcelona
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(DynatraceMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.dynatrace", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(DynatraceProperties.class)
-@Import(StringToDurationConverter.class)
-public class DynatraceMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public DynatraceConfig dynatraceConfig(DynatraceProperties props) {
- return new DynatracePropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public DynatraceMeterRegistry dynatraceMeterRegistry(DynatraceConfig config, Clock clock) {
- return new DynatraceMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/dynatrace/DynatraceProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/dynatrace/DynatraceProperties.java
deleted file mode 100644
index edd7478285..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/dynatrace/DynatraceProperties.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.dynatrace;
-
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring Dynatrace metrics export.
- *
- * @author Oriol Barcelona
- */
-@ConfigurationProperties(prefix = "management.metrics.export.dynatrace")
-public class DynatraceProperties extends StepRegistryProperties {
-
- /**
- * Dynatrace authentication token.
- */
- private String apiToken;
-
- /**
- * ID of the custom device that is exporting metrics to Dynatrace.
- */
- private String deviceId;
-
- /**
- * Technology type for exported metrics. Used to group metrics under a logical
- * technology name in the Dynatrace UI.
- */
- private String technologyType = "java";
-
- /**
- * URI to ship metrics to. Should be used for SaaS, self managed instances or to
- * en-route through an internal proxy.
- */
- private String uri;
-
- /**
- * Group for exported metrics. Used to name custom device group in the Dynatrace UI.
- */
- private String group;
-
- public String getApiToken() {
- return this.apiToken;
- }
-
- public void setApiToken(String apiToken) {
- this.apiToken = apiToken;
- }
-
- public String getDeviceId() {
- return this.deviceId;
- }
-
- public void setDeviceId(String deviceId) {
- this.deviceId = deviceId;
- }
-
- public String getTechnologyType() {
- return this.technologyType;
- }
-
- public void setTechnologyType(String technologyType) {
- this.technologyType = technologyType;
- }
-
- public String getUri() {
- return this.uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-
- public String getGroup() {
- return group;
- }
-
- public void setGroup(String group) {
- this.group = group;
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/dynatrace/DynatracePropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/dynatrace/DynatracePropertiesConfigAdapter.java
deleted file mode 100644
index a69193f73b..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/dynatrace/DynatracePropertiesConfigAdapter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.dynatrace;
-
-import io.micrometer.dynatrace.DynatraceConfig;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-
-/**
- * Adapter to convert {@link DynatraceProperties} to a {@link io.micrometer.dynatrace.DynatraceConfig}.
- *
- * @author Oriol Barcelona
- */
-class DynatracePropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.elastic;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.elastic.ElasticConfig;
-import io.micrometer.elastic.ElasticMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to Elastic.
- *
- * @author Nicolas Portmann
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(ElasticMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.elastic", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(ElasticProperties.class)
-@Import(StringToDurationConverter.class)
-public class ElasticMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public ElasticConfig elasticConfig(ElasticProperties props) {
- return new ElasticPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public ElasticMeterRegistry elasticMeterRegistry(ElasticConfig config, Clock clock) {
- return new ElasticMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/elastic/ElasticProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/elastic/ElasticProperties.java
deleted file mode 100644
index 50c4cc3560..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/elastic/ElasticProperties.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.elastic;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring Elastic metrics export.
- *
- * @author Nicolas Portmann
- * @since 1.1.0
- */
-@ConfigurationProperties(prefix = "management.metrics.export.elastic")
-public class ElasticProperties extends StepRegistryProperties {
-
- /**
- * Host to export metrics to.
- */
- private String host = "http://localhost:9200";
-
- /**
- * Index to export metrics to.
- */
- private String index = "metrics";
-
- /**
- * Index date format used for rolling indices. Appended to the index name, preceded by
- * a '-'.
- */
- private String indexDateFormat = "yyyy-MM";
-
- /**
- * Name of the timestamp field.
- */
- private String timestampFieldName = "@timestamp";
-
- /**
- * Whether to create the index automatically if it does not exist.
- */
- private boolean autoCreateIndex = true;
-
- /**
- * Login user of the Elastic server.
- */
- private String userName = "";
-
- /**
- * Login password of the Elastic server.
- */
- private String password = "";
-
- /**
- * Ingest pipeline name.
- */
- private String pipeline = "";
-
- /**
- * Separator between the index name and the date part.
- */
- private String indexDateSeparator = "-";
-
- public String getHost() {
- return this.host;
- }
-
- public void setHost(String host) {
- this.host = host;
- }
-
- public String getIndex() {
- return this.index;
- }
-
- public void setIndex(String index) {
- this.index = index;
- }
-
- public String getIndexDateFormat() {
- return this.indexDateFormat;
- }
-
- public void setIndexDateFormat(String indexDateFormat) {
- this.indexDateFormat = indexDateFormat;
- }
-
- public String getTimestampFieldName() {
- return this.timestampFieldName;
- }
-
- public void setTimestampFieldName(String timestampFieldName) {
- this.timestampFieldName = timestampFieldName;
- }
-
- public boolean isAutoCreateIndex() {
- return this.autoCreateIndex;
- }
-
- public void setAutoCreateIndex(boolean autoCreateIndex) {
- this.autoCreateIndex = autoCreateIndex;
- }
-
- public String getUserName() {
- return this.userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getPassword() {
- return this.password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getPipeline() {
- return this.pipeline;
- }
-
- public void setPipeline(String pipeline) {
- this.pipeline = pipeline;
- }
-
- public String getIndexDateSeparator() {
- return this.indexDateSeparator;
- }
-
- public void setIndexDateSeparator(String indexDateSeparator) {
- this.indexDateSeparator = indexDateSeparator;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/elastic/ElasticPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/elastic/ElasticPropertiesConfigAdapter.java
deleted file mode 100644
index c761287366..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/elastic/ElasticPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.elastic;
-
-import io.micrometer.elastic.ElasticConfig;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-
-/**
- * Adapter to convert {@link ElasticProperties} to an {@link ElasticConfig}.
- *
- * @author Nicolas Portmann
- */
-class ElasticPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.ganglia;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.ganglia.GangliaConfig;
-import io.micrometer.ganglia.GangliaMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to Ganglia.
- *
- * @author Jon Schneider
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(GangliaMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.ganglia", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(GangliaProperties.class)
-@Import(StringToDurationConverter.class)
-public class GangliaMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public GangliaConfig gangliaConfig(GangliaProperties props) {
- return new GangliaPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public GangliaMeterRegistry gangliaMeterRegistry(GangliaConfig config, Clock clock) {
- return new GangliaMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/ganglia/GangliaProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/ganglia/GangliaProperties.java
deleted file mode 100644
index f04e98bc8e..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/ganglia/GangliaProperties.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.ganglia;
-
-import info.ganglia.gmetric4j.gmetric.GMetric;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.time.Duration;
-import java.util.concurrent.TimeUnit;
-
-/**
- * {@link ConfigurationProperties} for configuring Ganglia metrics export.
- *
- * @author Jon Schneider
- */
-@ConfigurationProperties(prefix = "management.metrics.export.ganglia")
-public class GangliaProperties {
-
- /**
- * Whether exporting of metrics to Ganglia is enabled.
- */
- private boolean enabled = true;
-
- /**
- * Step size (i.e. reporting frequency) to use.
- */
- private Duration step = Duration.ofMinutes(1);
-
- /**
- * Base time unit used to report rates.
- */
- private TimeUnit rateUnits = TimeUnit.SECONDS;
-
- /**
- * Base time unit used to report durations.
- */
- private TimeUnit durationUnits = TimeUnit.MILLISECONDS;
-
- /**
- * Ganglia protocol version. Must be either 3.1 or 3.0.
- */
- private String protocolVersion = "3.1";
-
- /**
- * UDP addressing mode, either unicast or multicast.
- */
- private GMetric.UDPAddressingMode addressingMode = GMetric.UDPAddressingMode.MULTICAST;
-
- /**
- * Time to live for metrics on Ganglia. Set the multi-cast Time-To-Live to be one
- * greater than the number of hops (routers) between the hosts.
- */
- private Integer timeToLive = 1;
-
- /**
- * Host of the Ganglia server to receive exported metrics.
- */
- private String host = "localhost";
-
- /**
- * Port of the Ganglia server to receive exported metrics.
- */
- private Integer port = 8649;
-
- public boolean isEnabled() {
- return this.enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- public Duration getStep() {
- return this.step;
- }
-
- public void setStep(Duration step) {
- this.step = step;
- }
-
- public TimeUnit getRateUnits() {
- return this.rateUnits;
- }
-
- public void setRateUnits(TimeUnit rateUnits) {
- this.rateUnits = rateUnits;
- }
-
- public TimeUnit getDurationUnits() {
- return this.durationUnits;
- }
-
- public void setDurationUnits(TimeUnit durationUnits) {
- this.durationUnits = durationUnits;
- }
-
- public String getProtocolVersion() {
- return this.protocolVersion;
- }
-
- public void setProtocolVersion(String protocolVersion) {
- this.protocolVersion = protocolVersion;
- }
-
- public GMetric.UDPAddressingMode getAddressingMode() {
- return this.addressingMode;
- }
-
- public void setAddressingMode(GMetric.UDPAddressingMode addressingMode) {
- this.addressingMode = addressingMode;
- }
-
- public Integer getTimeToLive() {
- return this.timeToLive;
- }
-
- public void setTimeToLive(Integer timeToLive) {
- this.timeToLive = timeToLive;
- }
-
- public String getHost() {
- return this.host;
- }
-
- public void setHost(String host) {
- this.host = host;
- }
-
- public Integer getPort() {
- return this.port;
- }
-
- public void setPort(Integer port) {
- this.port = port;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/ganglia/GangliaPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/ganglia/GangliaPropertiesConfigAdapter.java
deleted file mode 100644
index 8bdc4daf6d..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/ganglia/GangliaPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.ganglia;
-
-import info.ganglia.gmetric4j.gmetric.GMetric;
-import io.micrometer.ganglia.GangliaConfig;
-import io.micrometer.spring.autoconfigure.export.properties.PropertiesConfigAdapter;
-
-import java.time.Duration;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Adapter to convert {@link GangliaProperties} to a {@link GangliaConfig}.
- *
- * @author Jon Schneider
- * @author Phillip Webb
- */
-class GangliaPropertiesConfigAdapter extends PropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.graphite;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.graphite.GraphiteConfig;
-import io.micrometer.graphite.GraphiteMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to Graphite.
- *
- * @author Jon Schneider
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(GraphiteMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.graphite", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(GraphiteProperties.class)
-@Import(StringToDurationConverter.class)
-public class GraphiteMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public GraphiteConfig graphiteConfig(GraphiteProperties props) {
- return new GraphitePropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public GraphiteMeterRegistry graphiteMeterRegistry(GraphiteConfig config, Clock clock) {
- return new GraphiteMeterRegistry(config, clock);
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/graphite/GraphiteProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/graphite/GraphiteProperties.java
deleted file mode 100644
index c6f4ad3891..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/graphite/GraphiteProperties.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.graphite;
-
-import io.micrometer.graphite.GraphiteProtocol;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.time.Duration;
-import java.util.concurrent.TimeUnit;
-
-/**
- * {@link ConfigurationProperties} for configuring Graphite metrics export.
- *
- * @author Jon Schneider
- */
-@ConfigurationProperties(prefix = "management.metrics.export.graphite")
-public class GraphiteProperties {
-
- /**
- * Whether exporting of metrics to Graphite is enabled.
- */
- private boolean enabled = true;
-
- /**
- * Step size (i.e. reporting frequency) to use.
- */
- private Duration step = Duration.ofMinutes(1);
-
- /**
- * Base time unit used to report rates.
- */
- private TimeUnit rateUnits = TimeUnit.SECONDS;
-
- /**
- * Base time unit used to report durations.
- */
- private TimeUnit durationUnits = TimeUnit.MILLISECONDS;
-
- /**
- * Host of the Graphite server to receive exported metrics.
- */
- private String host = "localhost";
-
- /**
- * Port of the Graphite server to receive exported metrics.
- */
- private Integer port = 2004;
-
- /**
- * Protocol to use while shipping data to Graphite.
- */
- private GraphiteProtocol protocol = GraphiteProtocol.PICKLED;
-
- /**
- * For the default naming convention, turn the specified tag keys into part of the
- * metric prefix.
- */
- private String[] tagsAsPrefix = new String[0];
-
- public boolean isEnabled() {
- return this.enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- public Duration getStep() {
- return this.step;
- }
-
- public void setStep(Duration step) {
- this.step = step;
- }
-
- public TimeUnit getRateUnits() {
- return this.rateUnits;
- }
-
- public void setRateUnits(TimeUnit rateUnits) {
- this.rateUnits = rateUnits;
- }
-
- public TimeUnit getDurationUnits() {
- return this.durationUnits;
- }
-
- public void setDurationUnits(TimeUnit durationUnits) {
- this.durationUnits = durationUnits;
- }
-
- public String getHost() {
- return this.host;
- }
-
- public void setHost(String host) {
- this.host = host;
- }
-
- public Integer getPort() {
- return this.port;
- }
-
- public void setPort(Integer port) {
- this.port = port;
- }
-
- public GraphiteProtocol getProtocol() {
- return this.protocol;
- }
-
- public void setProtocol(GraphiteProtocol protocol) {
- this.protocol = protocol;
- }
-
- public String[] getTagsAsPrefix() {
- return this.tagsAsPrefix;
- }
-
- public void setTagsAsPrefix(String[] tagsAsPrefix) {
- this.tagsAsPrefix = tagsAsPrefix;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/graphite/GraphitePropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/graphite/GraphitePropertiesConfigAdapter.java
deleted file mode 100644
index 504739a630..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/graphite/GraphitePropertiesConfigAdapter.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.graphite;
-
-import io.micrometer.graphite.GraphiteConfig;
-import io.micrometer.graphite.GraphiteProtocol;
-import io.micrometer.spring.autoconfigure.export.properties.PropertiesConfigAdapter;
-
-import java.time.Duration;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Adapter to convert {@link GraphiteProperties} to a {@link GraphiteConfig}.
- *
- * @author Jon Schneider
- * @author Phillip Webb
- */
-class GraphitePropertiesConfigAdapter extends PropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.humio;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.humio.HumioConfig;
-import io.micrometer.humio.HumioMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to Humio.
- *
- * @author Jon Schneider
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(HumioMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.humio", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(HumioProperties.class)
-@Import(StringToDurationConverter.class)
-public class HumioMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public HumioConfig humioConfig(HumioProperties props) {
- return new HumioPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public HumioMeterRegistry humioMeterRegistry(HumioConfig config, Clock clock) {
- return new HumioMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/humio/HumioProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/humio/HumioProperties.java
deleted file mode 100644
index 0a1629b258..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/humio/HumioProperties.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * Copyright 2018 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.humio;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.time.Duration;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * {@link ConfigurationProperties} for configuring Humio metrics export.
- *
- * @author Jon Schneider
- * @since 1.1.0
- */
-@ConfigurationProperties(prefix = "management.metrics.export.humio")
-public class HumioProperties extends StepRegistryProperties {
-
- /**
- * Humio API token.
- */
- private String apiToken;
-
- /**
- * Connection timeout for requests to Humio.
- */
- private Duration connectTimeout = Duration.ofSeconds(5);
-
- /**
- * Name of the repository to publish metrics to.
- */
- private String repository = "sandbox";
-
- /**
- * Humio tags describing the data source in which metrics will be stored. Humio tags
- * are a distinct concept from Micrometer's tags. Micrometer's tags are used to divide
- * metrics along dimensional boundaries.
- */
- private Map
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.humio;
-
-import io.micrometer.humio.HumioConfig;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-
-import java.util.Map;
-
-/**
- * Adapter to convert {@link HumioProperties} to a {@link HumioConfig}.
- *
- * @author Jon Schneider
- * @since 1.1.0
- */
-class HumioPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.influx;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.influx.InfluxConfig;
-import io.micrometer.influx.InfluxMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to Influx.
- *
- * @author Jon Schneider
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(InfluxMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.influx", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(InfluxProperties.class)
-@Import(StringToDurationConverter.class)
-public class InfluxMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean(InfluxConfig.class)
- public InfluxConfig influxConfig(InfluxProperties props) {
- return new InfluxPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public InfluxMeterRegistry influxMeterRegistry(InfluxConfig config, Clock clock) {
- return new InfluxMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/influx/InfluxProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/influx/InfluxProperties.java
deleted file mode 100644
index 1ab8ea5bb0..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/influx/InfluxProperties.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.influx;
-
-import io.micrometer.influx.InfluxConsistency;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring Influx metrics export.
- *
- * @author Jon Schneider
- */
-@ConfigurationProperties(prefix = "management.metrics.export.influx")
-public class InfluxProperties extends StepRegistryProperties {
-
- /**
- * Tag that will be mapped to "host" when shipping metrics to Influx.
- */
- private String db = "mydb";
-
- /**
- * Write consistency for each point.
- */
- private InfluxConsistency consistency = InfluxConsistency.ONE;
-
- /**
- * Login user of the Influx server.
- */
- private String userName;
-
- /**
- * Login password of the Influx server.
- */
- private String password;
-
- /**
- * Retention policy to use (Influx writes to the DEFAULT retention policy if one is
- * not specified).
- */
- private String retentionPolicy;
-
- /**
- * Time period for which Influx should retain data in the current database. For
- * instance 7d, check the influx documentation for more details on the duration
- * format.
- */
- private String retentionDuration;
-
- /**
- * How many copies of the data are stored in the cluster. Must be 1 for a single node
- * instance.
- */
- private Integer retentionReplicationFactor;
-
- /**
- * Time range covered by a shard group. For instance 2w, check the influx
- * documentation for more details on the duration format.
- */
- private String retentionShardDuration;
-
- /**
- * URI of the Influx server.
- */
- private String uri = "http://localhost:8086";
-
- /**
- * Whether to enable GZIP compression of metrics batches published to Influx.
- */
- private boolean compressed = true;
-
- /**
- * Whether to create the Influx database if it does not exist before attempting to
- * publish metrics to it.
- */
- private boolean autoCreateDb = true;
-
- public String getDb() {
- return this.db;
- }
-
- public void setDb(String db) {
- this.db = db;
- }
-
- public InfluxConsistency getConsistency() {
- return this.consistency;
- }
-
- public void setConsistency(InfluxConsistency consistency) {
- this.consistency = consistency;
- }
-
- public String getUserName() {
- return this.userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getPassword() {
- return this.password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getRetentionPolicy() {
- return this.retentionPolicy;
- }
-
- public void setRetentionPolicy(String retentionPolicy) {
- this.retentionPolicy = retentionPolicy;
- }
-
- public String getRetentionDuration() {
- return this.retentionDuration;
- }
-
- public void setRetentionDuration(String retentionDuration) {
- this.retentionDuration = retentionDuration;
- }
-
- public Integer getRetentionReplicationFactor() {
- return this.retentionReplicationFactor;
- }
-
- public void setRetentionReplicationFactor(Integer retentionReplicationFactor) {
- this.retentionReplicationFactor = retentionReplicationFactor;
- }
-
- public String getRetentionShardDuration() {
- return this.retentionShardDuration;
- }
-
- public void setRetentionShardDuration(String retentionShardDuration) {
- this.retentionShardDuration = retentionShardDuration;
- }
-
- public String getUri() {
- return this.uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-
- public boolean isCompressed() {
- return this.compressed;
- }
-
- public void setCompressed(boolean compressed) {
- this.compressed = compressed;
- }
-
- public boolean isAutoCreateDb() {
- return this.autoCreateDb;
- }
-
- public void setAutoCreateDb(boolean autoCreateDb) {
- this.autoCreateDb = autoCreateDb;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/influx/InfluxPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/influx/InfluxPropertiesConfigAdapter.java
deleted file mode 100644
index 2e05942cab..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/influx/InfluxPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.influx;
-
-import io.micrometer.influx.InfluxConfig;
-import io.micrometer.influx.InfluxConsistency;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-
-/**
- * Adapter to convert {@link InfluxProperties} to an {@link InfluxConfig}.
- *
- * @author Jon Schneider
- * @author Phillip Webb
- */
-class InfluxPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.jmx;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.jmx.JmxConfig;
-import io.micrometer.jmx.JmxMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to JMX.
- *
- * @author Jon Schneider
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(JmxMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.jmx", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(JmxProperties.class)
-@Import(StringToDurationConverter.class)
-public class JmxMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public JmxConfig jmxConfig(JmxProperties props) {
- return new JmxPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public JmxMeterRegistry jmxMeterRegistry(JmxConfig config, Clock clock) {
- return new JmxMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/jmx/JmxProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/jmx/JmxProperties.java
deleted file mode 100644
index 03d7bdab64..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/jmx/JmxProperties.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.jmx;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.time.Duration;
-
-/**
- * {@link ConfigurationProperties} for configuring JMX metrics export.
- *
- * @author Jon Schneider
- */
-@ConfigurationProperties(prefix = "management.metrics.export.jmx")
-public class JmxProperties {
-
- /**
- * Metrics JMX domain name.
- */
- private String domain = "metrics";
-
- /**
- * Step size (i.e. reporting frequency) to use.
- */
- private Duration step = Duration.ofMinutes(1);
-
- public String getDomain() {
- return this.domain;
- }
-
- public void setDomain(String domain) {
- this.domain = domain;
- }
-
- public Duration getStep() {
- return this.step;
- }
-
- public void setStep(Duration step) {
- this.step = step;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/jmx/JmxPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/jmx/JmxPropertiesConfigAdapter.java
deleted file mode 100644
index 57724aedf7..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/jmx/JmxPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.jmx;
-
-import io.micrometer.jmx.JmxConfig;
-import io.micrometer.spring.autoconfigure.export.properties.PropertiesConfigAdapter;
-
-import java.time.Duration;
-
-/**
- * Adapter to convert {@link JmxProperties} to a {@link JmxConfig}.
- *
- * @author Jon Schneider
- */
-class JmxPropertiesConfigAdapter extends PropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.kairos;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.kairos.KairosConfig;
-import io.micrometer.kairos.KairosMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to KairosDB.
- *
- * @author Anton Ilinchik
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(KairosMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.kairos", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(KairosProperties.class)
-@Import(StringToDurationConverter.class)
-public class KairosMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public KairosConfig kairosConfig(KairosProperties props) {
- return new KairosPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public KairosMeterRegistry kairosMeterRegistry(KairosConfig config, Clock clock) {
- return new KairosMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/kairos/KairosProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/kairos/KairosProperties.java
deleted file mode 100644
index 44b1eefe1e..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/kairos/KairosProperties.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright 2018 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.kairos;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring Kairos metrics export.
- *
- * @author Anton Ilinchik
- * @since 1.1.0
- */
-@ConfigurationProperties(prefix = "management.metrics.export.kairos")
-public class KairosProperties extends StepRegistryProperties {
-
- /**
- * URI of the KairosDB server.
- */
- private String uri = "http://localhost:8080/api/v1/datapoints";
-
- /**
- * Login user of the KairosDB server.
- */
- private String userName;
-
- /**
- * Login password of the KairosDB server.
- */
- private String password;
-
- public String getUri() {
- return this.uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-
- public String getUserName() {
- return this.userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getPassword() {
- return this.password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/kairos/KairosPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/kairos/KairosPropertiesConfigAdapter.java
deleted file mode 100644
index 1be5ede513..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/kairos/KairosPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright 2018 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.kairos;
-
-import io.micrometer.kairos.KairosConfig;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-
-/**
- * Adapter to convert {@link KairosProperties} to a {@link KairosConfig}.
- *
- * @author Anton Ilinchik
- */
-class KairosPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.logging;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.core.instrument.logging.LoggingRegistryConfig;
-import io.micrometer.core.instrument.logging.LoggingMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to a logging framework.
- *
- * Try SLF4J first and fallback to the standard output if it's unavailable.
- *
- * @author Jon Schneider
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.logging", name = "enabled", havingValue = "true", matchIfMissing = false)
-@EnableConfigurationProperties(LoggingRegistryProperties.class)
-@Import(StringToDurationConverter.class)
-public class LoggingMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public LoggingRegistryConfig loggingRegistryConfig(LoggingRegistryProperties props) {
- return new LoggingRegistryPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public LoggingMeterRegistry loggingMeterRegistry(LoggingRegistryConfig config, Clock clock) {
- return new LoggingMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/logging/LoggingRegistryProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/logging/LoggingRegistryProperties.java
deleted file mode 100644
index 82d8b97646..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/logging/LoggingRegistryProperties.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Copyright 2018 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.logging;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring metrics logging.
- *
- * @author Jon Schneider
- * @since 1.1.0
- */
-@ConfigurationProperties(prefix = "management.metrics.export.logging")
-public class LoggingRegistryProperties extends StepRegistryProperties {
-
- /**
- * Whether counters and timers that have no activity in an interval are still logged.
- */
- private boolean logInactive = false;
-
- public boolean isLogInactive() {
- return logInactive;
- }
-
- public void setLogInactive(boolean logInactive) {
- this.logInactive = logInactive;
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/logging/LoggingRegistryPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/logging/LoggingRegistryPropertiesConfigAdapter.java
deleted file mode 100644
index ee123e0bab..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/logging/LoggingRegistryPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright 2018 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.logging;
-
-import io.micrometer.core.instrument.logging.LoggingRegistryConfig;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-
-/**
- * Adapter to convert {@link LoggingRegistryProperties} to an {@link LoggingRegistryConfig}.
- *
- * @author Jon Schneider
- */
-class LoggingRegistryPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.newrelic;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.newrelic.NewRelicConfig;
-import io.micrometer.newrelic.NewRelicMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to New Relic.
- *
- * @author Jon Schneider
- * @since 1.0.0
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(NewRelicMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.newrelic", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(NewRelicProperties.class)
-@Import(StringToDurationConverter.class)
-public class NewRelicMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public NewRelicConfig newRelicConfig(NewRelicProperties props) {
- return new NewRelicPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public NewRelicMeterRegistry newRelicMeterRegistry(NewRelicConfig config, Clock clock) {
- return new NewRelicMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/newrelic/NewRelicProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/newrelic/NewRelicProperties.java
deleted file mode 100644
index c7d059bbec..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/newrelic/NewRelicProperties.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.newrelic;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring New Relic metrics export.
- *
- * @author Jon Schneider
- * @since 1.0.0
- */
-@ConfigurationProperties(prefix = "management.metrics.export.newrelic")
-public class NewRelicProperties extends StepRegistryProperties {
-
- /**
- * New Relic API key.
- */
- private String apiKey;
-
- /**
- * New Relic account ID.
- */
- private String accountId;
-
- /**
- * URI to ship metrics to.
- */
- private String uri = "https://insights-collector.newrelic.com";
-
- public String getApiKey() {
- return this.apiKey;
- }
-
- public void setApiKey(String apiKey) {
- this.apiKey = apiKey;
- }
-
- public String getAccountId() {
- return this.accountId;
- }
-
- public void setAccountId(String accountId) {
- this.accountId = accountId;
- }
-
- public String getUri() {
- return this.uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/newrelic/NewRelicPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/newrelic/NewRelicPropertiesConfigAdapter.java
deleted file mode 100644
index 741581b6fb..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/newrelic/NewRelicPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.newrelic;
-
-import io.micrometer.newrelic.NewRelicConfig;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-
-/**
- * Adapter to convert {@link NewRelicProperties} to a {@link NewRelicConfig}.
- *
- * @author Jon Schneider
- */
-class NewRelicPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-@NonNullApi
-@NonNullFields
-package io.micrometer.spring.autoconfigure.export;
-
-import io.micrometer.core.lang.NonNullApi;
-import io.micrometer.core.lang.NonNullFields;
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/prometheus/PrometheusMetricsExportAutoConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/prometheus/PrometheusMetricsExportAutoConfiguration.java
deleted file mode 100644
index 682424720d..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/prometheus/PrometheusMetricsExportAutoConfiguration.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.prometheus;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.prometheus.PrometheusConfig;
-import io.micrometer.prometheus.PrometheusMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import io.micrometer.spring.export.prometheus.PrometheusPushGatewayManager;
-import io.micrometer.spring.export.prometheus.PrometheusScrapeEndpoint;
-import io.micrometer.spring.export.prometheus.PrometheusScrapeMvcEndpoint;
-import io.prometheus.client.CollectorRegistry;
-import io.prometheus.client.exporter.PushGateway;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.actuate.autoconfigure.ManagementContextConfiguration;
-import org.springframework.boot.actuate.condition.ConditionalOnEnabledEndpoint;
-import org.springframework.boot.actuate.endpoint.AbstractEndpoint;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.*;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-import org.springframework.core.env.Environment;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.time.Duration;
-import java.util.Map;
-
-/**
- * Configuration for exporting metrics to Prometheus.
- *
- * @author Jon Schneider
- * @author David J. M. Karlsen
- * @author Johnny Lim
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(PrometheusMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.prometheus", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(PrometheusProperties.class)
-@Import(StringToDurationConverter.class)
-public class PrometheusMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public PrometheusConfig prometheusConfig(PrometheusProperties props) {
- return new PrometheusPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public PrometheusMeterRegistry prometheusMeterRegistry(PrometheusConfig config, CollectorRegistry collectorRegistry,
- Clock clock) {
- return new PrometheusMeterRegistry(config, collectorRegistry, clock);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public CollectorRegistry collectorRegistry() {
- return new CollectorRegistry(true);
- }
-
- @ManagementContextConfiguration
- @ConditionalOnClass(AbstractEndpoint.class)
- public static class PrometheusScrapeEndpointConfiguration {
- @Bean
- public PrometheusScrapeEndpoint prometheusEndpoint(CollectorRegistry collectorRegistry) {
- return new PrometheusScrapeEndpoint(collectorRegistry);
- }
-
- @Bean
- @ConditionalOnEnabledEndpoint("prometheus")
- public PrometheusScrapeMvcEndpoint prometheusMvcEndpoint(PrometheusScrapeEndpoint delegate) {
- return new PrometheusScrapeMvcEndpoint(delegate);
- }
- }
-
- /**
- * Configuration for Prometheus
- * Pushgateway.
- */
- @Configuration
- @ConditionalOnClass(PushGateway.class)
- @ConditionalOnProperty(prefix = "management.metrics.export.prometheus.pushgateway", name = "enabled")
- public static class PrometheusPushGatewayConfiguration {
-
- private static final Log logger = LogFactory
- .getLog(PrometheusPushGatewayConfiguration.class);
-
- /**
- * The fallback job name. We use 'spring' since there's a history of Prometheus
- * spring integration defaulting to that name from when Prometheus integration
- * didn't exist in Spring itself.
- */
- private static final String FALLBACK_JOB = "spring";
-
- @Bean
- @ConditionalOnMissingBean
- public PrometheusPushGatewayManager prometheusPushGatewayManager(
- CollectorRegistry collectorRegistry,
- PrometheusProperties prometheusProperties, Environment environment) {
- PrometheusProperties.Pushgateway properties = prometheusProperties
- .getPushgateway();
- Duration pushRate = properties.getPushRate();
- String job = getJob(properties, environment);
- Map
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.prometheus;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.time.Duration;
-import java.util.HashMap;
-import java.util.Map;
-
-import io.micrometer.spring.export.prometheus.PrometheusPushGatewayManager.ShutdownOperation;
-
-/**
- * {@link ConfigurationProperties} for configuring metrics export to Prometheus.
- *
- * @author Jon Schneider
- */
-@ConfigurationProperties(prefix = "management.metrics.export.prometheus")
-public class PrometheusProperties {
-
- /**
- * Whether to enable publishing descriptions as part of the scrape payload to
- * Prometheus. Turn this off to minimize the amount of data sent on each scrape.
- */
- private boolean descriptions = true;
-
- /**
- * Configuration options for using Prometheus Pushgateway, allowing metrics to be
- * pushed when they cannot be scraped.
- */
- private Pushgateway pushgateway = new Pushgateway();
-
- /**
- * Step size (i.e. reporting frequency) to use.
- */
- private Duration step = Duration.ofMinutes(1);
-
- public boolean isDescriptions() {
- return this.descriptions;
- }
-
- public void setDescriptions(boolean descriptions) {
- this.descriptions = descriptions;
- }
-
- public Duration getStep() {
- return this.step;
- }
-
- public void setStep(Duration step) {
- this.step = step;
- }
-
- public Pushgateway getPushgateway() {
- return this.pushgateway;
- }
-
- public void setPushgateway(Pushgateway pushgateway) {
- this.pushgateway = pushgateway;
- }
-
- /**
- * Configuration options for push-based interaction with Prometheus.
- */
- public static class Pushgateway {
-
- /**
- * Enable publishing via a Prometheus Pushgateway.
- */
- private Boolean enabled = false;
-
- /**
- * Base URL for the Pushgateway.
- */
- private String baseUrl = "http://localhost:9091";
-
- /**
- * Frequency with which to push metrics.
- */
- private Duration pushRate = Duration.ofMinutes(1);
-
- /**
- * Job identifier for this application instance.
- */
- private String job;
-
- /**
- * Grouping key for the pushed metrics.
- */
- private Map
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.prometheus;
-
-import io.micrometer.prometheus.PrometheusConfig;
-import io.micrometer.spring.autoconfigure.export.properties.PropertiesConfigAdapter;
-
-import java.time.Duration;
-
-/**
- * Adapter to convert {@link PrometheusProperties} to a {@link PrometheusConfig}.
- *
- * @author Jon Schneider
- * @author Phillip Webb
- */
-class PrometheusPropertiesConfigAdapter extends PropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.properties;
-
-import org.springframework.util.Assert;
-
-import java.util.function.Function;
-import java.util.function.Supplier;
-
-/**
- * Base class for properties to config adapters.
- *
- * @param
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.properties;
-
-import java.time.Duration;
-
-/**
- * Base class for properties that configure a metrics registry that pushes aggregated
- * metrics on a regular interval.
- *
- * @author Jon Schneider
- * @author Andy Wilkinson
- */
-public abstract class StepRegistryProperties {
-
- /**
- * Step size (i.e. reporting frequency) to use.
- */
- private Duration step = Duration.ofMinutes(1);
-
- /**
- * Whether exporting of metrics to this backend is enabled.
- */
- private boolean enabled = true;
-
- /**
- * Connection timeout for requests to this backend.
- */
- private Duration connectTimeout = Duration.ofSeconds(1);
-
- /**
- * Read timeout for requests to this backend.
- */
- private Duration readTimeout = Duration.ofSeconds(10);
-
- /**
- * Number of threads to use with the metrics publishing scheduler.
- */
- private Integer numThreads = 2;
-
- /**
- * Number of measurements per request to use for this backend. If more measurements
- * are found, then multiple requests will be made.
- */
- private Integer batchSize = 10000;
-
- public Duration getStep() {
- return this.step;
- }
-
- public void setStep(Duration step) {
- this.step = step;
- }
-
- public boolean isEnabled() {
- return this.enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- public Duration getConnectTimeout() {
- return this.connectTimeout;
- }
-
- public void setConnectTimeout(Duration connectTimeout) {
- this.connectTimeout = connectTimeout;
- }
-
- public Duration getReadTimeout() {
- return this.readTimeout;
- }
-
- public void setReadTimeout(Duration readTimeout) {
- this.readTimeout = readTimeout;
- }
-
- public Integer getNumThreads() {
- return this.numThreads;
- }
-
- public void setNumThreads(Integer numThreads) {
- this.numThreads = numThreads;
- }
-
- public Integer getBatchSize() {
- return this.batchSize;
- }
-
- public void setBatchSize(Integer batchSize) {
- this.batchSize = batchSize;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/properties/StepRegistryPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/properties/StepRegistryPropertiesConfigAdapter.java
deleted file mode 100644
index 1d7a2bac52..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/properties/StepRegistryPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.properties;
-
-import io.micrometer.core.instrument.step.StepRegistryConfig;
-
-import java.time.Duration;
-
-/**
- * Base class for {@link StepRegistryProperties} to {@link StepRegistryConfig} adapters.
- *
- * @param
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.signalfx;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.signalfx.SignalFxConfig;
-import io.micrometer.signalfx.SignalFxMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to SignalFx.
- *
- * @author Jon Schneider
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(SignalFxMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.signalfx", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(SignalFxProperties.class)
-@Import(StringToDurationConverter.class)
-public class SignalFxMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public SignalFxConfig signalFxConfig(SignalFxProperties props) {
- return new SignalFxPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public SignalFxMeterRegistry signalFxMeterRegistry(SignalFxConfig config, Clock clock) {
- return new SignalFxMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/signalfx/SignalFxProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/signalfx/SignalFxProperties.java
deleted file mode 100644
index 97a04fbaf3..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/signalfx/SignalFxProperties.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.signalfx;
-
-import java.time.Duration;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring metrics export to SignalFX.
- *
- * @author Jon Schneider
- */
-@ConfigurationProperties(prefix = "management.metrics.export.signalfx")
-public class SignalFxProperties extends StepRegistryProperties {
-
- /**
- * Step size (i.e. reporting frequency) to use.
- */
- private Duration step = Duration.ofSeconds(10);
-
- /**
- * SignalFX access token.
- */
- private String accessToken;
-
- /**
- * URI to ship metrics to.
- */
- private String uri = "https://ingest.signalfx.com";
-
- /**
- * Uniquely identifies the app instance that is publishing metrics to SignalFx.
- * Defaults to the local host name.
- */
- private String source;
-
- @Override
- public Duration getStep() {
- return this.step;
- }
-
- @Override
- public void setStep(Duration step) {
- this.step = step;
- }
-
- public String getAccessToken() {
- return this.accessToken;
- }
-
- public void setAccessToken(String accessToken) {
- this.accessToken = accessToken;
- }
-
- public String getUri() {
- return this.uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-
- public String getSource() {
- return this.source;
- }
-
- public void setSource(String source) {
- this.source = source;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/signalfx/SignalFxPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/signalfx/SignalFxPropertiesConfigAdapter.java
deleted file mode 100644
index 0231ad2e95..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/signalfx/SignalFxPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.signalfx;
-
-import io.micrometer.signalfx.SignalFxConfig;
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-
-/**
- * Adapter to convert {@link SignalFxProperties} to a {@link SignalFxConfig}.
- *
- * @author Jon Schneider
- */
-class SignalFxPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.simple;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.simple.SimpleConfig;
-import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to a {@link SimpleMeterRegistry}.
- *
- * @author Jon Schneider
- */
-@Configuration
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@AutoConfigureBefore(CompositeMeterRegistryAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@EnableConfigurationProperties(SimpleProperties.class)
-@ConditionalOnMissingBean(MeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.simple", name = "enabled", havingValue = "true", matchIfMissing = true)
-@Import(StringToDurationConverter.class)
-public class SimpleMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public SimpleConfig simpleRegistryConfig(SimpleProperties props) {
- return new SimplePropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean(MeterRegistry.class)
- public SimpleMeterRegistry simpleMeterRegistry(SimpleConfig config, Clock clock) {
- return new SimpleMeterRegistry(config, clock);
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/simple/SimpleProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/simple/SimpleProperties.java
deleted file mode 100644
index ea137153f2..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/simple/SimpleProperties.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.simple;
-
-import io.micrometer.core.instrument.simple.CountingMode;
-import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.time.Duration;
-
-/**
- * {@link ConfigurationProperties} for configuring metrics export to a
- * {@link SimpleMeterRegistry}.
- *
- * @author Jon Schneider
- */
-@ConfigurationProperties(prefix = "management.metrics.export.simple")
-public class SimpleProperties {
-
- /**
- * Step size (i.e. reporting frequency) to use.
- */
- private Duration step = Duration.ofMinutes(1);
-
- /**
- * Counting mode.
- */
- private CountingMode mode = CountingMode.CUMULATIVE;
-
- public Duration getStep() {
- return this.step;
- }
-
- public void setStep(Duration step) {
- this.step = step;
- }
-
- public CountingMode getMode() {
- return this.mode;
- }
-
- public void setMode(CountingMode mode) {
- this.mode = mode;
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/simple/SimplePropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/simple/SimplePropertiesConfigAdapter.java
deleted file mode 100644
index 95f0d399d0..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/simple/SimplePropertiesConfigAdapter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.simple;
-
-import io.micrometer.core.instrument.simple.CountingMode;
-import io.micrometer.core.instrument.simple.SimpleConfig;
-import io.micrometer.spring.autoconfigure.export.properties.PropertiesConfigAdapter;
-
-import java.time.Duration;
-
-/**
- * Adapter to convert {@link SimpleProperties} to a {@link SimpleConfig}.
- *
- * @author Jon Schneider
- */
-class SimplePropertiesConfigAdapter extends PropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.stackdriver;
-
-import com.google.api.gax.core.FixedCredentialsProvider;
-import com.google.auth.oauth2.ServiceAccountCredentials;
-import com.google.cloud.monitoring.v3.MetricServiceSettings;
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import io.micrometer.stackdriver.StackdriverConfig;
-import io.micrometer.stackdriver.StackdriverMeterRegistry;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-import org.springframework.core.io.Resource;
-
-/**
- * Configuration for exporting metrics to Stackdriver.
- *
- * @author Jon Schneider
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(StackdriverMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.stackdriver", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(StackdriverProperties.class)
-@Import(StringToDurationConverter.class)
-public class StackdriverMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public StackdriverConfig stackdriverConfig(StackdriverProperties props) {
- return new StackdriverPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public StackdriverMeterRegistry stackdriverMeterRegistry(StackdriverConfig config, StackdriverProperties props, Clock clock) {
- return StackdriverMeterRegistry.builder(config)
- .clock(clock)
- .metricServiceSettings(() -> {
- MetricServiceSettings.Builder settingsBuilder = MetricServiceSettings.newBuilder();
- Resource credentials = props.getServiceAccountCredentials();
- if (credentials != null) {
- settingsBuilder.setCredentialsProvider(
- FixedCredentialsProvider.create(ServiceAccountCredentials.fromStream(credentials.getInputStream())));
- }
- return settingsBuilder.build();
- })
- .build();
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/stackdriver/StackdriverProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/stackdriver/StackdriverProperties.java
deleted file mode 100644
index 3e7add086f..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/stackdriver/StackdriverProperties.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.stackdriver;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.core.io.Resource;
-
-import java.time.Duration;
-
-/**
- * {@link ConfigurationProperties} for configuring metrics export to Stackdriver.
- *
- * @author Jon Schneider
- * @since 1.1.0
- */
-@ConfigurationProperties(prefix = "management.metrics.export.stackdriver")
-public class StackdriverProperties extends StepRegistryProperties {
-
- /**
- * Step size (i.e. reporting frequency) to use.
- */
- private Duration step = Duration.ofSeconds(10);
-
- /**
- * Google Cloud project id.
- */
- private String projectId;
-
- /**
- * Location of JSON representation of Google Cloud service account credentials
- * with at least write access to the monitoring API.
- */
- private Resource serviceAccountCredentials;
-
- @Override
- public Duration getStep() {
- return this.step;
- }
-
- @Override
- public void setStep(Duration step) {
- this.step = step;
- }
-
- public String getProjectId() {
- return projectId;
- }
-
- public void setProjectId(String projectId) {
- this.projectId = projectId;
- }
-
- public Resource getServiceAccountCredentials() {
- return serviceAccountCredentials;
- }
-
- public void setServiceAccountCredentials(Resource serviceAccountCredentials) {
- this.serviceAccountCredentials = serviceAccountCredentials;
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/stackdriver/StackdriverPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/stackdriver/StackdriverPropertiesConfigAdapter.java
deleted file mode 100644
index c03b7030f8..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/stackdriver/StackdriverPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.stackdriver;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-import io.micrometer.stackdriver.StackdriverConfig;
-
-/**
- * Adapter to convert {@link StackdriverProperties} to a {@link StackdriverConfig}.
- *
- * @author Jon Schneider
- */
-class StackdriverPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.statsd;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import io.micrometer.statsd.StatsdConfig;
-import io.micrometer.statsd.StatsdMeterRegistry;
-import io.micrometer.statsd.StatsdMetrics;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Configuration for exporting metrics to a StatsD agent.
- *
- * @author Jon Schneider
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(StatsdMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.statsd", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(StatsdProperties.class)
-@Import(StringToDurationConverter.class)
-public class StatsdMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean(StatsdConfig.class)
- public StatsdConfig statsdConfig(StatsdProperties props) {
- return new StatsdPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public StatsdMeterRegistry statsdMeterRegistry(StatsdConfig config, Clock clock) {
- return new StatsdMeterRegistry(config, clock);
- }
-
- @Bean
- public StatsdMetrics statsdMetrics() {
- return new StatsdMetrics();
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/statsd/StatsdProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/statsd/StatsdProperties.java
deleted file mode 100644
index 1333f40235..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/statsd/StatsdProperties.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.statsd;
-
-import io.micrometer.statsd.StatsdFlavor;
-import io.micrometer.statsd.StatsdProtocol;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.time.Duration;
-
-/**
- * {@link ConfigurationProperties} for configuring StatsD metrics export.
- *
- * @author Jon Schneider
- * @author Stephane Nicoll
- */
-@ConfigurationProperties(prefix = "management.metrics.export.statsd")
-public class StatsdProperties {
-
- /**
- * Whether exporting of metrics to StatsD is enabled.
- */
- private boolean enabled = true;
-
- /**
- * StatsD line protocol to use.
- */
- private StatsdFlavor flavor = StatsdFlavor.DATADOG;
-
- /**
- * Host of the StatsD server to receive exported metrics.
- */
- private String host = "localhost";
-
- /**
- * Port of the StatsD server to receive exported metrics.
- */
- private Integer port = 8125;
-
- /**
- * Protocol of the StatsD server to receive exported metrics.
- */
- private StatsdProtocol protocol = StatsdProtocol.UDP;
-
- /**
- * Total length of a single payload should be kept within your network's MTU.
- */
- private Integer maxPacketLength = 1400;
-
- /**
- * How often gauges will be polled. When a gauge is polled, its value is recalculated
- * and if the value has changed (or publishUnchangedMeters is true), it is sent to the
- * StatsD server.
- */
- private Duration pollingFrequency = Duration.ofSeconds(10);
-
- /**
- * Whether to send unchanged meters to the StatsD server.
- */
- private boolean publishUnchangedMeters = true;
-
- /** Whether measurements should be buffered before sending to the StatsD server. */
- private boolean buffered = true;
-
- public boolean isEnabled() {
- return this.enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- public StatsdFlavor getFlavor() {
- return this.flavor;
- }
-
- public void setFlavor(StatsdFlavor flavor) {
- this.flavor = flavor;
- }
-
- public String getHost() {
- return this.host;
- }
-
- public void setHost(String host) {
- this.host = host;
- }
-
- public Integer getPort() {
- return this.port;
- }
-
- public void setPort(Integer port) {
- this.port = port;
- }
-
- public StatsdProtocol getProtocol() {
- return this.protocol;
- }
-
- public void setProtocol(StatsdProtocol protocol) {
- this.protocol = protocol;
- }
-
- public Integer getMaxPacketLength() {
- return this.maxPacketLength;
- }
-
- public void setMaxPacketLength(Integer maxPacketLength) {
- this.maxPacketLength = maxPacketLength;
- }
-
- public Duration getPollingFrequency() {
- return this.pollingFrequency;
- }
-
- public void setPollingFrequency(Duration pollingFrequency) {
- this.pollingFrequency = pollingFrequency;
- }
-
- public boolean isPublishUnchangedMeters() {
- return this.publishUnchangedMeters;
- }
-
- public void setPublishUnchangedMeters(boolean publishUnchangedMeters) {
- this.publishUnchangedMeters = publishUnchangedMeters;
- }
-
- public boolean isBuffered() {
- return buffered;
- }
-
- public void setBuffered(boolean buffered) {
- this.buffered = buffered;
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/statsd/StatsdPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/statsd/StatsdPropertiesConfigAdapter.java
deleted file mode 100644
index 4cfc971133..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/statsd/StatsdPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.statsd;
-
-import io.micrometer.spring.autoconfigure.export.properties.PropertiesConfigAdapter;
-import io.micrometer.statsd.StatsdConfig;
-import io.micrometer.statsd.StatsdFlavor;
-import io.micrometer.statsd.StatsdProtocol;
-
-import java.time.Duration;
-
-/**
- * Adapter to convert {@link StatsdProperties} to a {@link StatsdConfig}.
- *
- * @author Jon Schneider
- */
-class StatsdPropertiesConfigAdapter extends PropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.wavefront;
-
-import io.micrometer.core.instrument.Clock;
-import io.micrometer.spring.autoconfigure.CompositeMeterRegistryAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.StringToDurationConverter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import io.micrometer.wavefront.WavefrontConfig;
-import io.micrometer.wavefront.WavefrontMeterRegistry;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * Auto-configuration for Wavefront.
- *
- * @author Jon Schneider
- * @since 1.0.0
- */
-@Configuration
-@AutoConfigureBefore({CompositeMeterRegistryAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@AutoConfigureAfter(MetricsAutoConfiguration.class)
-@ConditionalOnBean(Clock.class)
-@ConditionalOnClass(WavefrontMeterRegistry.class)
-@ConditionalOnProperty(prefix = "management.metrics.export.wavefront", name = "enabled", havingValue = "true", matchIfMissing = true)
-@EnableConfigurationProperties(WavefrontProperties.class)
-@Import(StringToDurationConverter.class)
-public class WavefrontMetricsExportAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean(WavefrontConfig.class)
- public WavefrontConfig wavefrontConfig(WavefrontProperties props) {
- return new WavefrontPropertiesConfigAdapter(props);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public WavefrontMeterRegistry wavefrontMeterRegistry(WavefrontConfig config, Clock clock) {
- return new WavefrontMeterRegistry(config, clock);
- }
-
- @Bean
- @ConditionalOnMissingBean
- public Clock micrometerClock() {
- return Clock.SYSTEM;
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/wavefront/WavefrontProperties.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/wavefront/WavefrontProperties.java
deleted file mode 100644
index 46e64131d5..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/wavefront/WavefrontProperties.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.wavefront;
-
-import java.net.URI;
-import java.time.Duration;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring Wavefront metrics export.
- *
- * @author Jon Schneider
- * @since 1.0.0
- */
-@ConfigurationProperties("management.metrics.export.wavefront")
-public class WavefrontProperties extends StepRegistryProperties {
-
- /**
- * Step size (i.e. reporting frequency) to use.
- */
- private Duration step = Duration.ofSeconds(10);
-
- /**
- * URI to ship metrics to.
- */
- private URI uri = URI.create("https://longboard.wavefront.com");
-
- /**
- * Unique identifier for the app instance that is the source of metrics being
- * published to Wavefront. Defaults to the local host name.
- */
- private String source;
-
- /**
- * API token used when publishing metrics directly to the Wavefront API host.
- */
- private String apiToken;
-
- /**
- * Global prefix to separate metrics originating from this app's white box
- * instrumentation from those originating from other Wavefront integrations when
- * viewed in the Wavefront UI.
- */
- private String globalPrefix;
-
- /**
- * Report histogram distributions aggregated into minute intervals.
- */
- private boolean reportMinuteDistribution = true;
-
- /**
- * Report histogram distributions aggregated into hour intervals.
- */
- private boolean reportHourDistribution = false;
-
- /**
- * Report histogram distributions aggregated into day intervals.
- */
- private boolean reportDayDistribution = false;
-
- public URI getUri() {
- return this.uri;
- }
-
- public void setUri(URI uri) {
- this.uri = uri;
- }
-
- @Override
- public Duration getStep() {
- return this.step;
- }
-
- @Override
- public void setStep(Duration step) {
- this.step = step;
- }
-
- public String getSource() {
- return this.source;
- }
-
- public void setSource(String source) {
- this.source = source;
- }
-
- public String getApiToken() {
- return this.apiToken;
- }
-
- public void setApiToken(String apiToken) {
- this.apiToken = apiToken;
- }
-
- public String getGlobalPrefix() {
- return this.globalPrefix;
- }
-
- public void setGlobalPrefix(String globalPrefix) {
- this.globalPrefix = globalPrefix;
- }
-
- public boolean isReportMinuteDistribution() {
- return reportMinuteDistribution;
- }
-
- public void setReportMinuteDistribution(boolean reportMinuteDistribution) {
- this.reportMinuteDistribution = reportMinuteDistribution;
- }
-
- public boolean isReportHourDistribution() {
- return reportHourDistribution;
- }
-
- public void setReportHourDistribution(boolean reportHourDistribution) {
- this.reportHourDistribution = reportHourDistribution;
- }
-
- public boolean isReportDayDistribution() {
- return reportDayDistribution;
- }
-
- public void setReportDayDistribution(boolean reportDayDistribution) {
- this.reportDayDistribution = reportDayDistribution;
- }
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/wavefront/WavefrontPropertiesConfigAdapter.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/wavefront/WavefrontPropertiesConfigAdapter.java
deleted file mode 100644
index a5771f04b1..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/wavefront/WavefrontPropertiesConfigAdapter.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.export.wavefront;
-
-import io.micrometer.spring.autoconfigure.export.properties.StepRegistryPropertiesConfigAdapter;
-import io.micrometer.wavefront.WavefrontConfig;
-
-/**
- * Adapter to convert {@link WavefrontProperties} to a {@link WavefrontConfig}.
- *
- * @author Jon Schneider
- */
-class WavefrontPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.jdbc;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-
-import io.micrometer.spring.jdbc.DataSourcePoolMetrics;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvider;
-import org.springframework.context.annotation.Conditional;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.util.StringUtils;
-
-import javax.sql.DataSource;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for metrics on all available
- * {@link DataSource datasources}.
- *
- * @author Stephane Nicoll
- * @author Johnny Lim
- */
-@Configuration
-@AutoConfigureAfter({ MetricsAutoConfiguration.class, DataSourceAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class })
-@ConditionalOnClass({ DataSource.class, MeterRegistry.class })
-@Conditional(DataSourcePoolMetricsAutoConfiguration.DataSourcePoolMetricsConditionalOnBeans.class)
-public class DataSourcePoolMetricsAutoConfiguration {
-
- @Configuration
- @ConditionalOnBean(DataSourcePoolMetadataProvider.class)
- static class DataSourcePoolMetadataMetricsConfiguration {
-
- private static final String DATASOURCE_SUFFIX = "dataSource";
-
- private final MeterRegistry registry;
-
- private final Collection
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.jersey;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.config.MeterFilter;
-import io.micrometer.jersey2.server.AnnotationFinder;
-import io.micrometer.jersey2.server.DefaultJerseyTagsProvider;
-import io.micrometer.jersey2.server.JerseyTagsProvider;
-import io.micrometer.jersey2.server.MetricsApplicationEventListener;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsProperties;
-import io.micrometer.spring.autoconfigure.OnlyOnceLoggingDenyMeterFilter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.glassfish.jersey.server.ResourceConfig;
-
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Conditional;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.annotation.AnnotationUtils;
-import org.springframework.core.annotation.Order;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for Jersey server instrumentation.
- *
- * @author Michael Weirauch
- * @author Michael Simons
- * @author Andy Wilkinson
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureAfter({ MetricsAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class })
-@ConditionalOnWebApplication
-@ConditionalOnClass({ ResourceConfig.class, MetricsApplicationEventListener.class })
-@Conditional(JerseyServerMetricsAutoConfiguration.JerseyServerMetricsConditionalOnBeans.class)
-@EnableConfigurationProperties(MetricsProperties.class)
-public class JerseyServerMetricsAutoConfiguration {
-
- private final MetricsProperties properties;
-
- public JerseyServerMetricsAutoConfiguration(MetricsProperties properties) {
- this.properties = properties;
- }
-
- @Bean
- @ConditionalOnMissingBean(JerseyTagsProvider.class)
- public DefaultJerseyTagsProvider jerseyTagsProvider() {
- return new DefaultJerseyTagsProvider();
- }
-
- @Bean
- public ResourceConfigCustomizer jerseyServerMetricsResourceConfigCustomizer(
- MeterRegistry meterRegistry, JerseyTagsProvider tagsProvider) {
- MetricsProperties.Web.Server server = this.properties.getWeb().getServer();
- return (config) ->
- config.register(new MetricsApplicationEventListener(meterRegistry,
- tagsProvider, server.getRequestsMetricName(),
- server.isAutoTimeRequests(), new AnnotationUtilsAnnotationFinder()));
- }
-
- @Bean
- @Order(0)
- public MeterFilter jerseyMetricsUriTagFilter() {
- String metricName = this.properties.getWeb().getServer().getRequestsMetricName();
- MeterFilter filter = new OnlyOnceLoggingDenyMeterFilter(() -> String
- .format("Reached the maximum number of URI tags for '%s'.", metricName));
- return MeterFilter.maximumAllowableTags(metricName, "uri",
- this.properties.getWeb().getServer().getMaxUriTags(), filter);
- }
-
- /**
- * An {@link AnnotationFinder} that uses {@link AnnotationUtils}.
- */
- private static class AnnotationUtilsAnnotationFinder implements AnnotationFinder {
-
- @Override
- public A findAnnotation(AnnotatedElement annotatedElement,
- Class annotationType) {
- return AnnotationUtils.findAnnotation(annotatedElement, annotationType);
- }
-
- }
-
- static class JerseyServerMetricsConditionalOnBeans extends AllNestedConditions {
-
- JerseyServerMetricsConditionalOnBeans() {
- super(ConfigurationPhase.REGISTER_BEAN);
- }
-
- @ConditionalOnBean(MeterRegistry.class)
- static class ConditionalOnMeterRegistryBean {
- }
-
- @ConditionalOnBean(ResourceConfig.class)
- static class ConditionalOnResourceConfigBean {
- }
-
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/kafka/consumer/KafkaMetricsAutoConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/kafka/consumer/KafkaMetricsAutoConfiguration.java
deleted file mode 100644
index 695c9f12e5..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/kafka/consumer/KafkaMetricsAutoConfiguration.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright 2018 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.kafka.consumer;
-
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.binder.kafka.KafkaConsumerMetrics;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-
-import javax.management.MBeanServer;
-import java.util.Collections;
-
-/**
- * Configuration for {@link KafkaConsumerMetrics}.
- *
- * @author Wardha Perinkadakattu
- * @author Chin Huang
- */
-@Configuration
-@AutoConfigureAfter({ MetricsAutoConfiguration.class, JmxAutoConfiguration.class })
-@ConditionalOnClass(KafkaConsumerMetrics.class)
-@ConditionalOnBean(MeterRegistry.class)
-public class KafkaMetricsAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- @ConditionalOnBean(MBeanServer.class)
- @ConditionalOnProperty(value = "management.metrics.kafka.consumer.enabled", matchIfMissing = true)
- public KafkaConsumerMetrics kafkaConsumerMetrics(MBeanServer mbeanServer) {
- return new KafkaConsumerMetrics(mbeanServer, Collections.emptyList());
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/orm/jpa/HibernateMetricsAutoConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/orm/jpa/HibernateMetricsAutoConfiguration.java
deleted file mode 100644
index e066adfc03..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/orm/jpa/HibernateMetricsAutoConfiguration.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Copyright 2018 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.orm.jpa;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.binder.jpa.HibernateMetrics;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import org.hibernate.SessionFactory;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
-import org.springframework.context.annotation.Conditional;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.util.StringUtils;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceException;
-
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for metrics on all available
- * Hibernate {@link EntityManagerFactory} instances that have statistics enabled.
- *
- * @author Rui Figueira
- * @author Stephane Nicoll
- * @author Johnny Lim
- * @since 1.1.0
- */
-@Configuration
-@AutoConfigureAfter({MetricsAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class})
-@ConditionalOnClass({EntityManagerFactory.class, SessionFactory.class, MeterRegistry.class})
-@Conditional(HibernateMetricsAutoConfiguration.HibernateMetricsConditionalOnBeans.class)
-public class HibernateMetricsAutoConfiguration {
- private static final String ENTITY_MANAGER_FACTORY_SUFFIX = "entityManagerFactory";
-
- private final MeterRegistry registry;
-
- public HibernateMetricsAutoConfiguration(MeterRegistry registry) {
- this.registry = registry;
- }
-
- @Autowired
- public void bindEntityManagerFactoriesToRegistry(Map
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.web.client;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.config.MeterFilter;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsProperties;
-import io.micrometer.spring.autoconfigure.OnlyOnceLoggingDenyMeterFilter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import io.micrometer.spring.web.client.DefaultRestTemplateExchangeTagsProvider;
-import io.micrometer.spring.web.client.MetricsRestTemplateCustomizer;
-import io.micrometer.spring.web.client.RestTemplateExchangeTagsProvider;
-import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.beans.factory.SmartInitializingSingleton;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration;
-import org.springframework.boot.web.client.RestTemplateBuilder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Conditional;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.annotation.Order;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.client.AsyncRestTemplate;
-import org.springframework.web.client.RestTemplate;
-
-import java.util.List;
-
-/**
- * Configuration for {@link RestTemplate}- and {@link AsyncRestTemplate}-related metrics.
- *
- * @author Jon Schneider
- * @author Phillip Webb
- * @author Raheela Aslam
- * @author Johnny Lim
- */
-@Configuration
-@AutoConfigureAfter({
- MetricsAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class,
- WebClientAutoConfiguration.class })
-@ConditionalOnClass(name = {
- "org.springframework.web.client.RestTemplate",
- "org.springframework.web.client.AsyncRestTemplate",
- "org.springframework.boot.web.client.RestTemplateCustomizer" // didn't exist until Boot 1.4
-})
-@Conditional(RestTemplateMetricsAutoConfiguration.RestTemplateMetricsConditionalOnBeans.class)
-public class RestTemplateMetricsAutoConfiguration {
-
- private final MetricsProperties properties;
-
- public RestTemplateMetricsAutoConfiguration(MetricsProperties properties) {
- this.properties = properties;
- }
-
- @Bean
- @ConditionalOnMissingBean(RestTemplateExchangeTagsProvider.class)
- public DefaultRestTemplateExchangeTagsProvider restTemplateTagConfigurer() {
- return new DefaultRestTemplateExchangeTagsProvider();
- }
-
- @Bean
- public MetricsRestTemplateCustomizer metricsRestTemplateCustomizer(MeterRegistry meterRegistry,
- RestTemplateExchangeTagsProvider restTemplateTagConfigurer) {
- return new MetricsRestTemplateCustomizer(meterRegistry, restTemplateTagConfigurer,
- properties.getWeb().getClient().getRequestsMetricName());
- }
-
- @Bean
- public SmartInitializingSingleton metricsAsyncRestTemplateInitializer(final ObjectProvider
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.web.jetty;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.binder.jetty.JettyServerThreadPoolMetrics;
-import io.micrometer.spring.web.jetty.JettyServerThreadPoolMetricsBinder;
-import org.eclipse.jetty.server.Server;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * Auto-configuration for Jetty metrics.
- *
- * @author Manabu Matsuzaki
- * @author Jon Schneider
- * @author Michael Weirauch
- * @author Johnny Lim
- * @author Andy Wilkinson
- */
-@Configuration
-@ConditionalOnWebApplication
-@ConditionalOnClass({ JettyServerThreadPoolMetrics.class, Server.class })
-public class JettyMetricsAutoConfiguration {
-
- @Bean
- @ConditionalOnBean(MeterRegistry.class)
- @ConditionalOnMissingBean({ JettyServerThreadPoolMetrics.class, JettyServerThreadPoolMetricsBinder.class })
- public JettyServerThreadPoolMetricsBinder jettyServerThreadPoolMetricsBinder(MeterRegistry meterRegistry) {
- return new JettyServerThreadPoolMetricsBinder(meterRegistry);
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/web/servlet/WebMvcMetricsAutoConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/web/servlet/WebMvcMetricsAutoConfiguration.java
deleted file mode 100644
index 1afa11dd3f..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/web/servlet/WebMvcMetricsAutoConfiguration.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.web.servlet;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.config.MeterFilter;
-import io.micrometer.spring.autoconfigure.MetricsAutoConfiguration;
-import io.micrometer.spring.autoconfigure.MetricsProperties;
-import io.micrometer.spring.autoconfigure.OnlyOnceLoggingDenyMeterFilter;
-import io.micrometer.spring.autoconfigure.export.simple.SimpleMetricsExportAutoConfiguration;
-import io.micrometer.spring.web.servlet.DefaultWebMvcTagsProvider;
-import io.micrometer.spring.web.servlet.WebMvcMetricsFilter;
-import io.micrometer.spring.web.servlet.WebMvcTagsProvider;
-
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.annotation.Order;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.servlet.DispatcherServlet;
-import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for instrumentation of Spring Web
- * MVC servlet-based request mappings.
- *
- * @author Jon Schneider
- * @author Dmytro Nosan
- */
-@Configuration
-@AutoConfigureAfter({ MetricsAutoConfiguration.class,
- SimpleMetricsExportAutoConfiguration.class })
-@ConditionalOnWebApplication
-@ConditionalOnClass(DispatcherServlet.class)
-@ConditionalOnBean(MeterRegistry.class)
-@EnableConfigurationProperties(MetricsProperties.class)
-public class WebMvcMetricsAutoConfiguration {
-
- private final MetricsProperties properties;
-
- public WebMvcMetricsAutoConfiguration(MetricsProperties properties) {
- this.properties = properties;
- }
-
- @Bean
- @ConditionalOnMissingBean(WebMvcTagsProvider.class)
- public DefaultWebMvcTagsProvider servletTagsProvider() {
- return new DefaultWebMvcTagsProvider();
- }
-
- @SuppressWarnings("deprecation")
- @Bean
- public WebMvcMetricsFilter webMetricsFilter(MeterRegistry registry,
- WebMvcTagsProvider tagsProvider,
- WebApplicationContext ctx) {
- return new WebMvcMetricsFilter(registry, tagsProvider,
- properties.getWeb().getServer().getRequestsMetricName(),
- properties.getWeb().getServer().isAutoTimeRequests(),
- new HandlerMappingIntrospector(ctx));
- }
-
- @Bean
- @Order(0)
- public MeterFilter metricsHttpServerUriTagFilter() {
- String metricName = this.properties.getWeb().getServer().getRequestsMetricName();
- MeterFilter filter = new OnlyOnceLoggingDenyMeterFilter(() -> String
- .format("Reached the maximum number of URI tags for '%s'.", metricName));
- return MeterFilter.maximumAllowableTags(metricName, "uri",
- this.properties.getWeb().getServer().getMaxUriTags(), filter);
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/web/tomcat/TomcatMetricsAutoConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/web/tomcat/TomcatMetricsAutoConfiguration.java
deleted file mode 100644
index ee685d10c4..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/web/tomcat/TomcatMetricsAutoConfiguration.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Copyright 2017 Pivotal Software, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.autoconfigure.web.tomcat;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.binder.tomcat.TomcatMetrics;
-import io.micrometer.spring.web.tomcat.TomcatMetricsBinder;
-import org.apache.catalina.Manager;
-
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * {@link EnableAutoConfiguration Auto-configuration} for {@link TomcatMetrics}.
- *
- * @author Clint Checketts
- * @author Jon Schneider
- * @author Andy Wilkinson
- * @since 1.1.0
- */
-@Configuration
-@ConditionalOnWebApplication
-@ConditionalOnClass({ TomcatMetrics.class, Manager.class })
-public class TomcatMetricsAutoConfiguration {
-
- @Bean
- @ConditionalOnBean(MeterRegistry.class)
- @ConditionalOnMissingBean({ TomcatMetrics.class, TomcatMetricsBinder.class })
- public TomcatMetricsBinder tomcatMetricsBinder(MeterRegistry meterRegistry) {
- return new TomcatMetricsBinder(meterRegistry);
- }
-
-}
diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/cache/CacheMeterBinderProvider.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/cache/CacheMeterBinderProvider.java
deleted file mode 100644
index 7cf5a71562..0000000000
--- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/cache/CacheMeterBinderProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2012-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.micrometer.spring.cache;
-
-import io.micrometer.core.instrument.Tag;
-import io.micrometer.core.instrument.binder.MeterBinder;
-import org.springframework.cache.Cache;
-
-/**
- * Provide a {@link MeterBinder} based on a {@link Cache}.
- *
- * @param
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.micrometer.spring.cache;
-
-import io.micrometer.core.instrument.MeterRegistry;
-import io.micrometer.core.instrument.Tag;
-import io.micrometer.core.instrument.Tags;
-import io.micrometer.core.instrument.binder.cache.CacheMeterBinder;
-import io.micrometer.core.lang.Nullable;
-import org.springframework.cache.concurrent.ConcurrentMapCache;
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * @author Jon Schneider
- */
-public class ConcurrentMapCacheMetrics extends CacheMeterBinder {
- private final MonitoredConcurrentMapCache cache;
-
- /**
- * Record metrics on a ConcurrentMapCache cache.
- *
- * @param registry The registry to bind metrics to.
- * @param cache The cache to instrument.
- * @param tags Tags to apply to all recorded metrics. Must be an even number of arguments representing key/value pairs of tags.
- * @return The instrumented cache, unchanged. The original cache is not wrapped or proxied in any way.
- */
- public static ConcurrentMapCache monitor(MeterRegistry registry, ConcurrentMapCache cache, String... tags) {
- return monitor(registry, cache, Tags.of(tags));
- }
-
- /**
- * Record metrics on a ConcurrentMapCache cache.
- *
- * @param registry The registry to bind metrics to.
- * @param cache The cache to instrument.
- * @param tags Tags to apply to all recorded metrics.
- * @return The instrumented cache, unchanged. The original cache is not wrapped or proxied in any way.
- */
- public static ConcurrentMapCache monitor(MeterRegistry registry, ConcurrentMapCache cache, Iterable>> customizers;
-
- private final ObjectProvider
> filters;
-
- private final ObjectProvider
> binders;
-
- private final boolean addToGlobalRegistry;
-
- private final boolean hasCompositeMeterRegistry;
-
- MeterRegistryConfigurer(ObjectProvider
>> customizers,
- ObjectProvider
> filters, ObjectProvider
> binders,
- boolean addToGlobalRegistry, boolean hasCompositeMeterRegistry) {
- this.customizers = customizers;
- this.filters = filters;
- this.binders = binders;
- this.addToGlobalRegistry = addToGlobalRegistry;
- this.hasCompositeMeterRegistry = hasCompositeMeterRegistry;
- }
-
- void configure(MeterRegistry registry) {
- // Customizers must be applied before binders, as they may add custom
- // tags or alter timer or summary configuration.
- customize(registry);
- addFilters(registry);
- if (!this.hasCompositeMeterRegistry
- || registry instanceof CompositeMeterRegistry) {
- addBinders(registry);
- }
- if (this.addToGlobalRegistry && registry != Metrics.globalRegistry) {
- Metrics.addRegistry(registry);
- }
- }
-
- @SuppressWarnings("unchecked")
- private void customize(MeterRegistry registry) {
- // Customizers must be applied before binders, as they may add custom tags or alter
- // timer or summary configuration.
- for (MeterRegistryCustomizer customizer : getOrEmpty(this.customizers)) {
- try {
- customizer.customize(registry);
- } catch (ClassCastException ignored) {
- // This is essentially what LambdaSafe.callbacks(..).invoke(..) is doing
- // in Spring Boot 2, just trapping ClassCastExceptions since the generic type
- // has been erased by this point.
- }
- }
- }
-
- private void addFilters(MeterRegistry registry) {
- getOrEmpty(this.filters).forEach(registry.config()::meterFilter);
- }
-
- private void addBinders(MeterRegistry registry) {
- getOrEmpty(this.binders).forEach((binder) -> binder.bindTo(registry));
- }
-
- private
> listProvider) {
- List
> meterBinders;
-
- private final ObjectProvider
> meterFilters;
-
- private final ObjectProvider
>> meterRegistryCustomizers;
-
- private final ObjectProvider
> meterBinders,
- ObjectProvider
> meterFilters,
- ObjectProvider
>> meterRegistryCustomizers,
- ObjectProvider
> meterBinders,
- ObjectProvider
> meterFilters,
- ObjectProvider
>> meterRegistryCustomizers,
- ObjectProvider
> asyncRestTemplatesProvider,
- final MetricsRestTemplateCustomizer customizer) {
- return () -> {
- final List