Basic tips for Sentry [Ruby]


Sentry is Error Tracking Service which provides cloud service and OSS. This post describes some tips for Sentry(Raven) with Ruby.

🎉 Capture Exception

It supports two methods of capturing exceptions:

Raven.capture do
# capture any exceptions which happen during execution of this block
1 / 0
end

begin
1 / 0
rescue ZeroDivisionError => exception
Raven.capture_exception(exception)
# You can put optional value
# Additional context for this event. Must be a mapping. Children can be any native JSON type.
# Raven.capture_exception(exception, { extra: {'key' => 'value'} })
end

😀 Reporting Message

Raven.capture_message("Something went very wrong", :attr => 'value')

🍮 More Detail

Please see https://docs.sentry.io/clients/ruby/usage/

🖥 Recommended VPS Service

VULTR provides high performance cloud compute environment for you. Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour). In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!