You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
expositionformats.internal is imported by exposition-textformats but exported by nothing, breaking OSGi resolution #2395
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.
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)
Activity