Equivalent usage of Simpleclient in micrometer-registry-prometheus `1.13.x`

Đang mở
#1,226 5 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
25/100
Loại issue
Tài liệu
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
java, prometheus
Lĩnh vực
observability

Hướng nghiên cứu

Bắt đầu với 1.13 Migration Guide và các API PrometheusMeterRegistry, Collector, MetricFamilySamples và TextFormat được đề cập trong issue. Theo dõi các API tương ứng trong phiên bản hiện tại của client_java và lập tài liệu về các thành phần tương đương khi migration cho cả ba kịch bản, bao gồm mọi thay đổi code cần thiết. Công việc được xem là hoàn tất khi migration guide giải thích rõ ràng các thay thế này.

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

Mô tả

Hi Team! We are migrating our project from micrometer-registry-prometheus:1.12.8 to version 1.13.8 . I see that the io.prometheus:simpleclient:jar:0.16.0 has been deprecated.

We have few scenarios which I do not see in the migration guide.

Here are few scenarios,

  1. What is the equivalent of io.prometheus.client.Collector.MetricFamilySamples and the MetricFamilySamples.Sample
   PrometheusMeterRegistry instance = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
   MetricFamilySamples samples =  instance.getPrometheusRegistry().metricFamilySamples()
 if (sample == null || sample.name == null || sample.labelNames == null || sample.labelValues == null) {
      LOGGER.error("The provided Sample object is either null or one of its fields is null: {}", sample);
      throw new IllegalArgumentException("The provided Sample object is either null or one of its fields is null: " + sample);
    }
  1. Is the import io.prometheus.metrics.model.registry.Collector a replacement of io.prometheus.client.Collector, however, I couldn't find the below in the new Collector.
Enumeration<Collector.MetricFamilySamples> metricFamilySamples;
  1. Similarly how we can replace the io.prometheus.client.exporter.common.TextFormat?

Could you please help me with the code changes. Also, can you share any additional docs available that we can follow for migrating from the usage of simpleclient.

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.