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

Test osgi with new Prometheus client #5063

Open
shakuzen opened this issue May 10, 2024 · 4 comments
Open

Test osgi with new Prometheus client #5063

shakuzen opened this issue May 10, 2024 · 4 comments
Labels
help wanted An issue that a contributor can help us with type: task A general task
Milestone

Comments

@shakuzen
Copy link
Member

shakuzen commented May 10, 2024

See the description of #4846.

The OSGi test was failing when the new Prometheus client was used, so it was updated to use the -simpleclient module for now.

We should make sure we're testing with the latest Prometheus client and figure out what the issue is that's causing it to fail.

@shakuzen shakuzen added the type: task A general task label May 10, 2024
@shakuzen shakuzen added this to the 1.13.x milestone May 10, 2024
@shakuzen
Copy link
Member Author

shakuzen commented May 10, 2024

I just tried it locally by changing the dependency in micrometer-osgi-test and fixing the imports. The following is the error output I'm seeing:

> Task :micrometer-osgi-test:resolve FAILED
Resolution failed. Capabilities satisfying the following requirements could not be found:
    [<<INITIAL>>]
      ⇒ osgi.identity: (osgi.identity=micrometer-osgi-test-tests)
          ⇒ [micrometer-osgi-test-tests version=1.13.0.SNAPSHOT]
              ⇒ osgi.wiring.package: (&(osgi.wiring.package=io.micrometer.prometheusmetrics)(version>=1.13.0)(!(version>=2.0.0)))
                  ⇒ [micrometer-registry-prometheus version=1.13.0.SNAPSHOT]
                      ⇒ osgi.wiring.package: (&(osgi.wiring.package=io.prometheus.metrics.core.exemplars)(version>=1.2.0)(!(version>=2.0.0)))
                          ⇒ [io.prometheus.metrics-core version=1.2.1]
                              ⇒ osgi.wiring.package: (&(osgi.wiring.package=io.prometheus.metrics.tracer.initializer)(version>=1.2.0)(!(version>=2.0.0)))
    [io.prometheus.metrics-exposition-formats version=1.2.1]
      ⇒ osgi.wiring.package: (osgi.wiring.package=io.prometheus.metrics.shaded.com_google_protobuf_3_25_3)
The following requirements are optional:
    [junit-platform-commons version=1.10.2]
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.apiguardian.api)(version>=1.1.0)(!(version>=2.0.0)))
    [junit-jupiter-params version=5.10.2]
      ⇒ osgi.wiring.package: (osgi.wiring.package=kotlin.jvm.internal)
      ⇒ osgi.wiring.package: (osgi.wiring.package=kotlin)
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.apiguardian.api)(version>=1.1.0)(!(version>=2.0.0)))
    [micrometer-core version=1.13.0.SNAPSHOT]
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=javax.annotation)(version>=3.0.2))
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=javax.annotation.meta)(version>=3.0.2))
    [junit-platform-launcher version=1.10.2]
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.apiguardian.api)(version>=1.1.0)(!(version>=2.0.0)))
    [junit-platform-engine version=1.10.2]
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.apiguardian.api)(version>=1.1.0)(!(version>=2.0.0)))
    [micrometer-commons version=1.13.0.SNAPSHOT]
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=javax.annotation)(version>=3.0.2))
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=javax.annotation.meta)(version>=3.0.2))
    [junit-jupiter-engine version=5.10.2]
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.apiguardian.api)(version>=1.1.0)(!(version>=2.0.0)))
    [junit-jupiter-api version=5.10.2]
      ⇒ osgi.wiring.package: (osgi.wiring.package=kotlin.jvm.internal)
      ⇒ osgi.wiring.package: (osgi.wiring.package=kotlin)
      ⇒ osgi.wiring.package: (osgi.wiring.package=kotlin.collections)
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.apiguardian.api)(version>=1.1.0)(!(version>=2.0.0)))
      ⇒ osgi.wiring.package: (osgi.wiring.package=kotlin.jvm.functions)
    [assertj-core version=3.25.3]
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.junit.platform.commons.support)(version>=1.10.0)(!(version>=2.0.0)))
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.junit.jupiter.api)(version>=5.10.0)(!(version>=6.0.0)))
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.opentest4j)(version>=1.3.0)(!(version>=2.0.0)))
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.junit.jupiter.api.parallel)(version>=5.10.0)(!(version>=6.0.0)))
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.junit.platform.commons.annotation)(version>=1.10.0)(!(version>=2.0.0)))
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.hamcrest)(version>=2.2.0)(!(version>=3.0.0)))
      ⇒ osgi.wiring.package: (osgi.wiring.package=org.junit.runner)
      ⇒ osgi.wiring.package: (osgi.wiring.package=org.junit.rules)
      ⇒ osgi.wiring.package: (osgi.wiring.package=org.junit.runners.model)
      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.junit.jupiter.api.extension)(version>=5.10.0)(!(version>=6.0.0)))

FAILURE: Build failed with an exception.

@driessamyn do you have any bandwidth to help take a look at this?

@shakuzen shakuzen added the help wanted An issue that a contributor can help us with label May 13, 2024
@driessamyn
Copy link
Contributor

Sorry for the delayed response.
I've been looking into this and I think this is an issue on the prometheus side.
io.prometheus.metrics.expositionformats has a dependency on io.prometheus.metrics.shaded.com_google_protobuf_3_21_7 which is not an OSGi bundle 🤔

@fstab
Copy link
Contributor

fstab commented May 17, 2024

Thanks for finding this.

@driessamyn I'm the maintainer of the Prometheus Java client library. I'm not an OSGI expert. Your comment sounds like it would be sufficient to add

<packaging>bundle</packaging>

to the pom.xml of the prometheus-metrics-shaded-opentelemetry module (all other modules have that, so it seems to be just an oversight that it's missing).

I'm happy to give it a try, or do you think something else is needed?

@driessamyn
Copy link
Contributor

Thanks for finding this.

@driessamyn I'm the maintainer of the Prometheus Java client library. I'm not an OSGI expert. Your comment sounds like it would be sufficient to add

<packaging>bundle</packaging>

to the pom.xml of the prometheus-metrics-shaded-opentelemetry module (all other modules have that, so it seems to be just an oversight that it's missing).

I'm happy to give it a try, or do you think something else is needed?

Hi @fstab ,

I'm not familiar with the Maven build tooling for OSGi, but that sounds right.
When unpacking the produced jar, the metadata should have OSGi exports, similar to this:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted An issue that a contributor can help us with type: task A general task
Projects
None yet
Development

No branches or pull requests

3 participants