Add OTel support module and make examples standalone#1868
Merged
zeitlinger merged 5 commits intomainfrom Feb 13, 2026
Merged
Conversation
Each example POM is now self-contained: no parent element, explicit groupId/version, and a prometheus-metrics-bom import for dependency management. Users can copy an example POM and use it directly without needing the parent chain. Also replace hardcoded versions with $version marker in OTel docs and update set-release-version-github-pages.sh to process all docs. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
2816338 to
67e1e3e
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Maven “OTel support” module intended to simplify using OpenTelemetry SDK + Prometheus exporter alongside this client, and updates docs/examples/scripts to reflect the new dependency story and make examples copy/paste-able.
Changes:
- Introduces
prometheus-metrics-otel-supportmodule and publishes it via the root build +prometheus-metrics-bom. - Removes the examples parent POM relationship so each example declares its own
groupId/versionand importsprometheus-metrics-bomdirectly. - Adds/updates OTel docs and broadens the docs version-replacement script to process all
docs/content/**/*.md.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| prometheus-metrics-otel-support/pom.xml | New “OTel support” POM module that depends on OTel SDK + Prometheus exporter and imports the OTel instrumentation BOM. |
| prometheus-metrics-bom/pom.xml | Adds prometheus-metrics-otel-support to BOM-managed artifacts. |
| pom.xml | Adds the new prometheus-metrics-otel-support module to the reactor build. |
| examples/example-simpleclient-bridge/pom.xml | Makes the example standalone and imports prometheus-metrics-bom. |
| examples/example-prometheus-properties/pom.xml | Makes the example standalone and imports prometheus-metrics-bom. |
| examples/example-otel-jvm-runtime-metrics/pom.xml | Makes the example standalone and switches to the new OTel support module dependency. |
| examples/example-native-histogram/pom.xml | Makes the example standalone and imports prometheus-metrics-bom. |
| examples/example-exporter-servlet-tomcat/pom.xml | Makes the example standalone and imports prometheus-metrics-bom. |
| examples/example-exporter-opentelemetry/pom.xml | Makes the example standalone and imports prometheus-metrics-bom. |
| examples/example-exporter-multi-target/pom.xml | Makes the example standalone and imports prometheus-metrics-bom. |
| examples/example-exporter-httpserver/pom.xml | Makes the example standalone and imports prometheus-metrics-bom. |
| examples/example-exemplars-tail-sampling/pom.xml | Makes the multi-module example standalone (parent removed). |
| examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml | Makes the module standalone and imports prometheus-metrics-bom. |
| examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml | Makes the module standalone and imports prometheus-metrics-bom. |
| examples/example-custom-buckets/pom.xml | Makes the example standalone and imports prometheus-metrics-bom. |
| docs/content/otel/support.md | New docs page describing the OTel support module. |
| docs/content/otel/jvm-runtime-metrics.md | Updates dependency instructions to reference the OTel support module. |
| .mise/tasks/set-release-version-github-pages.sh | Expands $version replacement to all markdown under docs/content. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml
Show resolved
Hide resolved
examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml
Show resolved
Hide resolved
- 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>
The script strips the -alpha suffix so $otelVersion resolves to the base version (e.g. 2.24.0), and docs write $otelVersion-alpha explicitly to produce the full version string. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
3d97ce8 to
f7b98b9
Compare
jaydeluca
approved these changes
Feb 13, 2026
| <groupId>io.opentelemetry.instrumentation</groupId> | ||
| <artifactId>opentelemetry-instrumentation-bom-alpha</artifactId> | ||
| <version>${otel.instrumentation.version}</version> | ||
| <version>2.24.0-alpha</version> |
Collaborator
There was a problem hiding this comment.
are we intentionally hard coding this? is it because we no longer have access to the variable because we removed the parent? Will this get updated automatically?
Member
Author
There was a problem hiding this comment.
- yes, relying on parent makes it impossible to copy-paste
- yes, will get updated (this will be obvious when https://github.com/grafana/docker-otel-lgtm/blob/main/.github/renovate-tracked-deps.json is used in this repo)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inspired by #1854 (comment)
Summary
prometheus-metrics-otel-supportPOM module that bundles the OTel SDK and Prometheus exporter as a single dependency, with the OTel instrumentation BOM imported for automatic version managementprometheus-metrics-otel-supportto the BOM so users can manage it viadependencyManagementgroupId,version, and importsprometheus-metrics-bomdirectly, so users can copy-paste an example and build it without the parent chaindocs/content/otel/support.md)1.5.0versions in OTel docs with$versionplaceholder and updateset-release-version-github-pages.shto process all markdown files underdocs/contentTest plan
mise run buildpassesmise run lint:super-linterpassesmise run testpassesset-release-version-github-pages.shreplaces$versionin bothquickstart.mdand OTel docs