-
-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip Transaction Tracing for ActionController::RoutingError in a Rails Exception App #1830
Comments
Hi @silvermind, we added the whole rack env to sentry-ruby/sentry-rails/spec/sentry/rails/tracing_spec.rb Lines 209 to 217 in c237974
|
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
worked :) thanks a lot. would be nice to have the above sample with sampling_context[:env] added to the docs at: |
I'm encountering this same issue. An application I work on has transactions from noisy requests to paths like Some gem info:
I have tried When booting the Rails app and making a request for a path that doesn't exist ( Curiously, in investigating this, I noticed that in development (with |
Seeing this here as well, I have an open support ticket with Sentry to try and figure this out too. |
Support sent me to the idea to use a tag, and then filter on that tag, here is our workaround. # app/controllers/application_controller.rb
def route_not_found
Sentry.set_tags("http.response_code": 404)
render file: Rails.public_path.join("404.html"), status: :not_found, layout: false
end # config/initializers/sentry.rb
config.before_send_transaction = lambda do |event, _hint|
if event.tags.key?(:"http.response_code") && (event.tags[:"http.response_code"] == 404)
nil
else
event
end
end # config/routes.rb
match "*unmatched", to: "application#route_not_found", via: :all |
HI guys,
I'm trying to prevent ActionController::RoutingError Transaction Events from being sent to Sentry. As regular pentest scans pollute our performance reports in sentry. The default config IGNORE_DEFAULT already skips the 'ActionController::RoutingError' Error Event, but the Transaction Event is still sent with status internal_error.
Using the Sampling Function seems a possible way to prevent TX recordings, but seems not to work for 404 & other routing errors as it's loaded quite early in the stack: https://docs.sentry.io/platforms/ruby/configuration/sampling/#setting-a-sampling-function
https://docs.sentry.io/platforms/ruby/configuration/sampling/#forcing-a-sampling-decision
"Absolute decision passed to start_transaction" seems to be another way to control TX recording.
our Rails App has a configured Error Handler
config.exceptions_app = ->(env) { ExceptionsController.action(:show).call(env) }
Is it possible to skip the Transaction Events recording from the Exception Controller somehow, while using the default rails instrumentation intact?
Any ideas & hints would be very welcomed. Alternative would be so filter our pentesters with UserAgent or IPs, would you suggest this route instead?
The text was updated successfully, but these errors were encountered: