Add experimental view_matching_mode (composable metric views) support

Đang mở
#9,013 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.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java

Hướng nghiên cứu

Start with ViewRegistry.findViews(...) in sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/view/ViewRegistry.java, then read the specification sections linked in the issue for stream grouping and merging rules. Inspect ViewBuilder and View for configured-property tracking, and SdkMeterProviderUtil for the experimental setter pattern; wire MeterProviderModelAccessor.getViewMatchingMode(model) from MeterProviderFactory.create(...). Done means composable matching, precedence, attribute filtering, and advisory fallback follow the specification while independent remains the default.

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

Mô tả

Description

The OpenTelemetry Metrics SDK specification defines an experimental (Development) view_matching_mode configuration parameter (independent vs. composable) on MeterProvider to compose multiple matching Views (for example, combining a broad policy View that filters attributes or disables instruments with an instrument-specific View that customizes aggregation) into merged metric streams rather than emitting duplicate/conflicting streams (specification/metrics/sdk.md#L519-L543, introduced in https://github.com/open-telemetry/opentelemetry-specification/pull/5173).

Currently in opentelemetry-java:

Proposal

Implement experimental support for view_matching_mode (independent default, composable opt-in) in opentelemetry-sdk-metrics and wire it in opentelemetry-sdk-extension-declarative-config:

  • Expose an experimental view_matching_mode setter on SdkMeterProviderBuilder via SdkMeterProviderUtil (following the pattern in https://github.com/open-telemetry/opentelemetry-java/blob/f02bddc4091f56d68b60b4c433afcec64c8d97b9/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/SdkMeterProviderUtil.java#L70-L84).
  • Implement composable View grouping and stream merging in opentelemetry-sdk-metrics (ViewBuilder / View and ViewRegistry) per the specification:
    • Form a stream group for each distinct configured View name containing matching Views with that name plus all matching Views with name == null (or a single default-named group if no matching View sets name).
    • Track explicitly configured ViewBuilder properties (distinguishing unset properties from ViewBuilder's default field values in ViewBuilder.java#L26-L30) to apply atomic last-wins precedence across non-attribute_keys stream settings, falling back per-aspect to the preceding valid View in the group (or default) with a warning on semantic errors rather than discarding the entire RegisteredView.
    • Compose specified attribute_keys predicates via logical AND, and override instrument advisory parameters only for aspects configured by matching Views in the group (falling back to instrument advisory parameters otherwise).
  • Wire MeterProviderModelAccessor.getViewMatchingMode(model) in MeterProviderFactory.create(...).
Additional Context
Ngôn ngữ chính
Java
Star
2.5k
Fork
1k
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
52

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-java

Tất cả issue của open-telemetry/opentelemetry-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.