This reverts commit 716bb099fa.
This commit is contained in:
parent
716bb099fa
commit
3a49d3f0d1
1 changed files with 0 additions and 32 deletions
|
|
@ -1,31 +1,3 @@
|
|||
class CustomSampler
|
||||
extend Honeycomb::DeterministicSampler
|
||||
|
||||
def self.sample(fields)
|
||||
noisy = Set[
|
||||
'GET rails-settings-cached/v1',
|
||||
'TIME',
|
||||
'BEGIN',
|
||||
'COMMIT',
|
||||
]
|
||||
if noisy === fields["redis.command"] or noisy === fields["sql.active_record.sql"]
|
||||
rate = 100
|
||||
[should_sample(rate, fields["trace.trace_id"]), rate]
|
||||
elsif fields["redis.command"].start_with?("BRPOP")
|
||||
rate = 1000
|
||||
[should_sample(rate, fields["trace.trace_id"]), rate]
|
||||
elsif fields["redis.command"].start_with?("INCRBY")
|
||||
rate = 100
|
||||
[should_sample(rate, fields["trace.trace_id"]), rate]
|
||||
elsif fields["redis.command"].start_with?("TTL")
|
||||
rate = 100
|
||||
[should_sample(rate, fields["trace.trace_id"]), rate]
|
||||
else
|
||||
[true, 1]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if Rails.env.test? || ApplicationConfig["HONEYCOMB_API_KEY"].blank?
|
||||
Honeycomb.configure do |config|
|
||||
config.client = Libhoney::TestClient.new
|
||||
|
|
@ -60,10 +32,6 @@ else
|
|||
fields.delete("sql.active_record.datadog_span")
|
||||
end
|
||||
end
|
||||
# Sample away highly redundant events
|
||||
config.sample_hook do |fields|
|
||||
CustomSampler.sample(fields)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue