[deploy] dont configure Honeycomb if its disabled (#6618)

This commit is contained in:
Molly Struve 2020-05-11 11:59:18 -05:00 committed by GitHub
parent 1c195b02de
commit bbff0f757e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 19 deletions

View file

@ -8,25 +8,29 @@ else
# Honeycomb automatic Rails integration
Honeycomb.configure do |config|
config.write_key = honeycomb_api_key
config.dataset = "rails"
config.notification_events = %w[
sql.active_record
render_template.action_view
render_partial.action_view
render_collection.action_view
process_action.action_controller
send_file.action_controller
send_data.action_controller
deliver.action_mailer
].freeze
if ENV["HONEYCOMB_DISABLE_AUTOCONFIGURE"]
config.dataset = "background-work"
else
config.dataset = "rails"
config.notification_events = %w[
sql.active_record
render_template.action_view
render_partial.action_view
render_collection.action_view
process_action.action_controller
send_file.action_controller
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")
# 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
end

View file

@ -6,5 +6,6 @@ if [ "$DYNOTYPE" == "scheduler" ] || [ "$DYNOTYPE" == "run" ]; then
# Disable Automatic Beeline integrations to prevent unnecessary
# data from being tracked in Honeycomb
# more info here: https://docs.honeycomb.io/getting-data-in/ruby/beeline/#using-env-variables-to-control-framework-integrations
HONEYCOMB_DISABLE_AUTOCONFIGURE="true"
export HONEYCOMB_DISABLE_AUTOCONFIGURE="true"
export HONEYCOMB_INTEGRATIONS=rails,rake,active_support
fi