diff --git a/CHANGELOG.md b/CHANGELOG.md index d19f4ae..5516367 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +### Changed + +- Add instrumentation middleware to AnyCable RPC only when Yabeda is actually used (configured). See [issue №2](https://github.com/yabeda-rb/yabeda-anycable/issues/2) + ## [0.1.0] - 2021-07-22 - Initial release with `anycable_rpc_call_count` and `anycable_rpc_call_runtime` metrics in an AnyCable middleware. diff --git a/lib/yabeda/anycable.rb b/lib/yabeda/anycable.rb index 5b987e3..c48b5e8 100644 --- a/lib/yabeda/anycable.rb +++ b/lib/yabeda/anycable.rb @@ -16,9 +16,9 @@ class Error < StandardError; end ].freeze ::AnyCable.configure_server do - ::AnyCable.middleware.use(Middleware) - ::Yabeda.configure do + ::AnyCable.middleware.use(Middleware) + group :anycable counter :rpc_call_count, tags: %i[method command status], comment: "RPC calls count"