Skip to content

Commit 3bc54e1

Browse files
committed
add prometheus-writer-protobuf, which doesn't have the shaded protobuf
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent d7379e3 commit 3bc54e1

File tree

10 files changed

+125
-62
lines changed

10 files changed

+125
-62
lines changed

pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<automatic.module.name>--module-name-need-to-be-overriden--</automatic.module.name>
2020
<junit-jupiter.version>5.11.3</junit-jupiter.version>
2121
<otel.instrumentation.version>2.9.0-alpha</otel.instrumentation.version>
22+
<protobuf-java.version>4.28.3</protobuf-java.version>
2223
<java.version>8</java.version>
2324
<jacoco.line-coverage>0.70</jacoco.line-coverage>
2425
<coverage.skip>false</coverage.skip>
@@ -65,6 +66,7 @@
6566
<module>prometheus-metrics-model</module>
6667
<module>prometheus-metrics-tracer</module>
6768
<module>prometheus-writer-textformat</module>
69+
<module>prometheus-writer-protobuf</module>
6870
<module>prometheus-metrics-exposition-formats</module>
6971
<module>prometheus-metrics-exporter-common</module>
7072
<module>prometheus-metrics-exporter-servlet-jakarta</module>
@@ -208,6 +210,16 @@
208210
<artifactId>maven-enforcer-plugin</artifactId>
209211
<version>3.5.0</version>
210212
</plugin>
213+
<plugin>
214+
<groupId>org.codehaus.mojo</groupId>
215+
<artifactId>build-helper-maven-plugin</artifactId>
216+
<version>3.6.0</version>
217+
</plugin>
218+
<plugin>
219+
<groupId>org.codehaus.mojo</groupId>
220+
<artifactId>exec-maven-plugin</artifactId>
221+
<version>3.5.0</version>
222+
</plugin>
211223
<plugin>
212224
<groupId>com.diffplug.spotless</groupId>
213225
<artifactId>spotless-maven-plugin</artifactId>

prometheus-metrics-exporter-opentelemetry/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
<plugin>
113113
<groupId>org.codehaus.mojo</groupId>
114114
<artifactId>build-helper-maven-plugin</artifactId>
115-
<version>3.6.0</version>
116115
<executions>
117116
<execution>
118117
<id>regex-property</id>

prometheus-metrics-exposition-formats/pom.xml

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,21 @@
1919

2020
<properties>
2121
<automatic.module.name>io.prometheus.metrics.expositionformats</automatic.module.name>
22-
<protobuf-java.version>4.28.3</protobuf-java.version>
2322
</properties>
2423

2524
<dependencies>
2625
<dependency>
2726
<groupId>io.prometheus</groupId>
28-
<artifactId>prometheus-writer-textformat</artifactId>
27+
<artifactId>prometheus-writer-protobuf</artifactId>
2928
<version>${project.version}</version>
3029
</dependency>
31-
<dependency>
32-
<groupId>com.google.protobuf</groupId>
33-
<artifactId>protobuf-java</artifactId>
34-
<version>${protobuf-java.version}</version>
35-
</dependency>
3630
</dependencies>
3731

3832
<build>
3933
<plugins>
4034
<plugin>
4135
<groupId>org.codehaus.mojo</groupId>
4236
<artifactId>build-helper-maven-plugin</artifactId>
43-
<version>3.6.0</version>
4437
<executions>
4538
<execution>
4639
<id>regex-property</id>
@@ -55,61 +48,8 @@
5548
<failIfNoMatch>true</failIfNoMatch>
5649
</configuration>
5750
</execution>
58-
<execution>
59-
<id>negate-prop</id>
60-
<phase>initialize</phase>
61-
<goals>
62-
<goal>bsh-property</goal>
63-
</goals>
64-
<configuration>
65-
<source>skip.protobuf.generation = !"true".equals(System.getenv("PROTO_GENERATION"));</source>
66-
<properties>
67-
<property>skip.protobuf.generation</property>
68-
</properties>
69-
</configuration>
70-
</execution>
71-
<execution>
72-
<id>add-source</id>
73-
<phase>generate-sources</phase>
74-
<goals>
75-
<goal>add-source</goal>
76-
</goals>
77-
<configuration>
78-
<sources>
79-
<source>src/main/generated/</source>
80-
</sources>
81-
</configuration>
82-
</execution>
8351
</executions>
8452
</plugin>
85-
<plugin>
86-
<artifactId>exec-maven-plugin</artifactId>
87-
<groupId>org.codehaus.mojo</groupId>
88-
<version>3.5.0</version>
89-
<executions>
90-
<execution>
91-
<id>Generate Protobuf</id>
92-
<phase>generate-sources</phase>
93-
<goals>
94-
<goal>exec</goal>
95-
</goals>
96-
<configuration>
97-
<skip>${skip.protobuf.generation}</skip>
98-
<executable>${project.basedir}/generate-protobuf.sh</executable>
99-
<arguments>
100-
<argument>${project.basedir}/src/main/generated</argument>
101-
<argument>${protobuf-java.string-version}</argument>
102-
</arguments>
103-
</configuration>
104-
</execution>
105-
</executions>
106-
</plugin>
107-
<plugin>
108-
<artifactId>maven-javadoc-plugin</artifactId>
109-
<configuration>
110-
<sourcepath>src/main/java;src/main/generated</sourcepath>
111-
</configuration>
112-
</plugin>
11353
<plugin>
11454
<groupId>org.apache.maven.plugins</groupId>
11555
<artifactId>maven-shade-plugin</artifactId>
File renamed without changes.

prometheus-writer-protobuf/pom.xml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>io.prometheus</groupId>
8+
<artifactId>client_java</artifactId>
9+
<version>1.3.2</version>
10+
</parent>
11+
12+
<artifactId>prometheus-writer-protobuf</artifactId>
13+
<packaging>bundle</packaging>
14+
15+
<name>Prometheus Metrics Exposition Protobuf Formats</name>
16+
<description>
17+
Prometheus exposition protobuf formats.
18+
</description>
19+
20+
<properties>
21+
<automatic.module.name>io.prometheus.writer.protobuf</automatic.module.name>
22+
</properties>
23+
24+
<dependencies>
25+
<dependency>
26+
<groupId>io.prometheus</groupId>
27+
<artifactId>prometheus-writer-textformat</artifactId>
28+
<version>${project.version}</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>com.google.protobuf</groupId>
32+
<artifactId>protobuf-java</artifactId>
33+
<version>${protobuf-java.version}</version>
34+
</dependency>
35+
</dependencies>
36+
37+
<build>
38+
<plugins>
39+
<plugin>
40+
<groupId>org.codehaus.mojo</groupId>
41+
<artifactId>build-helper-maven-plugin</artifactId>
42+
<executions>
43+
<execution>
44+
<id>regex-property</id>
45+
<goals>
46+
<goal>regex-property</goal>
47+
</goals>
48+
<configuration>
49+
<name>protobuf-java.string-version</name>
50+
<value>${protobuf-java.version}</value>
51+
<regex>\.</regex>
52+
<replacement>_</replacement>
53+
<failIfNoMatch>true</failIfNoMatch>
54+
</configuration>
55+
</execution>
56+
<execution>
57+
<id>negate-prop</id>
58+
<phase>initialize</phase>
59+
<goals>
60+
<goal>bsh-property</goal>
61+
</goals>
62+
<configuration>
63+
<source>skip.protobuf.generation = !"true".equals(System.getenv("PROTO_GENERATION"));</source>
64+
<properties>
65+
<property>skip.protobuf.generation</property>
66+
</properties>
67+
</configuration>
68+
</execution>
69+
<execution>
70+
<id>add-source</id>
71+
<phase>generate-sources</phase>
72+
<goals>
73+
<goal>add-source</goal>
74+
</goals>
75+
<configuration>
76+
<sources>
77+
<source>src/main/generated/</source>
78+
</sources>
79+
</configuration>
80+
</execution>
81+
</executions>
82+
</plugin>
83+
<plugin>
84+
<groupId>org.codehaus.mojo</groupId>
85+
<artifactId>exec-maven-plugin</artifactId>
86+
<executions>
87+
<execution>
88+
<id>Generate Protobuf</id>
89+
<phase>generate-sources</phase>
90+
<goals>
91+
<goal>exec</goal>
92+
</goals>
93+
<configuration>
94+
<skip>${skip.protobuf.generation}</skip>
95+
<executable>${project.basedir}/generate-protobuf.sh</executable>
96+
<arguments>
97+
<argument>${project.basedir}/src/main/generated</argument>
98+
<argument>${protobuf-java.string-version}</argument>
99+
</arguments>
100+
</configuration>
101+
</execution>
102+
</executions>
103+
</plugin>
104+
<plugin>
105+
<artifactId>maven-javadoc-plugin</artifactId>
106+
<configuration>
107+
<sourcepath>src/main/java;src/main/generated</sourcepath>
108+
</configuration>
109+
</plugin>
110+
</plugins>
111+
</build>
112+
</project>
File renamed without changes.

prometheus-metrics-exposition-formats/src/main/generated/io/prometheus/metrics/expositionformats/generated/com_google_protobuf_4_28_2/Metrics.java renamed to prometheus-writer-protobuf/src/main/generated/io/prometheus/metrics/expositionformats/generated/com_google_protobuf_4_28_2/Metrics.java

File renamed without changes.

prometheus-metrics-exposition-formats/src/main/java/io/prometheus/metrics/expositionformats/PrometheusProtobufWriter.java renamed to prometheus-writer-protobuf/src/main/java/io/prometheus/metrics/expositionformats/PrometheusProtobufWriter.java

File renamed without changes.

prometheus-metrics-exposition-formats/src/main/java/io/prometheus/metrics/expositionformats/ProtobufUtil.java renamed to prometheus-writer-protobuf/src/main/java/io/prometheus/metrics/expositionformats/ProtobufUtil.java

File renamed without changes.

prometheus-metrics-exposition-formats/src/test/java/io/prometheus/metrics/expositionformats/ExpositionFormatsTest.java renamed to prometheus-writer-protobuf/src/test/java/io/prometheus/metrics/expositionformats/ExpositionFormatsTest.java

File renamed without changes.

0 commit comments

Comments
 (0)