Skip to content

Commit

Permalink
Added: event_sample_rate tag to SuckerPunch integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
delner committed Jan 3, 2019
1 parent 05a7831 commit f520e88
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/ddtrace/contrib/sucker_punch/instrumentation.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'sucker_punch'
require 'ddtrace/contrib/sampling'
require 'ddtrace/contrib/sucker_punch/ext'

module Datadog
Expand All @@ -18,6 +19,7 @@ def __run_perform(*args)

__with_instrumentation(Ext::SPAN_PERFORM) do |span|
span.resource = "PROCESS #{self}"
Contrib::Sampling.set_event_sample_rate(span, datadog_configuration[:event_sample_rate])
__run_perform_without_datadog(*args)
end
rescue => e
Expand All @@ -43,6 +45,10 @@ def perform_in(interval, *args)

private

def datadog_configuration
Datadog.configuration[:sucker_punch]
end

def __with_instrumentation(name)
pin = Datadog::Pin.get_from(::SuckerPunch)

Expand Down

0 comments on commit f520e88

Please sign in to comment.