Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First pass at adding elastic search functions to RPM instrumentation

  • Loading branch information...
commit a584013645ffb63c3e9fd24b2e3424f633004900 1 parent 922b735
Michael Breen authored jaggederest committed
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/rpm_contrib/instrumentation/elastic_search.rb
View
16 lib/rpm_contrib/instrumentation/elastic_search.rb
@@ -0,0 +1,16 @@
+# == Elastic Search Instrumentation
+#
+
+if defined?(::ElasticSearch) and not NewRelic::Control.instance['disable_elastic_search_instrumentation']
+
+ ::ElasticSearch::Client.class_eval do
+ add_method_tracer :index, 'ActiveRecord/ElasticSearch/index'
+ add_method_tracer :get, 'ActiveRecord/ElasticSearch/get'
+ add_method_tracer :delete, 'ActiveRecord/ElasticSearch/delete'
+ add_method_tracer :search, 'ActiveRecord/ElasticSearch/search'
+ add_method_tracer :scroll, 'ActiveRecord/ElasticSearch/scroll'
+ add_method_tracer :count, 'ActiveRecord/ElasticSearch/count'
+ add_method_tracer :bulk, 'ActiveRecord/ElasticSearch/bulk'
+ end
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.