diff --git a/.env.example b/.env.example index 5291be660..adf40c69b 100644 --- a/.env.example +++ b/.env.example @@ -48,7 +48,6 @@ RAILS_MAX_THREADS=5 # could user either `email@yourdomain.com` or `BrandName ` MAILER_SENDER_EMAIL="Chatwoot " - #SMTP domain key is set up for HELO checking SMTP_DOMAIN=chatwoot.com # the default value is set "mailhog" and is used by docker-compose for development environments, @@ -93,7 +92,6 @@ AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION= - # Log settings # Disable if you want to write logs to a file RAILS_LOG_TO_STDOUT=true @@ -130,7 +128,6 @@ ANDROID_BUNDLE_ID=com.chatwoot.app # https://developers.google.com/android/guides/client-auth (use keytool to print the fingerprint in the first section) ANDROID_SHA256_CERT_FINGERPRINT=AC:73:8E:DE:EB:56:EA:CC:10:87:02:A7:65:37:7B:38:D4:5D:D4:53:F8:3B:FB:D3:C6:28:64:1D:AA:08:1E:D8 - ### Smart App Banner # https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html # You can find your app-id in https://itunesconnect.apple.com @@ -147,8 +144,12 @@ ANDROID_SHA256_CERT_FINGERPRINT=AC:73:8E:DE:EB:56:EA:CC:10:87:02:A7:65:37:7B:38: ## Bot Customizations USE_INBOX_AVATAR_FOR_BOT=true - ### APM and Error Monitoring configurations +## Elastic APM +## https://www.elastic.co/guide/en/apm/agent/ruby/current/getting-started-rails.html +# ELASTIC_APM_SERVER_URL= +# ELASTIC_APM_SECRET_TOKEN= + ## Sentry # SENTRY_DSN= @@ -169,7 +170,6 @@ USE_INBOX_AVATAR_FOR_BOT=true ## https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#environment-variables # DD_TRACE_AGENT_URL= - ## IP look up configuration ## ref https://github.com/alexreisner/geocoder/blob/master/README_API_GUIDE.md ## works only on accounts with ip look up feature enabled @@ -181,7 +181,6 @@ USE_INBOX_AVATAR_FOR_BOT=true ## To prevent and throttle abusive requests # ENABLE_RACK_ATTACK=true - ## Running chatwoot as an API only server ## setting this value to true will disable the frontend dashboard endpoints # CW_API_ONLY_SERVER=false diff --git a/Gemfile b/Gemfile index 935db42e2..ba83ce964 100644 --- a/Gemfile +++ b/Gemfile @@ -91,6 +91,7 @@ gem 'google-cloud-dialogflow' ##-- apm and error monitoring ---# gem 'ddtrace' +gem 'elastic-apm' gem 'newrelic_rpm' gem 'scout_apm' gem 'sentry-rails', '~> 5.3' diff --git a/Gemfile.lock b/Gemfile.lock index 17e021bf2..8cf640103 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -182,6 +182,9 @@ GEM addressable (~> 2.8) ecma-re-validator (0.4.0) regexp_parser (~> 2.2) + elastic-apm (4.5.1) + concurrent-ruby (~> 1.0) + http (>= 3.0) email_reply_trimmer (0.1.13) erubi (1.10.0) et-orbi (1.2.7) @@ -226,6 +229,9 @@ GEM faraday (>= 1.0.0, < 3.0) googleauth (~> 1) ffi (1.15.5) + ffi-compiler (1.0.1) + ffi (>= 1.0.0) + rake flag_shih_tzu (0.3.23) foreman (0.87.2) fugit (1.5.3) @@ -318,9 +324,15 @@ GEM hkdf (0.3.0) html2text (0.2.1) nokogiri (~> 1.6) + http (5.1.0) + addressable (~> 2.8) + http-cookie (~> 1.0) + http-form_data (~> 2.2) + llhttp-ffi (~> 0.4.0) http-accept (1.7.0) http-cookie (1.0.5) domain_name (~> 0.5) + http-form_data (2.3.0) httparty (0.20.0) mime-types (~> 3.0) multi_xml (>= 0.5.2) @@ -383,6 +395,9 @@ GEM listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + llhttp-ffi (0.4.0) + ffi-compiler (~> 1.0) + rake (~> 13.0) loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -709,6 +724,7 @@ DEPENDENCIES devise_token_auth dotenv-rails down (~> 5.0) + elastic-apm email_reply_trimmer facebook-messenger factory_bot_rails @@ -789,4 +805,4 @@ RUBY VERSION ruby 3.0.4p208 BUNDLED WITH - 2.3.14 + 2.3.17 diff --git a/config/elastic_apm.yml b/config/elastic_apm.yml new file mode 100644 index 000000000..6f189d3af --- /dev/null +++ b/config/elastic_apm.yml @@ -0,0 +1,5 @@ +# Disabled by default to prevent the agent starting up when not required +# To enable, set your ELASTIC_APM_SERVER_URL and ELASTIC_APM_SECRET_TOKEN in your .env +# Additional configuration options can be set below, as per the docs: https://www.elastic.co/guide/en/apm/agent/ruby/current/configuration.html#configuration + +enabled: <%= ENV.fetch('ELASTIC_APM_SECRET_TOKEN', false).present? %>