diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index d351aa7ac..eaa59f1f3 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -26,7 +26,7 @@ jobs: - tarantool-version: "2.8" metrics-version: "0.1.8" - tarantool-version: "2.8" - metrics-version: "0.9.0" + metrics-version: "0.10.0" - tarantool-version: "2.8" coveralls: true metrics-version: "0.12.0" diff --git a/README.md b/README.md index 11fd7c162..2f4307549 100644 --- a/README.md +++ b/README.md @@ -606,7 +606,7 @@ crud.disable_stats() crud.reset_stats() ``` -If [`metrics`](https://github.com/tarantool/metrics) `0.9.0` or greater +If [`metrics`](https://github.com/tarantool/metrics) `0.10.0` or greater found, metrics collectors will be used by default to store statistics instead of local collectors. You can manually choose driver if needed. ```lua diff --git a/crud/stats/metrics_registry.lua b/crud/stats/metrics_registry.lua index 16ba168df..bf66f89c7 100644 --- a/crud/stats/metrics_registry.lua +++ b/crud/stats/metrics_registry.lua @@ -45,23 +45,30 @@ local DEFAULT_AGE_PARAMS = { --- Check if application supports metrics rock for registry -- --- `metrics >= 0.9.0` is required to use summary with +-- `metrics >= 0.10.0` is required. +-- `metrics >= 0.9.0` is required to use summary quantiles with -- age buckets. `metrics >= 0.5.0, < 0.9.0` is unsupported -- due to quantile overflow bug -- (https://github.com/tarantool/metrics/issues/235). +-- `metrics == 0.9.0` has bug that do not permits +-- to create summary collector without quantiles +-- (https://github.com/tarantool/metrics/issues/262). +-- In fact, user may use `metrics >= 0.5.0`, `metrics != 0.9.0` +-- if he wants to use metrics without quantiles, and `metrics >= 0.9.0` +-- if he wants to use metrics with quantiles. But this is confusing, +-- so let's use a single restriction for both cases. -- -- @function is_supported -- --- @treturn boolean Returns true if `metrics >= 0.9.0` found, false otherwise. +-- @treturn boolean Returns true if `metrics >= 0.10.0` found, false otherwise. -- function registry.is_supported() if is_package == false then return false end - -- Only metrics >= 0.9.0 supported. - local is_summary, summary = pcall(require, 'metrics.collectors.summary') - if is_summary == false or summary.rotate_age_buckets == nil then + -- Only metrics >= 0.10.0 supported. + if metrics.unregister_callback == nil then return false end