prometheus / client_java

Prometheus instrumentation library for JVM applications
http://prometheus.github.io/client_java/
Apache License 2.0
2.19k stars 798 forks source link

Change in dependency visibility in a patch change #1219

Open jack-berg opened 2 days ago

jack-berg commented 2 days ago

Transitive dependencies and their scope changed in a patch release. Was this intentional?

prometheus-metrics-exporter-common-1.3.3.pom included:

<dependencies>
  <dependency>
    <groupId>io.prometheus</groupId>
    <artifactId>prometheus-metrics-model</artifactId>
    <version>${project.version}</version>
  </dependency>
  <dependency>
    <groupId>io.prometheus</groupId>
    <artifactId>prometheus-metrics-exposition-formats</artifactId>
    <version>${project.version}</version>
  </dependency>
</dependencies>

/prometheus-metrics-exporter-common-1.3.4.pom included:

<dependencies>
  <dependency>
    <groupId>io.prometheus</groupId>
    <artifactId>prometheus-metrics-model</artifactId>
    <version>${project.version}</version>
  </dependency>
  <dependency>
    <groupId>io.prometheus</groupId>
    <artifactId>prometheus-metrics-exposition-textformats</artifactId>
    <version>${project.version}</version>
  </dependency>
  <dependency>
    <groupId>io.prometheus</groupId>
    <artifactId>prometheus-metrics-exposition-formats</artifactId>
    <version>${project.version}</version>
    <scope>runtime</scope>
  </dependency>
</dependencies>

Changes:

This required me to intervene when updating. Not a big deal, but wanted to let you all know in case you have a policy to avoid this type of thing.

zeitlinger commented 1 day ago

Thanks for the feedback!

Yes, this was intentional - the make Protobuf optional part of https://github.com/prometheus/client_java/releases/tag/v1.3.4

We want to avoid breaking changes whenever possible, but there's no automated check for this. Can you point out what you had to change?

jack-berg commented 1 day ago

We had a test that was inadvertently using the prometheus-metrics-exposition-formats transitive dependency. This broke when the scope was reduced to runtime until, and was fixed by addingprometheus-metrics-exposition-formats as a dependency.

https://github.com/open-telemetry/opentelemetry-java/pull/6907/files