For the latest stable version, please use Micrometer 1.14.0! |
Installing
Micrometer contains a core library with the instrumentation SPI and an in-memory implementation that does not export data anywhere, a series of modules with implementations for various monitoring systems, and a test module.
To use Micrometer, add the dependency for your monitoring system.
The following example adds Prometheus in Gradle:
implementation 'io.micrometer:micrometer-registry-prometheus:latest.release'
The following example adds Prometheus in Maven:
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>${micrometer.version}</version>
</dependency>
Through Micrometer’s composite meter registry (described in greater detail in "Concepts"), you can configure more than one registry implementation if you intend to publish metrics to more than one monitoring system.
If you have not decided on a monitoring system yet and want only to try out the instrumentation SPI, you can add a dependency on micrometer-core
instead and configure the SimpleMeterRegistry
.
Snapshots
Every successful build of Micrometer’s main
and maintenance branches (for example, 1.7.x
) results in the publication of a new snapshot version. You can use the latest snapshot by adding the Maven repository repo.spring.io/snapshot
to your build and using the corresponding snapshot version — for example, 1.8.0-SNAPSHOT
.
Milestones
Milestone releases are made available for early testing purposes and are not intended for production use.
Milestone releases are published to repo.spring.io/milestone.
To use milestone releases, include that as a Maven repository in your build configuration.
Milestones are marked as “pre-releases” on GitHub, and the version has a suffix, such as -M1
or -RC1
(milestone 1 or release candidate 1, respectively).