Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update Dataset instrumentation to prevent metric explosion

- https://newrelic.com/docs/general/what-is-metric-explosion
- logging every sql query is bad for new_relic, also there could be
  sensitive data leakage
- i could not find a better identifier that would always be there or
  that wouldn't possibly throw an exception, so I resorted to bucketing
them into "Dataset"
  • Loading branch information...
commit ff059a192692fddb8971c1df51c58ce2d3b157fb 1 parent 963c772
@kevintom authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/new_relic/agent/instrumentation/sequel.rb
View
8 lib/new_relic/agent/instrumentation/sequel.rb
@@ -49,10 +49,10 @@
# Sequel's Dataset instance methods
::Sequel::Dataset.class_eval do
- add_method_tracer :execute, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : self.sql}/find'
- add_method_tracer :execute_insert, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : self.sql}/create'
- add_method_tracer :execute_dui, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : self.sql}/update'
- add_method_tracer :execute_ddl, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : self.sql}/all'
+ add_method_tracer :execute, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : "Dataset"}/find'
+ add_method_tracer :execute_insert, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : "Dataset"}/create'
+ add_method_tracer :execute_dui, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : "Dataset"}/update'
+ add_method_tracer :execute_ddl, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : "Dataset"}/all'
end
Please sign in to comment.
Something went wrong with that request. Please try again.