Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BOM for Micrometer dependency examples in reference docs #5652

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/modules/ROOT/pages/_gradle_bom.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Micrometer provides BOM, and you can configure it as follows:

[source,groovy,subs=+attributes]
----
implementation platform('io.micrometer:micrometer-bom:{micrometer-version}')
----
16 changes: 16 additions & 0 deletions docs/modules/ROOT/pages/_maven_bom.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Micrometer provides BOM, and you can configure it as follows:

[source,xml,subs=+attributes]
----
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-bom</artifactId>
<version>{micrometer-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
----
15 changes: 11 additions & 4 deletions docs/modules/ROOT/pages/contextpropagation/installing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,29 @@ Milestone releases are published to https://repo.spring.io/milestone. Include th
configuration to use milestone releases. Note that milestone releases are for testing purposes and are not intended for
production use.

The following example shows the required dependency in Gradle:
The following example shows the Gradle configuration:

include::../_gradle_bom.adoc[]

Add the following dependency:

[source,groovy,subs=+attributes]
----
implementation 'io.micrometer:context-propagation:latest.integration'
implementation 'io.micrometer:context-propagation'
----

The following example shows the required dependency in Maven:
The following example shows the Maven configuration:

include::../_maven_bom.adoc[]

Add the following dependency:

[source,xml,subs=+attributes]
----
<dependencies>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>context-propagation</artifactId>
<version>${micrometer-context-propagation.version}</version>
</dependency>
</dependencies>
----
15 changes: 11 additions & 4 deletions docs/modules/ROOT/pages/implementations/_install.adoc
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
[[implementations-installing]]
== Installing

For Gradle, add the following implementation:
=== Gradle

include::../_gradle_bom.adoc[]

Add the following dependency:

[source,groovy,subs=+attributes]
----
implementation 'io.micrometer:micrometer-registry-{system}:latest.release'
implementation 'io.micrometer:micrometer-registry-{system}'
----

For Maven, add the following dependency:
=== Maven

include::../_maven_bom.adoc[]

Add the following dependency:

[source,xml,subs=+attributes]
----
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-{system}</artifactId>
<version>${micrometer.version}</version>
</dependency>
----
30 changes: 22 additions & 8 deletions docs/modules/ROOT/pages/implementations/datadog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,28 @@ If you can choose between the two, the API approach is far more efficient.

=== Direct to Datadog API Approach

For Gradle, add the following implementation:
==== Gradle

include::../_gradle_bom.adoc[]

Add the following dependency:

[source,groovy]
----
implementation 'io.micrometer:micrometer-registry-datadog:latest.release'
implementation 'io.micrometer:micrometer-registry-datadog'
----

For Maven, add the following dependency:
==== Maven

include::../_maven_bom.adoc[]

Add the following dependency:

[source,xml]
----
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-datadog</artifactId>
<version>${micrometer.version}</version>
</dependency>
----

Expand Down Expand Up @@ -74,21 +81,28 @@ For example, for the `US5` site, the correct API endpoint is `https://api.us5.da

=== Through DogStatsD Approach

For Gradle, add the following implementation:
==== Gradle

include::../_gradle_bom.adoc[]

Add the following dependency:

[source,groovy,subs=+attributes]
----
implementation 'io.micrometer:micrometer-registry-statsd:latest.release'
implementation 'io.micrometer:micrometer-registry-statsd'
----

For Maven, add the following dependency:
==== Maven

include::../_maven_bom.adoc[]

Add the following dependency:

[source,xml,subs=+attributes]
----
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-statsd</artifactId>
<version>${micrometer.version}</version>
</dependency>
----

Expand Down
30 changes: 22 additions & 8 deletions docs/modules/ROOT/pages/implementations/influx.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,28 @@ Micrometer supports shipping metrics to InfluxDB directly or through Telegraf th

=== Direct to InfluxDB

The following example adds the required library in Gradle:
The following example shows the Gradle configuration:

include::../_gradle_bom.adoc[]

Add the following dependency:

[source,groovy]
----
implementation 'io.micrometer:micrometer-registry-influx:latest.release'
implementation 'io.micrometer:micrometer-registry-influx'
----

The following example adds the required library in Maven:
The following example shows the Maven configuration:

include::../_maven_bom.adoc[]

Add the following dependency:

[source,xml]
----
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-influx</artifactId>
<version>${micrometer.version}</version>
</dependency>
----

Expand Down Expand Up @@ -113,21 +120,28 @@ management.metrics.export.influx:

Telegraf is a StatsD agent that expects a modified flavor of the StatsD line protocol.

The following listing adds the relevant library in Gradle:
The following example shows the Gradle configuration:

include::../_gradle_bom.adoc[]

Add the following dependency:

[source,groovy]
----
implementation 'io.micrometer:micrometer-registry-statsd:latest.release'
implementation 'io.micrometer:micrometer-registry-statsd'
----

The following listing adds the relevant library in Maven:
The following example shows the Maven configuration:

include::../_maven_bom.adoc[]

Add the following dependency:

[source,xml]
----
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-statsd</artifactId>
<version>${micrometer.version}</version>
</dependency>
----

Expand Down
11 changes: 9 additions & 2 deletions docs/modules/ROOT/pages/installing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,26 @@ To use Micrometer, add the dependency for your monitoring system.

The following example adds Prometheus in Gradle:

include::_gradle_bom.adoc[]

Add the following dependency:

[source,groovy]
----
implementation 'io.micrometer:micrometer-registry-prometheus:latest.release'
implementation 'io.micrometer:micrometer-registry-prometheus'
----

The following example adds Prometheus in Maven:

include::_maven_bom.adoc[]

Add the following dependency:

[source,xml]
----
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>${micrometer.version}</version>
</dependency>
----

Expand Down
37 changes: 15 additions & 22 deletions docs/modules/ROOT/pages/observation/installing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,27 @@

Micrometer comes with a Bill of Materials (BOM), which is a project that manages all the project versions for consistency.

The following example shows the required dependency for Micrometer Observation in Gradle:
The following example shows the Gradle configuration:

include::../_gradle_bom.adoc[]

Add the following dependency:

[source,groovy,subs=+attributes]
----
implementation platform('io.micrometer:micrometer-bom:latest.release')
implementation 'io.micrometer:micrometer-observation'
----

The following example shows the required dependency in Maven:
The following example shows the Maven configuration:

include::../_maven_bom.adoc[]

Add the following dependency:

[source,xml,subs=+attributes]
[source,xml]
----
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-bom</artifactId>
<version>${micrometer.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-observation</artifactId>
</dependency>
</dependencies>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-observation</artifactId>
</dependency>
----
12 changes: 10 additions & 2 deletions docs/modules/ROOT/pages/observation/testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ Micrometer Observation comes with the `micrometer-observation-test` module, whic
[[micrometer-observation-installing]]
== Installing

The following example shows the required dependency in Gradle (assuming that the Micrometer BOM has been added):
The following example shows the Gradle configuration:

include::../_gradle_bom.adoc[]

Add the following dependency:

[source,groovy,subs=+attributes]
-----
testImplementation 'io.micrometer:micrometer-observation-test'
-----

The following example shows the required dependency in Maven (assuming that the Micrometer BOM has been added):
The following example shows the Maven configuration:

include::../_maven_bom.adoc[]

Add the following dependency:

[source,xml,subs=+attributes]
-----
Expand Down