Specterr – An Error Reporting tool Which takes care of your data privacy
May 21, 2019
Recently i.e. 10th of August 2019 I gave a talk in a Regional Ruby Conference here in Pune. (Deccan Ruby Conf). In this blog, I will try to cover the details of the talk.
We created a gem named specterr stands for Spectacles on Error. Purpose of this gem to create an error tracking tool which stores the tracked data in the same eco-system as of your app. Most of the other gems will track the errors but the data is stored on tools cloud. This type of behavior is not allowed as per some regulations such as GDPR
Let’s get into the details of the gem specterr. This gem is divided into two parts.
- Error collection Mechanism
- In-app Mounted UI to show the errors.
Let me explain in detail about the Error collection Mechanism that can be used ruby/rails projects.
Rails Provide a very powerful tool named Active Support Instrumentation with the help of which we can choose to get notified when certain events occur inside the rails app. There are multiple such hooks to which other developers and hook into.
The particular hook that is subscribed to collect exceptions is process_action.action_controller Whenever the controller action execution is completed rails will inform via this hook to the listener/subscriber.
How to subscribe to Active support instrumentation hooks.
You need to have an initializer that subscribed to the particular rails hook.
In this example, I have created a file named exception_listener.rb inside the config/initializer directory with the following code.
subscriber You can find the slides here.