Sentry-ruby: Transaction exclusion from path and host

Created on 12 Mar 2021  路  5Comments  路  Source: getsentry/sentry-ruby

Describe the idea

Currently we can exclude error type but not transactions. This means, even with a low value for traces_sample_rate, we'll have recorded requests that should not.

Why do you think it's beneficial to most of the users

Most of production application have healthcheck that requires app to unlock loadbalancers' traffic.

Healthcheck on server itself does not mean Rails server is up, that's why endpoint might be the Rails app directly.

To be able to exclude path/host could solve this issue.

Possible implementation

Here is my proposition: https://github.com/getsentry/sentry-ruby/pull/1332

enhancement

All 5 comments

@benebrice thanks for the proposal, this is something we're planning to do 馃檪

in fact, you can already sample transactions with the request path, like:

  config.traces_sampler = lambda do |context|
    transaction_context = context[:transaction_context]

    # rails.request or rack.request
    if transaction_context[:op].match?(/request/) && transaction_context[:name].match?(/health_check/)
      false
    else
      0.5
    end
  end

in the future, we'll also provide a way to sample transactions with more information like response status or host 馃槃

Thanks for your reply @st0012 !

I've contacted support before implementing it. They told me this feature does not exist.. Your way is easier than mine. I'll keep and use it obviously.
Should I close this issue?

@benebrice you can try it first to see if this really works for you 馃檪 if I see no further questions in the next few days I'll assume it works and I'll close it 馃槈

I've already tested it. Works like a charm. 馃憣馃徎

aha I'll close it now then 馃槃

Was this page helpful?
0 / 5 - 0 ratings