0.0
No release in over a year
Gruf both client and server interceptors, which report bugs to the Sentry.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Sentry-Gruf · Supported by Cado Labs · Gem Version · Coverage Status

Gruf both client and server interceptors, which report bugs to the Sentry.

Installation

gem "sentry-gruf"
bundle install
# --- or ---
gem install sentry-gruf
require "sentry-gruf"

Usage

After you install the gem, you need to set up the Sentry. You can read about Sentry configuration here.

Gem provides two interceptors for both client and server sides. All you need to add this interceptor at the beginning of interceptors stack.

For the server side, the installation will look something like this:

Gruf.configure do |config|
  config.interceptors.clear # Like config.use_default_interceptors = false
  config.interceptors.use(
    Sentry::Gruf::ServerInterceptor,
    sensitive_grpc_codes: [2, 5],
  )
  # Other interceptors go below.
end

where sensitive_grpc_codes is an optional array with codes of GRPC errors which will be reported to the Sentry.

And for the client side:

client = ::Gruf::Client.new(
  service: Some::Service,
  client_options: {
    interceptors: [Sentry::Gruf::ClientInterceptor.new, OtherInterceptors.new]
  }
)

Please note that the interceptor for the client itself does not send errors to Sentry. It simply tags some information about the last request made through the client.

Contributing

  • Fork it ( https://github.com/Cado-Labs/sentry-gruf )
  • Create your feature branch (git checkout -b feature/my-new-feature)
  • Commit your changes (git commit -am '[feature_context] Add some feature')
  • Push to the branch (git push origin feature/my-new-feature)
  • Create new Pull Request

License

Released under MIT License.

Supporting

Supported by Cado Labs

Authors

Created by Ivan Chernov.