Adapt to latest changes in Micrometer 2.0 snapshots

See gh-29666
pull/30648/head
Andy Wilkinson 3 years ago
parent cb44a9c8a8
commit 44211564a4

@ -50,7 +50,6 @@ dependencies {
optional("io.micrometer:micrometer-observation")
optional("io.micrometer:micrometer-core")
optional("io.micrometer:micrometer-tracing-api")
optional("io.micrometer:micrometer-binders")
optional("io.micrometer:micrometer-registry-appoptics")
optional("io.micrometer:micrometer-registry-atlas") {
exclude group: "javax.inject", module: "javax.inject"

@ -16,12 +16,12 @@
package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.binder.jvm.ClassLoaderMetrics;
import io.micrometer.binder.jvm.JvmGcMetrics;
import io.micrometer.binder.jvm.JvmHeapPressureMetrics;
import io.micrometer.binder.jvm.JvmMemoryMetrics;
import io.micrometer.binder.jvm.JvmThreadMetrics;
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.JvmHeapPressureMetrics;
import io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics;
import io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

@ -16,9 +16,9 @@
package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.binder.kafka.KafkaClientMetrics;
import io.micrometer.binder.kafka.KafkaStreamsMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.kafka.KafkaClientMetrics;
import io.micrometer.core.instrument.binder.kafka.KafkaStreamsMetrics;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;

@ -16,8 +16,8 @@
package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.binder.logging.Log4j2Metrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.logging.Log4j2Metrics;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.spi.LoggerContext;

@ -17,8 +17,8 @@
package org.springframework.boot.actuate.autoconfigure.metrics;
import ch.qos.logback.classic.LoggerContext;
import io.micrometer.binder.logging.LogbackMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.logging.LogbackMetrics;
import org.slf4j.ILoggerFactory;
import org.slf4j.LoggerFactory;

@ -19,11 +19,11 @@ package org.springframework.boot.actuate.autoconfigure.metrics;
import java.io.File;
import java.util.List;
import io.micrometer.binder.system.FileDescriptorMetrics;
import io.micrometer.binder.system.ProcessorMetrics;
import io.micrometer.binder.system.UptimeMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tags;
import io.micrometer.core.instrument.binder.system.FileDescriptorMetrics;
import io.micrometer.core.instrument.binder.system.ProcessorMetrics;
import io.micrometer.core.instrument.binder.system.UptimeMetrics;
import org.springframework.boot.actuate.metrics.system.DiskSpaceMetricsBinder;
import org.springframework.boot.autoconfigure.AutoConfiguration;

@ -17,13 +17,13 @@
package org.springframework.boot.actuate.autoconfigure.metrics.mongo;
import com.mongodb.MongoClientSettings;
import io.micrometer.binder.mongodb.DefaultMongoCommandTagsProvider;
import io.micrometer.binder.mongodb.DefaultMongoConnectionPoolTagsProvider;
import io.micrometer.binder.mongodb.MongoCommandTagsProvider;
import io.micrometer.binder.mongodb.MongoConnectionPoolTagsProvider;
import io.micrometer.binder.mongodb.MongoMetricsCommandListener;
import io.micrometer.binder.mongodb.MongoMetricsConnectionPoolListener;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.mongodb.DefaultMongoCommandTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.DefaultMongoConnectionPoolTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.MongoCommandTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.MongoConnectionPoolTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.MongoMetricsCommandListener;
import io.micrometer.core.instrument.binder.mongodb.MongoMetricsConnectionPoolListener;
import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;

@ -21,8 +21,8 @@ import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
import io.micrometer.binder.jvm.ExecutorServiceMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.jvm.ExecutorServiceMetrics;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;

@ -16,10 +16,10 @@
package org.springframework.boot.actuate.autoconfigure.metrics.web.jetty;
import io.micrometer.binder.jetty.JettyConnectionMetrics;
import io.micrometer.binder.jetty.JettyServerThreadPoolMetrics;
import io.micrometer.binder.jetty.JettySslHandshakeMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.jetty.JettyConnectionMetrics;
import io.micrometer.core.instrument.binder.jetty.JettyServerThreadPoolMetrics;
import io.micrometer.core.instrument.binder.jetty.JettySslHandshakeMetrics;
import org.eclipse.jetty.server.Server;
import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration;

@ -16,8 +16,8 @@
package org.springframework.boot.actuate.autoconfigure.metrics.web.tomcat;
import io.micrometer.binder.tomcat.TomcatMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.tomcat.TomcatMetrics;
import org.apache.catalina.Manager;
import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration;

@ -16,8 +16,8 @@
package org.springframework.boot.actuate.autoconfigure.endpoint.web.documentation;
import io.micrometer.binder.jvm.JvmMemoryMetrics;
import io.micrometer.core.instrument.Statistic;
import io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import org.junit.jupiter.api.Test;

@ -16,8 +16,8 @@
package org.springframework.boot.actuate.autoconfigure.endpoint.web.documentation;
import io.micrometer.binder.jvm.JvmMemoryMetrics;
import io.micrometer.core.instrument.Clock;
import io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics;
import io.micrometer.prometheus.PrometheusMeterRegistry;
import io.prometheus.client.CollectorRegistry;
import io.prometheus.client.exporter.common.TextFormat;

@ -16,11 +16,11 @@
package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.binder.jvm.ClassLoaderMetrics;
import io.micrometer.binder.jvm.JvmGcMetrics;
import io.micrometer.binder.jvm.JvmHeapPressureMetrics;
import io.micrometer.binder.jvm.JvmMemoryMetrics;
import io.micrometer.binder.jvm.JvmThreadMetrics;
import io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics;
import io.micrometer.core.instrument.binder.jvm.JvmGcMetrics;
import io.micrometer.core.instrument.binder.jvm.JvmHeapPressureMetrics;
import io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics;
import io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun;

@ -16,7 +16,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.binder.logging.Log4j2Metrics;
import io.micrometer.core.instrument.binder.logging.Log4j2Metrics;
import org.apache.logging.log4j.LogManager;
import org.junit.jupiter.api.Test;

@ -16,7 +16,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.binder.logging.Log4j2Metrics;
import io.micrometer.core.instrument.binder.logging.Log4j2Metrics;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.slf4j.SLF4JLoggerContext;
import org.junit.jupiter.api.Test;

@ -16,7 +16,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.binder.logging.LogbackMetrics;
import io.micrometer.core.instrument.binder.logging.LogbackMetrics;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun;

@ -16,7 +16,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.binder.logging.LogbackMetrics;
import io.micrometer.core.instrument.binder.logging.LogbackMetrics;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;

@ -20,10 +20,10 @@ import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import io.micrometer.binder.system.FileDescriptorMetrics;
import io.micrometer.binder.system.ProcessorMetrics;
import io.micrometer.binder.system.UptimeMetrics;
import io.micrometer.core.instrument.Tags;
import io.micrometer.core.instrument.binder.system.FileDescriptorMetrics;
import io.micrometer.core.instrument.binder.system.ProcessorMetrics;
import io.micrometer.core.instrument.binder.system.UptimeMetrics;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun;

@ -16,8 +16,8 @@
package org.springframework.boot.actuate.autoconfigure.metrics.export.humio;
import io.micrometer.binder.jvm.JvmMemoryMetrics;
import io.micrometer.core.instrument.Clock;
import io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics;
import io.micrometer.humio.HumioConfig;
import io.micrometer.humio.HumioMeterRegistry;
import org.junit.jupiter.api.Test;

@ -23,12 +23,12 @@ import com.mongodb.client.MongoClient;
import com.mongodb.client.internal.MongoClientImpl;
import com.mongodb.connection.ConnectionPoolSettings;
import com.mongodb.event.ConnectionPoolListener;
import io.micrometer.binder.mongodb.DefaultMongoCommandTagsProvider;
import io.micrometer.binder.mongodb.DefaultMongoConnectionPoolTagsProvider;
import io.micrometer.binder.mongodb.MongoCommandTagsProvider;
import io.micrometer.binder.mongodb.MongoConnectionPoolTagsProvider;
import io.micrometer.binder.mongodb.MongoMetricsCommandListener;
import io.micrometer.binder.mongodb.MongoMetricsConnectionPoolListener;
import io.micrometer.core.instrument.binder.mongodb.DefaultMongoCommandTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.DefaultMongoConnectionPoolTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.MongoCommandTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.MongoConnectionPoolTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.MongoMetricsCommandListener;
import io.micrometer.core.instrument.binder.mongodb.MongoMetricsConnectionPoolListener;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun;

@ -22,11 +22,11 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.CyclicBarrier;
import io.micrometer.binder.jvm.JvmMemoryMetrics;
import io.micrometer.binder.logging.LogbackMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.MockClock;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics;
import io.micrometer.core.instrument.binder.logging.LogbackMetrics;
import io.micrometer.core.instrument.simple.SimpleConfig;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import jakarta.servlet.DispatcherType;

@ -19,8 +19,8 @@ package org.springframework.boot.actuate.autoconfigure.metrics.web.tomcat;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicInteger;
import io.micrometer.binder.tomcat.TomcatMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.tomcat.TomcatMetrics;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import org.apache.tomcat.util.modeler.Registry;
import org.junit.jupiter.api.Test;

@ -24,7 +24,6 @@ dependencies {
optional("io.lettuce:lettuce-core")
optional("io.micrometer:micrometer-observation")
optional("io.micrometer:micrometer-core")
optional("io.micrometer:micrometer-binders")
optional("io.micrometer:micrometer-tracing-api")
optional("io.micrometer:micrometer-registry-prometheus")
optional("io.prometheus:simpleclient_pushgateway") {

@ -16,9 +16,9 @@
package org.springframework.boot.actuate.metrics.cache;
import io.micrometer.binder.cache.CaffeineCacheMetrics;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.cache.CaffeineCacheMetrics;
import org.springframework.cache.caffeine.CaffeineCache;

@ -19,9 +19,9 @@ package org.springframework.boot.actuate.metrics.cache;
import java.lang.reflect.Method;
import com.hazelcast.spring.cache.HazelcastCache;
import io.micrometer.binder.cache.HazelcastCacheMetrics;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.cache.HazelcastCacheMetrics;
import org.springframework.util.ReflectionUtils;

@ -16,9 +16,9 @@
package org.springframework.boot.actuate.metrics.cache;
import io.micrometer.binder.cache.JCacheMetrics;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.cache.JCacheMetrics;
import org.springframework.cache.jcache.JCacheCache;

@ -19,10 +19,10 @@ package org.springframework.boot.actuate.metrics.system;
import java.io.File;
import java.util.List;
import io.micrometer.binder.system.DiskSpaceMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.system.DiskSpaceMetrics;
import org.springframework.util.Assert;

@ -18,9 +18,9 @@ package org.springframework.boot.actuate.metrics.web.jetty;
import java.util.Collections;
import io.micrometer.binder.jetty.JettyConnectionMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.binder.jetty.JettyConnectionMetrics;
import org.eclipse.jetty.server.Server;
/**

@ -18,9 +18,9 @@ package org.springframework.boot.actuate.metrics.web.jetty;
import java.util.Collections;
import io.micrometer.binder.jetty.JettyServerThreadPoolMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.binder.jetty.JettyServerThreadPoolMetrics;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.thread.ThreadPool;

@ -18,9 +18,9 @@ package org.springframework.boot.actuate.metrics.web.jetty;
import java.util.Collections;
import io.micrometer.binder.jetty.JettySslHandshakeMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.binder.jetty.JettySslHandshakeMetrics;
import org.eclipse.jetty.server.Server;
/**

@ -18,9 +18,9 @@ package org.springframework.boot.actuate.metrics.web.tomcat;
import java.util.Collections;
import io.micrometer.binder.tomcat.TomcatMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.binder.tomcat.TomcatMetrics;
import org.apache.catalina.Container;
import org.apache.catalina.Context;
import org.apache.catalina.Manager;

@ -21,9 +21,9 @@ import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.micrometer.binder.jvm.JvmMemoryMetrics;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.MockClock;
import io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics;
import io.micrometer.core.instrument.simple.SimpleConfig;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;

@ -19,8 +19,8 @@ package org.springframework.boot.actuate.metrics.cache;
import java.util.Collections;
import com.github.benmanes.caffeine.cache.Caffeine;
import io.micrometer.binder.cache.CaffeineCacheMetrics;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.cache.CaffeineCacheMetrics;
import org.junit.jupiter.api.Test;
import org.springframework.cache.caffeine.CaffeineCache;

@ -20,8 +20,8 @@ import java.util.Collections;
import com.hazelcast.map.IMap;
import com.hazelcast.spring.cache.HazelcastCache;
import io.micrometer.binder.cache.HazelcastCacheMetrics;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.cache.HazelcastCacheMetrics;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;

@ -20,8 +20,8 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.util.Collections;
import io.micrometer.binder.cache.JCacheMetrics;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.cache.JCacheMetrics;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

@ -77,7 +77,6 @@ dependencies {
implementation("ch.qos.logback:logback-classic")
implementation("com.zaxxer:HikariCP")
implementation("io.micrometer:micrometer-core")
implementation("io.micrometer:micrometer-binders")
implementation("io.micrometer:micrometer-registry-graphite")
implementation("io.micrometer:micrometer-registry-jmx")
implementation("io.projectreactor.netty:reactor-netty-http")

@ -17,7 +17,7 @@
package org.springframework.boot.docs.actuator.metrics.supported.mongodb.command;
import com.mongodb.event.CommandEvent;
import io.micrometer.binder.mongodb.MongoCommandTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.MongoCommandTagsProvider;
import io.micrometer.core.instrument.Tag;
class CustomCommandTagsProvider implements MongoCommandTagsProvider {

@ -16,7 +16,7 @@
package org.springframework.boot.docs.actuator.metrics.supported.mongodb.command;
import io.micrometer.binder.mongodb.MongoCommandTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.MongoCommandTagsProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@ -17,7 +17,7 @@
package org.springframework.boot.docs.actuator.metrics.supported.mongodb.connectionpool;
import com.mongodb.event.ConnectionPoolCreatedEvent;
import io.micrometer.binder.mongodb.MongoConnectionPoolTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.MongoConnectionPoolTagsProvider;
import io.micrometer.core.instrument.Tag;
public class CustomConnectionPoolTagsProvider implements MongoConnectionPoolTagsProvider {

@ -16,7 +16,7 @@
package org.springframework.boot.docs.actuator.metrics.supported.mongodb.connectionpool;
import io.micrometer.binder.mongodb.MongoConnectionPoolTagsProvider;
import io.micrometer.core.instrument.binder.mongodb.MongoConnectionPoolTagsProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@ -17,7 +17,7 @@
package org.springframework.boot.docs.actuator.metrics.supported.mongodb.command
import com.mongodb.event.CommandEvent
import io.micrometer.binder.mongodb.MongoCommandTagsProvider
import io.micrometer.core.instrument.binder.mongodb.MongoCommandTagsProvider
import io.micrometer.core.instrument.Tag
class CustomCommandTagsProvider : MongoCommandTagsProvider {

@ -16,7 +16,7 @@
package org.springframework.boot.docs.actuator.metrics.supported.mongodb.command
import io.micrometer.binder.mongodb.MongoCommandTagsProvider
import io.micrometer.core.instrument.binder.mongodb.MongoCommandTagsProvider
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@ -17,7 +17,7 @@
package org.springframework.boot.docs.actuator.metrics.supported.mongodb.connectionpool
import com.mongodb.event.ConnectionPoolCreatedEvent
import io.micrometer.binder.mongodb.MongoConnectionPoolTagsProvider
import io.micrometer.core.instrument.binder.mongodb.MongoConnectionPoolTagsProvider
import io.micrometer.core.instrument.Tag
class CustomConnectionPoolTagsProvider : MongoConnectionPoolTagsProvider {

@ -16,7 +16,7 @@
package org.springframework.boot.docs.actuator.metrics.supported.mongodb.connectionpool
import io.micrometer.binder.mongodb.MongoConnectionPoolTagsProvider
import io.micrometer.core.instrument.binder.mongodb.MongoConnectionPoolTagsProvider
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@ -9,5 +9,4 @@ dependencies {
api(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
api("io.micrometer:micrometer-observation")
api("io.micrometer:micrometer-core")
api("io.micrometer:micrometer-binders")
}

@ -68,7 +68,6 @@ dependencies {
testImplementation("com.unboundid:unboundid-ldapsdk")
testImplementation("io.lettuce:lettuce-core")
testImplementation("io.micrometer:micrometer-registry-prometheus")
testImplementation("io.micrometer:micrometer-binders")
testImplementation("io.projectreactor.netty:reactor-netty-http")
testImplementation("io.projectreactor:reactor-core")
testImplementation("io.projectreactor:reactor-test")

Loading…
Cancel
Save