Skip to content

Conversation

@zeitlinger
Copy link
Member

No description provided.

@zeitlinger zeitlinger self-assigned this Feb 28, 2025
@zeitlinger zeitlinger changed the title add option to skip the shaded protobuf libraries add option to skip the shaded protobuf and otel libraries Mar 3, 2025
@zeitlinger zeitlinger force-pushed the non-shaded-protobuf branch from 8c90b76 to 5174242 Compare March 6, 2025 13:53
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger force-pushed the non-shaded-protobuf branch from 5174242 to 525ee92 Compare April 15, 2025 12:11
@zeitlinger zeitlinger merged commit 6106004 into main Apr 15, 2025
4 checks passed
@zeitlinger zeitlinger deleted the non-shaded-protobuf branch April 15, 2025 12:41
@soc
Copy link

soc commented May 14, 2025

Hey, is there any information to read up on to understand why this spins up a separate artifact by hand and introduces a different module name, instead of being a standard classifier?

Thanks!

@zeitlinger
Copy link
Member Author

Hey, is there any information to read up on to understand why this spins up a separate artifact by hand and introduces a different module name, instead of being a standard classifier?

Thanks!

I had not considered that option - sounds much better actually 😄

I think this is so new that we can still make that change - a PR would be highly welcome!

@soc
Copy link

soc commented May 16, 2025

@zeitlinger I'd love to, though I'm also not an expert, but I'm away from development for a while starting today. :-(

@zeitlinger
Copy link
Member Author

I tried the following - but it doesn't work because both maven projects still share the same pom

ll ~/.m2/repository/io/prometheus/prometheus-metrics-exposition-formats/1.4.0-SNAPSHOT 
total 2,0M
-rw-rw-r-- 1 gregor gregor 1,2K Mai 16 17:28 maven-metadata-local.xml
-rw-rw-r-- 1 gregor gregor 174K Mai 16 17:28 prometheus-metrics-exposition-formats-1.4.0-SNAPSHOT.jar
-rw-rw-r-- 1 gregor gregor 172K Mai 16 17:28 prometheus-metrics-exposition-formats-1.4.0-SNAPSHOT-no-protobuf.jar
-rw-rw-r-- 1 gregor gregor 4,9K Mai 16 17:26 prometheus-metrics-exposition-formats-1.4.0-SNAPSHOT.pom
-rw-rw-r-- 1 gregor gregor 1,6M Mai 16 17:21 prometheus-metrics-exposition-formats-1.4.0-SNAPSHOT-sources.jar
Index: prometheus-metrics-exposition-formats/pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/prometheus-metrics-exposition-formats/pom.xml b/prometheus-metrics-exposition-formats/pom.xml
--- a/prometheus-metrics-exposition-formats/pom.xml	(revision 523ed272db0d98df55986bf3cafd74c5e5633647)
+++ b/prometheus-metrics-exposition-formats/pom.xml	(date 1747409199333)
@@ -10,7 +10,7 @@
     <version>1.4.0-SNAPSHOT</version>
   </parent>
 
-  <artifactId>prometheus-metrics-exposition-formats-no-protobuf</artifactId>
+  <artifactId>prometheus-metrics-exposition-formats</artifactId>
   <packaging>bundle</packaging>
 
   <name>Prometheus Metrics Exposition Formats no protobuf</name>
@@ -63,6 +63,22 @@
 
   <build>
     <plugins>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+            <configuration>
+              <classifier>no-protobuf</classifier>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>build-helper-maven-plugin</artifactId>

@lenoch7
Copy link
Contributor

lenoch7 commented Jun 20, 2025

@zeitlinger

Hello, I am very sorry, probably I missed something, but...
Is it still possible to use "shaded" protobuf? Without need to always use prometheus-metrics-exposition-formats-no-protobuf (with regular protobuf dependency)?

I am upgrading from version 1.3.6 to 1.3.8 (in context of SpringBoot upgrade 3.4.5 to 3.4.7).

Till now I used only prometheus-metrics-exposition-formats 1.3.6, which included:

  • shaded protobuf (package io.prometheus.metrics.shaded.com_google_protobuf_4_29_3)
  • exposition formats java classes (package io.prometheus.metrics.expositionformats)

But prometheus-metrics-exposition-formats 1.3.8 includes:

  • only shaded protobuf (package io.prometheus.metrics.shaded.com_google_protobuf_4_31_0)
  • but exposition formats java classes are missing (where is package io.prometheus.metrics.expositionformats?)
  • instead of, there is prometheus-metrics-exposition-formats-no-protobuf dependency, with exposition formats java classes (io.prometheus.metrics.expositionformats), but these classes used (is prepared to used) regular protobuf dependency

From my point of view it seems like exposition formats java classes, which use shaded protobuf are completely missing, what means, that prometheus-metrics-exposition-formats-no-protobuf is always required.

What I missed?
Is it add option to skip the shaded protobuf and otel libraries title confusing and there is no way how to use shaded protobuf?

Thank you.
Radek Kraus.

@zeitlinger
Copy link
Member Author

@zeitlinger

Hello, I am very sorry, probably I missed something, but... Is it still possible to use "shaded" protobuf? Without need to always use prometheus-metrics-exposition-formats-no-protobuf (with regular protobuf dependency)?

yes - this is still the default

Can you create a new issue and add the dependency tree?

@lenoch7
Copy link
Contributor

lenoch7 commented Jun 23, 2025

Thank you for answer/support.
It seems, that issue 1431 was already created. I added simple example, where dependency tree can be executed and compared between version 1.3.6 and 1.3.8

zeitlinger pushed a commit that referenced this pull request Jul 4, 2025
Fixes #1431 issue, where shaded
exposition-formats/exported-opentelemetry artifacts depends on "no
shaded" protobuf/otel dependency (caused by #1293).

See details in #1431 issue.

Signed-off-by: Radek Kraus <6397085+lenoch7@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

4 participants