ElasticAPM::Agent.stop if ENV["ENABLE_APM"].to_s.downcase != "true" if defined?(ElasticAPM) && !ElasticAPM::Agent.instance.nil? if !defined?(Rails::Console) ElasticAPM.agent.config.disable_send = false else ElasticAPM.agent.config.disable_send = true end case Rails.env.to_s when 'production' ElasticAPM.agent.config.server_url = "http://apm-server.logging:8200" ElasticAPM.agent.config.transaction_sample_rate = 0.20 ElasticAPM.agent.config.capture_body = false when 'staging' ElasticAPM.agent.config.server_url = "http://apm-server.logging:8200" ElasticAPM.agent.config.transaction_sample_rate = 1.0 when 'development' ElasticAPM.agent.config.server_url = "http://logging.0.ecc.auw2.zuora:8200" ElasticAPM.agent.config.transaction_sample_rate = 1.0 end ElasticAPM.agent.config.pool_size = 1 ElasticAPM.agent.config.transaction_max_spans = 500 ElasticAPM.agent.config.ignore_url_patterns = ['^\/admin\/resque.*', '^\/admin\/redis.*', '^\/admin\/peek.*', '^\/peek.*'] ElasticAPM.agent.config.verify_server_cert = false ElasticAPM.agent.config.log_level = Logger::INFO ElasticAPM.agent.config.service_name = ::ZuoraConnect::Telegraf.app_name end