Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Exporter Pushgateway runtime issue in versions 1.3.4 and above

Đang mở
#1,411 11 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
java
Lĩnh vực
observability-sre

Hướng nghiên cứu

So sánh behavior của dependency ở 1.3.3 và 1.3.4 trong pom.xml, sau đó kiểm tra PushGateway.java quanh các dòng được tham chiếu và cách đóng gói shaded-jar. Truy tìm lý do PrometheusProtobufWriter không khả dụng tại runtime và xác nhận rằng định dạng Pushgateway mặc định khởi tạo thành công trong một shaded jar.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Version 1.3.3 works correctly
I believe it is caused by https://github.com/prometheus/client_java/pull/1190
I am using default format in pushgateway which I think is protobuf.

Dependencies in pom.xml:

<dependency>
  <groupId>io.prometheus</groupId>
  <artifactId>prometheus-metrics-core</artifactId>
  <version>1.3.4</version>
</dependency>
<dependency>
  <groupId>io.prometheus</groupId>
  <artifactId>prometheus-metrics-exporter-pushgateway</artifactId>
  <version>1.3.4</version>
</dependency>

Runtime issue from shaded jar:

Exception in thread (...) java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: class io.prometheus.metrics.expositionformats.PrometheusProtobufWriter is not available
at io.prometheus.metrics.exporter.pushgateway.PushGateway.<init>(PushGateway.java:99)
at io.prometheus.metrics.exporter.pushgateway.PushGateway.<init>(PushGateway.java:77)
at io.prometheus.metrics.exporter.pushgateway.PushGateway$Builder.build(PushGateway.java:456)
(...)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.RuntimeException: class io.prometheus.metrics.expositionformats.PrometheusProtobufWriter is not available

So I guess it complains about
https://github.com/prometheus/client_java/blob/main/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/PushGateway.java#L9
or
https://github.com/prometheus/client_java/blob/main/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/PushGateway.java#L114

Ngôn ngữ chính
Java
Star
2.3k
Fork
833
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
86

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của prometheus/client_java

Tất cả issue của prometheus/client_java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.