Repository navigation
fix: mark tracer initializer OSGi import optional - #2528
Merged
zeitlinger merged 1 commit intoOct 6, 2026
Merged
zeitlinger merged 1 commit into
zeitlinger merged 1 commit into
Conversation
prometheus-metrics-core referenced SpanContextSupplier, so bnd required io.prometheus.metrics.tracer.initializer even when Micrometer excludes that artifact. Mark the import optional, the same way exposition-textformats treats its internal package. Fixes prometheus#2516 Signed-off-by: kalayciburak <kalayciburak1996@gmail.com>
kalayciburak
requested review from
dhoard,
fstab,
jaydeluca and
zeitlinger
as code owners
October 6, 2026 09:46
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.
Problem
prometheus-metrics-corereferencesSpanContextSupplier, so bnd adds a required OSGi import ofio.prometheus.metrics.tracer.initializer. An OSGi runtime that leaves outprometheus-metrics-tracer-initializercannot resolve the bundle. Micrometer excludes that artifact and supplies its own supplier.Fix
Mark that import
resolution:=optional, the same wayprometheus-metrics-exposition-textformatstreatsexpositionformats.internal.Automatic-Module-Nameis kept. Other imports are unchanged.Fixes #2516
How tested
JAVA_HOME=25 ./mvnw test -pl prometheus-metrics-core -am -Dtest=OsgiBundleManifestTest -Dsurefire.failIfNoSpecifiedTests=false -Dcoverage.skip=trueBefore the instruction, the generated clause was
io.prometheus.metrics.tracer.initializerand the test failed because it did not containresolution:=optional. After the instruction, that test passed.Same reactor command with
-Dtest='!OsgiBundleManifestTest'also passed, including 175 tests inprometheus-metrics-core.