dodjdnh opened a new pull request, #3791: URL: https://github.com/apache/dubbo-go/pull/3791
## Problem Existing RPC RT and local quantile metrics cannot be used directly to aggregate P95/P99 across instances, nor do they provide the Histogram buckets needed for latency distribution heatmaps. ## Changes - Add the optional `ConfigurableHistogramRegistry` capability while keeping the existing `MetricRegistry` interface and default `Histogram` behavior unchanged. - Add cumulative latency histograms for providers and consumers, recording both successful and failed calls; reuse existing RT labels and record in seconds with sub-millisecond precision. - Support YAML and functional options, disabled by default and independent of sliding-window aggregation; default buckets are `[0.1, 0.3, 0.5, 1, 3, 5, 10]` seconds. - Fall back to the default bucket set with a warning if the configured buckets are invalid; if the Registry does not support the new capability, disable only the new histograms and preserve existing metrics. - Add configuration, bucket validation, concurrent recording, metric exposition, and Filter → HTTP tests, along with usage documentation. - Visualization: [sequence flow, component relationships, memory representation, and architecture](https://dodjdnh.github.io/genai-docs/docs/dubbo-go-rpc-histogram-pr/) ## Behavior - When enabled, export `_bucket`, `_sum`, and `_count` for `dubbo_{provider,consumer}_rt_milliseconds_histogram_seconds`. - Names follow the existing Java metrics; observations, bucket boundaries, and `_sum` are in seconds, while existing RT metrics remain in milliseconds. - Repeated scrapes and idle periods do not clear cumulative values; query with `rate` / `increase` and aggregate providers and consumers separately. ## Verification - PASS: relevant package tests, repeated integration package tests with shuffled order, targeted configuration tests, `go vet`, and root module build after rebasing. - PASS: `git diff --check` after the final import grouping correction; tests were not rerun for that formatting correction. - NOT VERIFIED: full CI, race, external samples integration, and CodeQL on the current HEAD; local race testing is blocked by the 32-bit GCC toolchain. ## Review focus 1. Whether the optional Registry capability preserves compatibility with third-party implementations; bucket boundaries are fixed on first registration of a metric family, and configuration slices are copied for isolation. 2. Reuse existing RPC completion events and labels without changing existing metrics; the existing event queue's risk of dropped events remains. 3. The default seven finite buckets produce ten time series per label set; aggregation across instances requires consistent bucket boundaries and units. <details> <summary>Related issue and verification commands</summary> Fixes #3788; target branch: `develop`. ```sh go test -mod=readonly ./metrics ./metrics/prometheus ./metrics/rpc ./metrics/rpc/integration ./global -count=1 go test -mod=readonly ./metrics/rpc/integration -shuffle=on -count=2 go vet -mod=readonly ./metrics ./metrics/prometheus ./metrics/rpc ./metrics/rpc/integration ./global go build -mod=readonly ./... ``` </details> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
