Permalink
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...
1 parent 963c772 commit ff059a192692fddb8971c1df51c58ce2d3b157fb @kevintom committed Feb 27, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 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

0 comments on commit ff059a1

Please sign in to comment.