Summary
In 1.8.0, prometheus-metrics-exposition-textformats imports io.prometheus.metrics.expositionformats.internal, but no artifact exports it. The classes exist in prometheus-metrics-exposition-formats, which keeps them unexported, so the two bundles cannot be wired together and any OSGi container fails to resolve io.prometheus.metrics.expositionformats.
Evidence
From the published 1.8.0 manifests:
prometheus-metrics-exposition-textformats-1.8.0.jar
Export-Package: io.prometheus.metrics.expositionformats
Import-Package: io.prometheus.metrics.expositionformats.internal <- nothing provides this
prometheus-metrics-exposition-formats-1.8.0.jar
Export-Package: io.prometheus.metrics.expositionformats.generated
io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_35_0
Import-Package: io.prometheus.metrics.expositionformats
The implementation classes are in the second jar but not exported from it:
$ unzip -l prometheus-metrics-exposition-formats-1.8.0.jar | grep expositionformats/internal
io/prometheus/metrics/expositionformats/internal/PrometheusProtobufWriterImpl.class
io/prometheus/metrics/expositionformats/internal/ProtobufUtil.class
prometheus-metrics-exposition-textformats-1.8.0.jar contains none of them, so the import is not satisfiable from within its own bundle either.
How I hit it
Micrometer has an OSGi test that is still pinned to the old simpleclient because of an earlier failure (micrometer-metrics/micrometer#5063). Switching it to the current client, the bnd resolution now stops here:
micrometer-osgi-test-tests cannot be resolved
⇒ Import-Package io.micrometer.prometheusmetrics could not be provided
⇒ Import-Package io.prometheus.metrics.expositionformats;version=[1.8.0,2.0.0) could not be provided
⇒ Import-Package io.prometheus.metrics.expositionformats.internal could not be provided
The blocker reported back in 2024 (the shaded protobuf module not being a bundle) is gone, this is what is left.
Possible fixes
Either export io.prometheus.metrics.expositionformats.internal from prometheus-metrics-exposition-formats, or move the two classes so the package does not have to cross a bundle boundary. The first is a one line manifest change but does publish an internal package; the second is cleaner if you would rather not.
I saw #989 was closed as not planned, though that was about prometheus-metrics-shaded-protobuf, which no longer exists in 1.8.0. This one is a metadata inconsistency between two shipped artifacts rather than a request for OSGi support, so I thought it was worth reporting separately. Happy to send a PR for whichever direction you prefer.
Environment
io.prometheus:* 1.8.0
- bnd resolution via Micrometer's
micrometer-osgi-test (Felix framework)
Summary
In 1.8.0,
prometheus-metrics-exposition-textformatsimportsio.prometheus.metrics.expositionformats.internal, but no artifact exports it. The classes exist inprometheus-metrics-exposition-formats, which keeps them unexported, so the two bundles cannot be wired together and any OSGi container fails to resolveio.prometheus.metrics.expositionformats.Evidence
From the published 1.8.0 manifests:
The implementation classes are in the second jar but not exported from it:
prometheus-metrics-exposition-textformats-1.8.0.jarcontains none of them, so the import is not satisfiable from within its own bundle either.How I hit it
Micrometer has an OSGi test that is still pinned to the old
simpleclientbecause of an earlier failure (micrometer-metrics/micrometer#5063). Switching it to the current client, the bnd resolution now stops here:The blocker reported back in 2024 (the shaded protobuf module not being a bundle) is gone, this is what is left.
Possible fixes
Either export
io.prometheus.metrics.expositionformats.internalfromprometheus-metrics-exposition-formats, or move the two classes so the package does not have to cross a bundle boundary. The first is a one line manifest change but does publish an internal package; the second is cleaner if you would rather not.I saw #989 was closed as not planned, though that was about
prometheus-metrics-shaded-protobuf, which no longer exists in 1.8.0. This one is a metadata inconsistency between two shipped artifacts rather than a request for OSGi support, so I thought it was worth reporting separately. Happy to send a PR for whichever direction you prefer.Environment
io.prometheus:*1.8.0micrometer-osgi-test(Felix framework)