Commit e9c59674 authored by Stephane Nicoll's avatar Stephane Nicoll

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
parents 7e6df7d0 eb406867
......@@ -78,6 +78,7 @@ dependencies {
optional("org.glassfish.jersey.core:jersey-server")
optional("org.glassfish.jersey.containers:jersey-container-servlet-core")
optional("org.hibernate:hibernate-core")
optional("org.hibernate:hibernate-micrometer")
optional("org.hibernate.validator:hibernate-validator")
optional("org.influxdb:influxdb-java")
optional("org.jolokia:jolokia-core")
......
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
......@@ -23,8 +23,8 @@ import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceException;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.jpa.HibernateMetrics;
import org.hibernate.SessionFactory;
import org.hibernate.stat.HibernateMetrics;
import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
......@@ -48,7 +48,7 @@ import org.springframework.util.StringUtils;
@Configuration(proxyBeanMethods = false)
@AutoConfigureAfter({ MetricsAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
SimpleMetricsExportAutoConfiguration.class })
@ConditionalOnClass({ EntityManagerFactory.class, SessionFactory.class, MeterRegistry.class })
@ConditionalOnClass({ EntityManagerFactory.class, SessionFactory.class, HibernateMetrics.class, MeterRegistry.class })
@ConditionalOnBean({ EntityManagerFactory.class, MeterRegistry.class })
public class HibernateMetricsAutoConfiguration implements SmartInitializingSingleton {
......
......@@ -1178,7 +1178,7 @@ bom {
]
}
}
library("Micrometer", "1.6.5") {
library("Micrometer", "1.7.0-M1") {
group("io.micrometer") {
modules = [
"micrometer-registry-stackdriver" {
......
......@@ -2355,7 +2355,7 @@ Each metric is tagged by the name of the Pool (can be controlled with `spring.da
[[production-ready-metrics-hibernate]]
==== Hibernate Metrics
Auto-configuration enables the instrumentation of all available Hibernate `EntityManagerFactory` instances that have statistics enabled with a metric named `hibernate`.
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.
Metrics are also tagged by the name of the `EntityManagerFactory` that is derived from the bean name.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment