otel.sdk.processor.{span,log}.queue.capacity uses synchronous UpDownCounter recorded once in __init__

Đang mở Phù hợp với người mới
#5,891 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

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

  • #5902 của @2Zest — đã đóng, không merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
observability-sre

Hướng nghiên cứu

Đọc opentelemetry-sdk/src/opentelemetry/sdk/_shared_internal/_processor_metrics.py, đặc biệt là ProcessorMetrics.__init__ và register_queue_size. Kiểm tra cách callback observable hiện có cho kích thước hàng đợi được đăng ký và so sánh với các phép đo dung lượng đồng bộ. Công việc hoàn tất khi các chỉ số dung lượng hàng đợi span và log sử dụng callback observable, vẫn khả dụng sau khi đăng ký meter provider và xuyên suốt các chu kỳ thu thập Delta.

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

Mô tả

Description

In ProcessorMetrics.__init__, otel.sdk.processor.span.queue.capacity and otel.sdk.processor.log.queue.capacity are created as synchronous UpDownCounter instruments and recorded once during __init__:

https://github.com/open-telemetry/opentelemetry-python/blob/66ec88357e964dfda9b225975afc0d87ae4e95bb/opentelemetry-sdk/src/opentelemetry/sdk/_shared_internal/_processor_metrics.py#L93-L95

This causes queue.capacity to be missing in two common scenarios:

  1. When BatchSpanProcessor or BatchLogRecordProcessor is constructed before metrics.set_meter_provider(...) is called (including in opentelemetry-instrument auto-instrumentation), get_meter_provider() returns _ProxyMeterProvider, whose _ProxyUpDownCounter.add() is a no-op and does not replay measurements when the real MeterProvider is registered.
  2. When the MetricReader uses Delta aggregation temporality for UpDownCounter, the single .add(capacity) call in __init__ is only reported on the first collection cycle and is missing from all subsequent collections.
Expected behavior

otel.sdk.processor.span.queue.capacity and otel.sdk.processor.log.queue.capacity should be registered as asynchronous ObservableUpDownCounter callbacks (matching register_queue_size on lines 97-117).

Ngôn ngữ chính
Python
Star
2.7k
Fork
1.1k
Merge trung bình
4 ngày 13 phút
Pull request đã merge (30 ngày)
38

Chuẩn bị môi trường

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 open-telemetry/opentelemetry-python

Tất cả issue của open-telemetry/opentelemetry-python

Issue tương tự

Thêm issue về Python

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.