From 73c0e509360e1f96bd01c7d3c4d1519371d3e079 Mon Sep 17 00:00:00 2001 From: rubic0n Date: Sat, 13 Feb 2021 23:02:44 -0600 Subject: [PATCH] Prevent constant ElasticAPM warnings in development by disabling it No changes are needed in prod, since the `enabled` setting defaults to "true", and prod obviously isn't setting this ENV. --- .env.vagrant | 1 + config/elastic_apm.yml | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.env.vagrant b/.env.vagrant index 8c5a21f4..36fe6493 100644 --- a/.env.vagrant +++ b/.env.vagrant @@ -4,3 +4,4 @@ DB_HOST=/var/run/postgresql/ DB_MASTER_URL=postgres:///gabsocial_development DB_SLAVE1_URL=postgres:///gabsocial_development DB_SLAVE2_URL=postgres:///gabsocial_development +ELASTIC_APM_ENABLED=false diff --git a/config/elastic_apm.yml b/config/elastic_apm.yml index 1a35ed53..d359457b 100644 --- a/config/elastic_apm.yml +++ b/config/elastic_apm.yml @@ -2,10 +2,12 @@ # Set service name - allowed characters: a-z, A-Z, 0-9, -, _ and space # Defaults to the name of your Rails app -service_name: <%= ENV['ELASTIC_APM_SERVICE_NAME'] || 'gabsocial' %> +service_name: <%= ENV['ELASTIC_APM_SERVICE_NAME'] || 'gabsocial' %> # Use if APM Server requires a token -secret_token: <%= ENV['ELASTIC_APM_SECRET_TOKEN'] || '' %> +secret_token: <%= ENV['ELASTIC_APM_SECRET_TOKEN'] || '' %> # Set custom APM Server URL (default: http://localhost:8200) -server_url: <%= ENV['ELASTIC_APM_URL'] || 'http://localhost:8200'%> +server_url: <%= ENV['ELASTIC_APM_URL'] || 'http://localhost:8200'%> + +enabled: <%= ENV['ELASTIC_APM_ENABLED'] || 'true' %>