HoneyryderChuck / httpx

(Mirror) An HTTP client library for ruby
https://gitlab.com/os85/httpx
Apache License 2.0
192 stars 10 forks source link

Sentry Integration #25

Closed Aubermean closed 11 months ago

Aubermean commented 11 months ago

Hi, thank you for the sentry integration.

To enable it, is it only required to add require 'httpx/adapters/sentry' to the top of config/initializers/sentry.rb? Or is setting config.breadcrumbs_logger = :httpx or using HTTPX.plugin(HTTPX::Plugins::Sentry) also necessary? Despite attempting different ways I have not managed to get the httpx breadcrumbs to show.

HoneyryderChuck commented 11 months ago

Hi @Aubermean ,

good call, I don't think this is properly documented in the wiki.

FWIW you have to set:

config.breadcrumbs_logger = [:http_logger]
config.enabled_patches << :httpx

in your sentry initialization code, after requiring the adapter. Loading the plugin is not necessary (it already is by default).