Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prometheus-metrics-shaded-protobuf OSGi support missing #989

Open
croister opened this issue Sep 27, 2024 · 0 comments
Open

prometheus-metrics-shaded-protobuf OSGi support missing #989

croister opened this issue Sep 27, 2024 · 0 comments

Comments

@croister
Copy link

I tried stepping to the 1.3.1 version of Prometheus Metrics from the 0.16.0 Prometheus SimpleClient version in a OSGi environment (Apache Karaf 4.4.6).
The "prometheus-metrics-shaded-protobuf" bundle does not start as expected, instead this error is thrown:

[INFO] Suppressed: java.lang.Exception: Unable to create resource for bundle mvn:io.prometheus/prometheus-metrics-shaded-protobuf/1.3.1
<...>
Caused by: org.osgi.framework.BundleException: Unable to build resource for mvn:io.prometheus/prometheus-metrics-shaded-protobuf/1.3.1: Unsupported 'Bundle-ManifestVersion' value: 1

This is caused by the fact that the original MANIFEST.MF file is excluded when the shaded jar is created.
That file contains the OSGi data that is needed for OSGi support.
It seems to fall back to version '1' of 'Bundle-ManifestVersion' when no information is found in the file.

To solve the issue the metadata needs to be kept in the new shaded jar file and maybe changed to the new group id/paths.
Either copy over the contents and replace paths or maybe even add the karaf-maven-plugin and generate new metadata.

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

No branches or pull requests

1 participant