How can I export Airbrake errors to Sentry? - sentry

I want to start using Sentry instead of Airbrake
Is there a way to export the data I've collected on Airbrake to Sentry?

Related

How to export data in CSV in kibana custom plugin using Reporting plugin

how can I export data which I rendered in a dataGrid inside of a custom plugin using data plugin
How did I render the data inside a plugin?
follow -> Git app.tsx
I want to export this data using the kibana plugin
Dashboard plugin has an example for exporting data
To export these datas, you can use the kibana's API.
To find the http request to execute, just use developper's tools in chrome to find a POST request with a URL like /s/echange/api/reporting/v1/generate/immediate/csv_searchsource.
When you find your request, try to execute it in your script : you will retrieve your csv's datas.

How do I use ActiveRecord Encryption in a Sinatra app?

I have a Sinatra app which runs ActiveRecord by using the activerecord and sinatra-activerecord gems. I would like to use ActiveRecord encryption, but the ActiveRecord Encryption guide assumes that I have a Rails app and specifies how to add the required encryption keys to the Rails credentials file. As this is not a Rails app, how do I specify an alternate keystore for ActiveRecord to use?
Specifically the error I am seeing is:
ActiveRecord::Encryption::Errors::Configuration:
key_derivation_salt is not configured. Please configure it via credential active_record_encryption.key_derivation_salt or by setting config.active_record.encryption.key_derivation_salt
So I think that it is running correctly, I just don't know how to configure it without the Rails credentials file.
Try this:
ActiveRecord::Encryption.configure(
primary_key: xxx,
deterministic_key: yyy,
key_derivation_salt: zzz
)
Looks undocumented, but found in the source code.

How do I retrieve the response.URL using Faraday gem?

I'm using Faraday to check for broken links, and I want to retrieve the response.URL of the links I'm querying, however, I am not able to find any documentation and examples to do so.
I was able to do this on the front-end using Javascript's Fetch API (Response.url: https://developer.mozilla.org/en-US/docs/Web/API/Response/url) but that is not an option now as I am required to do this on the backend using Faraday only.
Is this even possible with Faraday? If so, how do I implement it? Or kindly point me to the right documentation.
There are lots of class variables instantiated in the response object: response.env
You might be looking at:
response.env.url.to_s

Add a sidekiq monitor page into rails admin

How to add a sidekiq monitor page into rails admin?
I have tried to use custom action but I don't know how to use mount method in rails admin.
Does this have a good solution?
All you need is to have sidekiq_monitor gem in your Gemfile.
Like this:
sidekiq (3.5.1)
sidekiq-failures (0.4.5)
sidekiq-lock (0.3.0)
sidekiq_monitor (0.1.7)
rails_admin (0.7.0)
Offourse follow setup of sidekiq_monitor, and you will find link to 'Jobs' on left menu panel in rails admin.
And your links will looks like: /admin/sidekiq~monitor~job

Padrino send errors automatically via email

Can anyone suggest a way to have any application errors in a Padrino app send these errors via email?
I already have the Padrino Mailer configured properly and can send test emails, I just have no idea how to configure the app to send me a report via mail (as well as logging it, of course) whenever an error occurs.
Thanks.
I ended up using the padrino-contrib gem. With it, you can install the plugin you need (of course you can do it manually also):
padrino-gen plugin exception_notifier
Which will add it to your gem file and also edit your app/app.rb and boot.rb files to load this gem.
Then in app/app.rb you put something like:
register Padrino::Contrib::ExceptionNotifier
set :exceptions_from, "noreply#domain.com"
set :exceptions_to, "your_address.domain.com"
And that's it.
The nice thing about letting the plugin install it for you is that if you're more familiar with Rails than Padrino (as is my case) this will not only set things up for you, but also show you were the directives need to go.
Hope this helps someone else.
A good approach should be using exception handlers. Adding a begin..rescue block to your code, and if there is an exception, you send the email and continue to the desired behavior.
def some_action
begin
# some code that could go wrong
rescue SomeExceptionClass => some_variable
# here you send the email with the errors
# render stuff, redirect stuff, etc
end
end

Resources