Skip to content

Commit 00b0456

Browse files
committed
Address PR review comments
- Fix Gradle snippets: use implementation instead of platform() so transitive dependencies are actually added to the classpath - Add explicit versions for OTel instrumentation dependencies since Maven dependencyManagement is not transitive to consumers - Remove misleading claims about automatic version management in docs - Add maven.compiler.release and project.build.sourceEncoding to all standalone example POMs (Java 8 for most, Java 17 for Tomcat 11) - Update set-release-version-github-pages.sh description to reflect broader docs/content scope - Document $version placeholder convention in CLAUDE.md Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent 67e1e3e commit 00b0456

15 files changed

Lines changed: 70 additions & 15 deletions

File tree

.mise/tasks/set-release-version-github-pages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
#MISE description="Set release version in GitHub Pages quickstart.md"
3+
#MISE description="Set release version in all GitHub Pages docs"
44

55
set -euox pipefail
66

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ mise run lint:super-linter
119119
- Integration tests are in `integration-tests/` and run during `verify` phase
120120
- Acceptance tests use OATs framework: `mise run acceptance-test`
121121

122+
## Documentation
123+
124+
- Docs live under `docs/content/` and use `$version` as a placeholder for the library version
125+
- When publishing GitHub Pages, `mise run set-release-version-github-pages` replaces `$version` with the latest git tag across all `docs/content/**/*.md` files (the published site is not versioned)
126+
- When writing docs, always use `$version` for the Prometheus client version — never hardcode it
127+
122128
## Java Version
123129

124130
Source compatibility: Java 8. Tests run on Java 25 (configured in `mise.toml`).

docs/content/otel/jvm-runtime-metrics.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ the runtime-telemetry instrumentation:
3232
{{< tab "Gradle" >}}
3333

3434
```groovy
35-
implementation platform('io.prometheus:prometheus-metrics-otel-support:$version')
35+
implementation 'io.prometheus:prometheus-metrics-otel-support:$version'
3636
37-
// Pick ONE of the following:
38-
// Java 8+:
39-
implementation 'io.opentelemetry.instrumentation:opentelemetry-runtime-telemetry-java8'
40-
// Java 17+ (adds JFR-based metrics):
41-
// implementation 'io.opentelemetry.instrumentation:opentelemetry-runtime-telemetry-java17'
37+
// Use opentelemetry-runtime-telemetry-java8 (Java 8+)
38+
// or opentelemetry-runtime-telemetry-java17 (Java 17+, JFR-based)
39+
implementation 'io.opentelemetry.instrumentation:opentelemetry-runtime-telemetry-java8:2.24.0-alpha'
4240
```
4341

4442
{{< /tab >}}
@@ -57,12 +55,14 @@ implementation 'io.opentelemetry.instrumentation:opentelemetry-runtime-telemetry
5755
<dependency>
5856
<groupId>io.opentelemetry.instrumentation</groupId>
5957
<artifactId>opentelemetry-runtime-telemetry-java8</artifactId>
58+
<version>2.24.0-alpha</version>
6059
</dependency>
6160
<!-- Java 17+ (adds JFR-based metrics) -->
6261
<!--
6362
<dependency>
6463
<groupId>io.opentelemetry.instrumentation</groupId>
6564
<artifactId>opentelemetry-runtime-telemetry-java17</artifactId>
65+
<version>2.24.0-alpha</version>
6666
</dependency>
6767
-->
6868
```

docs/content/otel/support.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ weight: 2
55

66
The `prometheus-metrics-otel-support` module bundles the
77
OpenTelemetry SDK and the Prometheus exporter into a single
8-
POM dependency. It also imports the OTel instrumentation BOM
9-
so that version management is handled automatically.
8+
POM dependency.
109

1110
Use this module when you want to combine OpenTelemetry
1211
instrumentations (e.g. JVM runtime metrics) with the
@@ -18,7 +17,7 @@ Prometheus Java client on one `/metrics` endpoint.
1817
{{< tab "Gradle" >}}
1918

2019
```groovy
21-
implementation platform('io.prometheus:prometheus-metrics-otel-support:$version')
20+
implementation 'io.prometheus:prometheus-metrics-otel-support:$version'
2221
```
2322

2423
{{< /tab >}}
@@ -41,11 +40,6 @@ This single dependency replaces:
4140
- `io.opentelemetry:opentelemetry-sdk`
4241
- `io.opentelemetry:opentelemetry-exporter-prometheus`
4342

44-
It also imports the `opentelemetry-instrumentation-bom-alpha`
45-
so you can add OTel instrumentation modules (like
46-
`opentelemetry-runtime-telemetry-java8`) without specifying
47-
their version.
48-
4943
## Use Cases
5044

5145
See [JVM Runtime Metrics]({{< relref "jvm-runtime-metrics.md" >}})

examples/example-custom-buckets/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
<artifactId>example-custom-buckets</artifactId>
88
<version>1.0-SNAPSHOT</version>
99

10+
<properties>
11+
<maven.compiler.release>8</maven.compiler.release>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
</properties>
14+
1015
<name>Example - Custom Buckets</name>
1116
<description>
1217
End-to-End example of Native Histograms with Custom Buckets (NHCB): Java app -&gt; Prometheus -&gt; Grafana

examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<artifactId>example-greeting-service</artifactId>
99
<version>1.0-SNAPSHOT</version>
1010

11+
<properties>
12+
<maven.compiler.release>17</maven.compiler.release>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
</properties>
15+
1116
<name>Example - OpenTelemetry Exemplars - Greeting Service</name>
1217
<description>
1318
Part of a distributed "Hello, World" REST service to show Exemplars with OpenTelemetry's distributed

examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<artifactId>example-hello-world-app</artifactId>
99
<version>1.0-SNAPSHOT</version>
1010

11+
<properties>
12+
<maven.compiler.release>17</maven.compiler.release>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
</properties>
15+
1116
<name>Example - OpenTelemetry Exemplars - Hello World App</name>
1217
<description>
1318
Part of a distributed "Hello, World" REST service to show Exemplars with OpenTelemetry's distributed

examples/example-exporter-httpserver/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<artifactId>example-exporter-httpserver</artifactId>
99
<version>1.0-SNAPSHOT</version>
1010

11+
<properties>
12+
<maven.compiler.release>8</maven.compiler.release>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
</properties>
15+
1116
<name>Example - HTTPServer Exporter</name>
1217
<description>
1318
Prometheus Metrics Example using the HTTPServer for exposing the metrics endpoint

examples/example-exporter-multi-target/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<artifactId>example-exporter-multi-target</artifactId>
99
<version>1.0-SNAPSHOT</version>
1010

11+
<properties>
12+
<maven.compiler.release>8</maven.compiler.release>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
</properties>
15+
1116
<name>Example - HTTPServer Exporter Multi Target</name>
1217
<description>
1318
Prometheus Metrics Example for multi-target pattern implementation

examples/example-exporter-opentelemetry/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<artifactId>example-exporter-opentelemetry</artifactId>
99
<version>1.0-SNAPSHOT</version>
1010

11+
<properties>
12+
<maven.compiler.release>8</maven.compiler.release>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
</properties>
15+
1116
<name>Example - OpenTelemetry Metrics Exporter</name>
1217
<description>
1318
Example of exposing metrics in OpenTelemetry format and pushing them to an OpenTelemetry collector

0 commit comments

Comments
 (0)