Skip to content

Add OTel support module and make examples standalone#1868

Merged
zeitlinger merged 5 commits intomainfrom
otel-support
Feb 13, 2026
Merged

Add OTel support module and make examples standalone#1868
zeitlinger merged 5 commits intomainfrom
otel-support

Conversation

@zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Feb 12, 2026

Inspired by #1854 (comment)

Summary

  • Add prometheus-metrics-otel-support POM module that bundles the OTel SDK and Prometheus exporter as a single dependency, with the OTel instrumentation BOM imported for automatic version management
  • Add prometheus-metrics-otel-support to the BOM so users can manage it via dependencyManagement
  • Make all example projects standalone (no parent POM) — each example has its own groupId, version, and imports prometheus-metrics-bom directly, so users can copy-paste an example and build it without the parent chain
  • Add docs page for the OTel Support module (docs/content/otel/support.md)
  • Replace hardcoded 1.5.0 versions in OTel docs with $version placeholder and update set-release-version-github-pages.sh to process all markdown files under docs/content

Test plan

  • mise run build passes
  • mise run lint:super-linter passes
  • mise run test passes
  • Verify set-release-version-github-pages.sh replaces $version in both quickstart.md and OTel docs

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>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-support module and publishes it via the root build + prometheus-metrics-bom.
  • Removes the examples parent POM relationship so each example declares its own groupId/version and imports prometheus-metrics-bom directly.
  • 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.

- 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>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-instrumentation-bom-alpha</artifactId>
<version>${otel.instrumentation.version}</version>
<version>2.24.0-alpha</version>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zeitlinger zeitlinger merged commit 3538175 into main Feb 13, 2026
10 checks passed
@zeitlinger zeitlinger deleted the otel-support branch February 13, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants