expfmt: OpenMetrics 1.0 output with a unit that is not a name suffix fails the whole scrape in Prometheus
Maintainer thường phản hồi trong vòng 2 ngày
@itsmeasadali đang làm issue này rồi.
Từ ngày 10/10/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- observability-sre
Hướng nghiên cứu
Start at MetricFamilyToOpenMetrics and inspect the OpenMetrics 1.0 parsing behavior described in the reproduction. Review test case 16 and determine which proposed behavior is preferred; done when the non-suffix unit case no longer causes Prometheus to reject the exposition and the test reflects the decision.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Since #877, MetricFamilyToOpenMetrics no longer adds the unit to the metric name, but it still writes the # UNIT line. OpenMetrics 1.0 requires the unit to be a suffix of the name, and Prometheus's OpenMetrics 1.0 parser rejects the exposition, so every metric on the target is lost (the same failure as prometheus/client_golang#1990).
Reproduction with client_golang v1.24.1:
reg := prometheus.NewRegistry()
reg.MustRegister(prometheus.NewCounter(prometheus.CounterOpts{
Name: "request_duration_total", Help: "Time spent.", Unit: "seconds",
}))
// promhttp.HandlerFor(reg, promhttp.HandlerOpts{EnableOpenMetrics: true})
# HELP request_duration Time spent.
# TYPE request_duration counter
# UNIT request_duration seconds
request_duration_total 1.5
# EOF
Prometheus: unit "seconds" not a suffix of metric "request_duration".
Options I can see:
- The OpenMetrics 1.0 encoder omits
# UNITwhen the unit is not a suffix, the same way it already writes a counter without_totalasunknown"to avoid invalid OpenMetrics output". Names are never changed. (Test case 16 would change.) - Prometheus's OpenMetrics 1.0 parser stops rejecting it, following OpenMetrics 2.0, where the suffix is only a SHOULD.
Happy to send a PR for whichever is preferred.
- Ngôn ngữ chính
- Go
- Star
- 297
- Fork
- 380
- Merge trung bình
- 3 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của prometheus/common
-
🧭 PR Triage DashboardĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
prometheus/common#1023 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 52/100
prometheus/common#876 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Feature request: Add client_assertion field for oauth2 jwt-bearer grant typeCó thể đã có người làm @alliasgher đã nhận 218 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
prometheus/common#869 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
prometheus/common#858 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
prometheus/common#815 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của prometheus/common
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
txn2/mcp-data-platform#2728 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
blinklabs-io/dingo#6504 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
SocialGouv/iterion#3413 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
orion-belt-dev/orion-belt#181 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
kubesmarts/logic-operator#105 ·
Maintainer thường phản hồi trong vòng 1 ngày