Skip to content

Commit e9c5967

Browse files
committed
Merge pull request #25707 from jonatan-ivanov
* pr/25707: Polish "Upgrade to Micrometer 1.7.0-M1" Upgrade to Micrometer 1.7.0-M1 Closes gh-25707
2 parents 7e6df7d + eb40686 commit e9c5967

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ dependencies {
7878
optional("org.glassfish.jersey.core:jersey-server")
7979
optional("org.glassfish.jersey.containers:jersey-container-servlet-core")
8080
optional("org.hibernate:hibernate-core")
81+
optional("org.hibernate:hibernate-micrometer")
8182
optional("org.hibernate.validator:hibernate-validator")
8283
optional("org.influxdb:influxdb-java")
8384
optional("org.jolokia:jolokia-core")

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/orm/jpa/HibernateMetricsAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,8 +23,8 @@
2323
import javax.persistence.PersistenceException;
2424

2525
import io.micrometer.core.instrument.MeterRegistry;
26-
import io.micrometer.core.instrument.binder.jpa.HibernateMetrics;
2726
import org.hibernate.SessionFactory;
27+
import org.hibernate.stat.HibernateMetrics;
2828

2929
import org.springframework.beans.factory.SmartInitializingSingleton;
3030
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
@@ -48,7 +48,7 @@
4848
@Configuration(proxyBeanMethods = false)
4949
@AutoConfigureAfter({ MetricsAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
5050
SimpleMetricsExportAutoConfiguration.class })
51-
@ConditionalOnClass({ EntityManagerFactory.class, SessionFactory.class, MeterRegistry.class })
51+
@ConditionalOnClass({ EntityManagerFactory.class, SessionFactory.class, HibernateMetrics.class, MeterRegistry.class })
5252
@ConditionalOnBean({ EntityManagerFactory.class, MeterRegistry.class })
5353
public class HibernateMetricsAutoConfiguration implements SmartInitializingSingleton {
5454

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ bom {
11781178
]
11791179
}
11801180
}
1181-
library("Micrometer", "1.6.5") {
1181+
library("Micrometer", "1.7.0-M1") {
11821182
group("io.micrometer") {
11831183
modules = [
11841184
"micrometer-registry-stackdriver" {

spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,7 @@ Each metric is tagged by the name of the Pool (can be controlled with `spring.da
23552355
23562356
[[production-ready-metrics-hibernate]]
23572357
==== Hibernate Metrics
2358-
Auto-configuration enables the instrumentation of all available Hibernate `EntityManagerFactory` instances that have statistics enabled with a metric named `hibernate`.
2358+
If `org.hibernate:hibernate-micrometer` is on the classpath, all available Hibernate `EntityManagerFactory` instances that have statistics enabled with a metric named `hibernate` are instrumented.
23592359
23602360
Metrics are also tagged by the name of the `EntityManagerFactory` that is derived from the bean name.
23612361

0 commit comments

Comments
 (0)