AsperforMias opened a new issue, #3858: URL: https://github.com/apache/dubbo-go/issues/3858
### What happened? None of the metrics aggregation settings have any effect. Expected: `metrics.WithAggregationEnabled()` (`metrics.aggregation.enabled`) turns the sliding-window metrics on and off, and `WithAggregationBucketNum` / `WithAggregationTimeWindowSeconds` (`aggregation.bucket-num` / `aggregation.time-window-seconds`) change their window. Actual: - `aggregation.enabled` is written into the metrics URL (`instance_options_init.go`) but never read. The `*_aggregate` metrics, the RT aggregates and the quantiles (`*_p50` ... `*_p99`) are always registered (`metrics/rpc/metric_set.go`), even though the option docs say "Aggregation is disabled by default". - The window settings are ignored too. The RT aggregates are created with `BucketNum: metrics.DefaultBucketNum, TimeWindowSeconds: metrics.DefaultTimeWindowSeconds`, so the fallback to the URL values in `metrics/prometheus/registry.go` (only applied when they are 0) never runs. The aggregate counters and quantiles always use `DefaultBucketNum` / `DefaultTimeWindowSeconds` (`metrics/api.go`). Note when fixing: Dubbo Admin's dashboards query some of these metrics (for example `dubbo_consumer_rt_avg_milliseconds_aggregate`, the `*_p95` / `*_p99` quantiles and the min/max RT aggregates). Honoring `enabled` with its current default of `false` would empty those panels for applications that do not set it, so either the default or the documentation needs to change together with the fix. ### How can we reproduce it? (optional) 1. Start a provider with `metrics.WithEnabled()`, `metrics.WithPrometheus()` and `metrics.WithPrometheusExporterEnabled()`, without `WithAggregationEnabled()`, and call it. 2. `/metrics` still exports `dubbo_provider_requests_total_aggregate`, `dubbo_provider_rt_avg_milliseconds_aggregate` and `dubbo_provider_rt_milliseconds_p99`. 3. Setting `WithAggregationBucketNum` / `WithAggregationTimeWindowSeconds` does not change the window of these metrics. ### Environment - dubbo-go: develop (ba67101) - Go 1.26.1, macOS -- 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]
