From 6726c62e9460ff7ab70d741f84a7052e55b19b12 Mon Sep 17 00:00:00 2001 From: Molly Struve Date: Wed, 15 Jan 2020 11:11:41 -0500 Subject: [PATCH] Scrub unused data sent to Honeycomb to save space (#5512) [deploy] --- config/initializers/honeycomb.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/initializers/honeycomb.rb b/config/initializers/honeycomb.rb index 16f55a524..98efaf75a 100644 --- a/config/initializers/honeycomb.rb +++ b/config/initializers/honeycomb.rb @@ -21,6 +21,16 @@ else send_data.action_controller deliver.action_mailer ].freeze + + # Scrub unused data to save space in Honeycomb + config.presend_hook do |fields| + if fields.key?("redis.command") + fields["redis.command"].slice!(0, 300) + elsif fields.key?("sql.active_record.binds") + fields.delete("sql.active_record.binds") + fields.delete("sql.active_record.datadog_span") + end + end end # here we create an additional Honeycomb client that can be used to send custom events