Skip to content

Commit 6ef3d78

Browse files
authored
Merge branch 'main' into bulk-string-writes
2 parents a574173 + 39a83b9 commit 6ef3d78

File tree

11 files changed

+107
-14
lines changed

11 files changed

+107
-14
lines changed

examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>org.apache.tomcat.embed</groupId>
4040
<artifactId>tomcat-embed-core</artifactId>
41-
<version>11.0.2</version>
41+
<version>11.0.4</version>
4242
</dependency>
4343
</dependencies>
4444

examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>org.apache.tomcat.embed</groupId>
4040
<artifactId>tomcat-embed-core</artifactId>
41-
<version>11.0.2</version>
41+
<version>11.0.4</version>
4242
</dependency>
4343
</dependencies>
4444

examples/example-exporter-servlet-tomcat/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>org.apache.tomcat.embed</groupId>
4040
<artifactId>tomcat-embed-core</artifactId>
41-
<version>11.0.2</version>
41+
<version>11.0.4</version>
4242
</dependency>
4343
</dependencies>
4444

integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<dependency>
3434
<groupId>org.apache.tomcat.embed</groupId>
3535
<artifactId>tomcat-embed-core</artifactId>
36-
<version>11.0.2</version>
36+
<version>11.0.4</version>
3737
</dependency>
3838
</dependencies>
3939

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<automatic.module.name>--module-name-need-to-be-overriden--</automatic.module.name>
2020
<guava.version>33.4.0-jre</guava.version>
2121
<junit-jupiter.version>5.11.4</junit-jupiter.version>
22-
<otel.instrumentation.version>2.12.0-alpha</otel.instrumentation.version>
22+
<otel.instrumentation.version>2.13.0-alpha</otel.instrumentation.version>
2323
<java.version>8</java.version>
2424
<jacoco.line-coverage>0.70</jacoco.line-coverage>
2525
<checkstyle.skip>false</checkstyle.skip>

prometheus-metrics-exposition-formats/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333
<artifactId>protobuf-java</artifactId>
3434
<version>${protobuf-java.version}</version>
3535
</dependency>
36+
37+
<dependency>
38+
<groupId>io.prometheus</groupId>
39+
<artifactId>prometheus-metrics-exposition-textformats</artifactId>
40+
<version>${project.version}</version>
41+
<scope>test</scope>
42+
<type>test-jar</type>
43+
</dependency>
3644
</dependencies>
3745

3846
<build>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package io.prometheus.metrics.expositionformats;
2+
3+
import static org.assertj.core.api.Assertions.assertThat;
4+
5+
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_29_3.Metrics;
6+
import io.prometheus.metrics.expositionformats.internal.PrometheusProtobufWriterImpl;
7+
import io.prometheus.metrics.expositionformats.internal.ProtobufUtil;
8+
import io.prometheus.metrics.model.snapshots.MetricSnapshot;
9+
10+
class ProtobufExpositionFormatsTest extends ExpositionFormatsTest {
11+
12+
@Override
13+
protected void assertPrometheusProtobuf(String expected, MetricSnapshot snapshot) {
14+
PrometheusProtobufWriterImpl writer = new PrometheusProtobufWriterImpl();
15+
Metrics.MetricFamily protobufData = writer.convert(snapshot);
16+
String actual = ProtobufUtil.shortDebugString(protobufData);
17+
assertThat(actual).isEqualTo(expected);
18+
}
19+
}

prometheus-metrics-exposition-textformats/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
<properties>
2121
<automatic.module.name>io.prometheus.writer.text</automatic.module.name>
22+
<jacoco.line-coverage>0.50</jacoco.line-coverage>
2223
</properties>
2324

2425
<dependencies>
@@ -33,4 +34,20 @@
3334
<version>${project.version}</version>
3435
</dependency>
3536
</dependencies>
37+
38+
<build>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.apache.maven.plugins</groupId>
42+
<artifactId>maven-jar-plugin</artifactId>
43+
<executions>
44+
<execution>
45+
<goals>
46+
<goal>test-jar</goal>
47+
</goals>
48+
</execution>
49+
</executions>
50+
</plugin>
51+
</plugins>
52+
</build>
3653
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package io.prometheus.metrics.expositionformats;
2+
3+
import static org.assertj.core.api.Assertions.assertThat;
4+
5+
import io.prometheus.metrics.model.snapshots.MetricSnapshots;
6+
import org.junit.jupiter.api.Test;
7+
8+
class ExpositionFormatWriterTest {
9+
10+
private final ExpositionFormatWriter writer = new OpenMetricsTextFormatWriter(false, false);
11+
12+
@Test
13+
void toDebugString() {
14+
assertThat(writer.toDebugString(new MetricSnapshots())).isEqualTo("# EOF\n");
15+
}
16+
17+
@Test
18+
void isAvailable() {
19+
assertThat(writer.isAvailable()).isTrue();
20+
}
21+
}

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
import static org.assertj.core.api.Assertions.assertThat;
44

5-
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_29_3.Metrics;
6-
import io.prometheus.metrics.expositionformats.internal.PrometheusProtobufWriterImpl;
7-
import io.prometheus.metrics.expositionformats.internal.ProtobufUtil;
85
import io.prometheus.metrics.model.snapshots.ClassicHistogramBuckets;
96
import io.prometheus.metrics.model.snapshots.CounterSnapshot;
107
import io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot;
@@ -2659,10 +2656,5 @@ private void assertPrometheusTextWithoutCreated(String expected, MetricSnapshot
26592656
assertThat(out).hasToString(expected);
26602657
}
26612658

2662-
private void assertPrometheusProtobuf(String expected, MetricSnapshot snapshot) {
2663-
PrometheusProtobufWriterImpl writer = new PrometheusProtobufWriterImpl();
2664-
Metrics.MetricFamily protobufData = writer.convert(snapshot);
2665-
String actual = ProtobufUtil.shortDebugString(protobufData);
2666-
assertThat(actual).isEqualTo(expected);
2667-
}
2659+
protected void assertPrometheusProtobuf(String expected, MetricSnapshot snapshot) {}
26682660
}

0 commit comments

Comments
 (0)