newrelic / newrelic-ruby-agent

New Relic RPM Ruby Agent
https://docs.newrelic.com/docs/apm/agents/ruby-agent/getting-started/introduction-new-relic-ruby/
Apache License 2.0
1.2k stars 599 forks source link

Allow to ignore certain middleware, e.g. Rack::Cors #1814

Open fjaeger opened 1 year ago

fjaeger commented 1 year ago

Is your feature request related to a problem? Please describe.

We would like to ignore events coming from CORS requests that are handled in our Rails app via Rack::Cors. They are polluting our statistics in NewRelic and they also generate higher cost expenses as the number of transactions is massive!

Feature Description

We would like to be able to explicitly ignore this middleware or this type of request transactions.

Describe Alternatives

Alternatively, we would like to know how the same could be achieved with the existing ruby agent and a special type of configuration or initialization.

Priority

Please help us better understand this feature request by choosing a priority from the following options: Must Have

workato-integration[bot] commented 1 year ago

https://issues.newrelic.com/browse/NEWRELIC-6781

hannahramadan commented 1 year ago

Thanks for submitting this feature request. We saw a similar request a few years ago, so it’s helpful to know community interest level. We don’t have a perfect solution for disabling specific middleware. You can:

  1. Disable ALL Rack instrumentation
  2. Ignore specific transactions
  3. Inject Cors middleware after agent initialization

Please let us know if you have questions. We will keep this issue as a feature request and I've added it as a Jira ticket (if you have a New Relic customer Jira account, you'll be able to view it).

workato-integration[bot] commented 1 year ago

https://issues.newrelic.com/browse/NEWRELIC-8980