diff --git a/.dockerdev/compose.yml b/.dockerdev/compose.yml
index 641a256d..25efc9f5 100644
--- a/.dockerdev/compose.yml
+++ b/.dockerdev/compose.yml
@@ -18,7 +18,7 @@ x-backend: &backend
stdin_open: true
tty: true
volumes:
- - ..:/app:cached
+ - ..:/app
- bundle:/usr/local/bundle
- rails_cache:/app/tmp/cache
- node_modules:/app/node_modules
@@ -30,9 +30,6 @@ x-backend: &backend
environment: &backend_environment
<<: *env
YARN_INTEGRITY_ENABLED: "false"
- ALGOLIASEARCH_APPLICATION_ID: PASTE
- ALGOLIASEARCH_API_KEY: YOUR
- ALGOLIASEARCH_SEARCH_ONLY_KEY: HERE
REDIS_URL: redis://redis:6379/
DATABASE_URL: postgres://postgres:postgres@postgres:5432
WEBPACKER_DEV_SERVER_HOST: webpacker
@@ -113,7 +110,20 @@ services:
<<: *env
WEBPACKER_DEV_SERVER_HOST: 0.0.0.0
YARN_CACHE_FOLDER: /app/node_modules/.yarn-cache
-
+ agent:
+ container_name: newrelic-infra
+ build:
+ context: .
+ dockerfile: newrelic-infra.dockerfile
+ cap_add:
+ - SYS_PTRACE
+ network_mode: host
+ pid: host
+ privileged: true
+ volumes:
+ - "/:/host:ro"
+ - "/var/run/docker.sock:/var/run/docker.sock"
+ restart: unless-stopped
volumes:
bundle:
node_modules:
diff --git a/.dockerdev/newrelic-infra.dockerfile b/.dockerdev/newrelic-infra.dockerfile
new file mode 100644
index 00000000..05bb7e74
--- /dev/null
+++ b/.dockerdev/newrelic-infra.dockerfile
@@ -0,0 +1,2 @@
+FROM newrelic/infrastructure:latest
+ADD newrelic-infra.yml /etc/newrelic-infra.yml
diff --git a/.gitignore b/.gitignore
index df2840a6..91d33045 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7 @@ latest.dump
# Ignore application configuration
/config/application.yml
+/.dockerdev/newrelic-infra.yml
/public/packs
/public/packs-test
/node_modules
@@ -52,4 +53,4 @@ package-lock.json
.idea/
#sitemap
-/public/sitemap.xml.gz
\ No newline at end of file
+/public/sitemap.xml.gz
diff --git a/.ruby-version b/.ruby-version
index bea438e9..351227fc 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-3.3.1
+3.2.4
diff --git a/Envfile b/Envfile
index 944a3fac..cb329b52 100644
--- a/Envfile
+++ b/Envfile
@@ -52,6 +52,7 @@ only_in_test = proc { ENV['RACK_ENV'] == "test" ? "test-test" : nil}
variable :ALGOLIASEARCH_API_KEY, :String, default: only_in_test
variable :ALGOLIASEARCH_APPLICATION_ID, :String, default: only_in_test
variable :ALGOLIASEARCH_SEARCH_ONLY_KEY, :String, default: only_in_test
+variable :NEW_RELIC_LICENSE_KEY, :String, default: "Optional"
# AWS for images storages
variable :AWS_ID, :String, default: "Optional"
diff --git a/Gemfile b/Gemfile
index fcad8024..7e2fbbf1 100644
--- a/Gemfile
+++ b/Gemfile
@@ -102,6 +102,11 @@ gem "uglifier", "~> 4.1"
gem "validate_url", "~> 1.0"
gem "webpacker", "~> 3.5"
gem "webpush", "~> 0.3"
+gem 'newrelic_rpm'
+gem 'newrelic-infinite_tracing'
+gem 'rack-mini-profiler'
+gem 'memory_profiler'
+gem 'stackprof'
group :development do
gem "better_errors", "~> 2.5"
@@ -123,7 +128,6 @@ group :development, :test do
gem "erb_lint", "~> 0.0", require: false
gem "faker", git: "https://github.com/stympy/faker.git", branch: "master"
gem "fix-db-schema-conflicts", github: "jakeonrails/fix-db-schema-conflicts", branch: "master"
- gem "memory_profiler", "~> 0.9"
gem "parallel_tests", "~> 2.27"
gem "pry-byebug", "~> 3.7"
gem "rspec-rails", "~> 3.8"
@@ -149,7 +153,6 @@ group :test do
gem "shoulda-matchers", "4.0.0.rc1", require: false
gem "simplecov", "~> 0.16", require: false
gem "sinatra", "~> 2.0"
- gem "stackprof", "~> 0.2", require: false, platforms: :ruby
gem "stripe-ruby-mock", "~> 2.5", require: "stripe_mock"
gem "test-prof", "~> 0.7"
gem "timecop", "~> 0.9"
diff --git a/Gemfile.lock b/Gemfile.lock
index a9b680a0..6de19f92 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -487,6 +487,9 @@ GEM
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.10)
+ google-protobuf (3.23.4)
+ googleapis-common-protos-types (1.12.0)
+ google-protobuf (~> 3.18)
googleauth (0.8.0)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
@@ -494,6 +497,9 @@ GEM
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.7)
+ grpc (1.58.0)
+ google-protobuf (~> 3.23)
+ googleapis-common-protos-types (~> 1.0)
guard (2.15.0)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
@@ -612,6 +618,10 @@ GEM
net-http-persistent (3.0.0)
connection_pool (~> 2.2)
netrc (0.11.0)
+ newrelic-infinite_tracing (9.9.0)
+ grpc (~> 1.34)
+ newrelic_rpm (= 9.9.0)
+ newrelic_rpm (9.9.0)
nio4r (2.3.1)
nokogiri (1.10.1)
mini_portile2 (~> 2.4.0)
@@ -677,6 +687,8 @@ GEM
rack (2.0.6)
rack-host-redirect (1.3.0)
rack
+ rack-mini-profiler (3.1.1)
+ rack (>= 1.2.0)
rack-protection (2.0.4)
rack
rack-proxy (0.6.5)
@@ -1007,8 +1019,10 @@ DEPENDENCIES
launchy (~> 2.4)
libhoney (~> 1.11)
liquid (~> 4.0)
- memory_profiler (~> 0.9)
+ memory_profiler
nakayoshi_fork
+ newrelic-infinite_tracing
+ newrelic_rpm
nokogiri (~> 1.10)
octokit (~> 4.13)
omniauth (~> 1.9)
@@ -1025,6 +1039,7 @@ DEPENDENCIES
pusher (~> 1.3)
pusher-push-notifications (~> 1.0)
rack-host-redirect (~> 1.3)
+ rack-mini-profiler
rack-timeout (~> 0.5)
rails (~> 5.1.6)
rails-assets-airbrake-js-client (~> 1.5)!
@@ -1057,7 +1072,7 @@ DEPENDENCIES
slack-notifier (~> 2.3)
sprockets (~> 3.7)
staccato (~> 0.5)
- stackprof (~> 0.2)
+ stackprof
storext (~> 2.2)
stripe (~> 4.8)
stripe-ruby-mock (~> 2.5)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 1531dc97..18186a3c 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -4,6 +4,11 @@ class ApplicationController < ActionController::Base
include Pundit
include Instrumentation
+ def profile_call
+ return true if params['profile'] == 'true'
+ false
+ end
+
def require_http_auth
authenticate_or_request_with_http_basic do |username, password|
username == ApplicationConfig["APP_NAME"] && password == ApplicationConfig["APP_PASSWORD"]
diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb
index df60029f..4dd22c8d 100644
--- a/app/controllers/stories_controller.rb
+++ b/app/controllers/stories_controller.rb
@@ -2,6 +2,12 @@ class StoriesController < ApplicationController
before_action :authenticate_user!, except: %i[index search show feed new]
before_action :set_cache_control_headers, only: %i[index search show]
+ before_action do
+ if profile_call
+ ::Rack::MiniProfiler.authorize_request
+ end
+ end
+
def index
add_param_context(:username, :tag)
return handle_user_or_organization_or_podcast_index if params[:username]
diff --git a/app/views/stories/_main_stories_feed.html.erb b/app/views/stories/_main_stories_feed.html.erb
index b6cd0a65..9fb395e7 100644
--- a/app/views/stories/_main_stories_feed.html.erb
+++ b/app/views/stories/_main_stories_feed.html.erb
@@ -55,7 +55,9 @@
<% if !user_signed_in? && i == 4 %>
<%= render "stories/sign_in_invitation" %>
<% end %>
- <%= render "articles/single_story", story: story %>
+ <% cache(story) do %>
+ <%= render "articles/single_story", story: story %>
+ <% end %>
<% end %>
<% end %>
<% if @stories.size > 1 %>
diff --git a/case-study.md b/case-study.md
new file mode 100644
index 00000000..3982802b
--- /dev/null
+++ b/case-study.md
@@ -0,0 +1,124 @@
+## Case Study
+
+## Подготовка
+
+- Запустил проект `dev.to` локально
+- Настроил `NewRelic` для 'development'
+- Настроил `local_production` для проекта и подкючил `NewRelic`
+- Настроил `rack-mini-profiler` для `local_production` и добавил ключ по которому можно включить профайлер
+
+## Оптимизация
+
+Ввиду сложностей запуска, я строго следовал рекомендация из описания.
+NewRelic оказался не очень информативен для понимания причины медленной работы ввиду трейсы из коробки не идентифицируют все трейсы.
+`rack-mini-profiler` показал, что `single_story` рендерится многократно и это точка для оптимизации.
+
+
+
+Утилита ab показала, что среднее время ответа составляет `675.065 [ms]`
+
+
+ab -n 100 -c 5 127.0.0.1:3000/
+
+```
+This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
+Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
+Licensed to The Apache Software Foundation, http://www.apache.org/
+
+Benchmarking 127.0.0.1 (be patient).....done
+
+
+Server Software:
+Server Hostname: 127.0.0.1
+Server Port: 3000
+
+Document Path: /
+Document Length: 143403 bytes
+
+Concurrency Level: 5
+Time taken for tests: 13.501 seconds
+Complete requests: 100
+Failed requests: 0
+Total transferred: 14382600 bytes
+HTML transferred: 14340300 bytes
+Requests per second: 7.41 [#/sec] (mean)
+Time per request: 675.065 [ms] (mean)
+Time per request: 135.013 [ms] (mean, across all concurrent requests)
+Transfer rate: 1040.31 [Kbytes/sec] received
+
+Connection Times (ms)
+ min mean[+/-sd] median max
+Connect: 0 0 0.5 0 4
+Processing: 108 631 1067.2 377 5300
+Waiting: 107 624 1066.9 373 5297
+Total: 109 631 1067.2 378 5300
+
+Percentage of the requests served within a certain time (ms)
+ 50% 378
+ 66% 405
+ 75% 440
+ 80% 459
+ 90% 520
+ 95% 5153
+ 98% 5285
+ 99% 5300
+ 100% 5300 (longest request)
+```
+
+
+
+После добавления кэширования в метод `single_story` среднее время ответа составило `133.472 [ms]`
+и `rack-mini-profiler` показал, что `single_story` рендерится один раз.
+
+
+
+ab -n 100 -c 5 127.0.0.1:3000/
+
+```
+This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
+Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
+Licensed to The Apache Software Foundation, http://www.apache.org/
+
+Benchmarking 127.0.0.1 (be patient).....done
+
+
+Server Software:
+Server Hostname: 127.0.0.1
+Server Port: 3000
+
+Document Path: /
+Document Length: 143451 bytes
+
+Concurrency Level: 5
+Time taken for tests: 2.669 seconds
+Complete requests: 100
+Failed requests: 0
+Total transferred: 14387400 bytes
+HTML transferred: 14345100 bytes
+Requests per second: 37.46 [#/sec] (mean)
+Time per request: 133.472 [ms] (mean)
+Time per request: 26.694 [ms] (mean, across all concurrent requests)
+Transfer rate: 5263.34 [Kbytes/sec] received
+
+Connection Times (ms)
+ min mean[+/-sd] median max
+Connect: 0 0 0.2 0 1
+Processing: 68 124 26.5 115 206
+Waiting: 66 122 26.1 112 205
+Total: 68 125 26.5 116 206
+
+Percentage of the requests served within a certain time (ms)
+ 50% 116
+ 66% 135
+ 75% 143
+ 80% 146
+ 90% 157
+ 95% 175
+ 98% 198
+ 99% 206
+ 100% 206 (longest request)
+```
+
+
+
+Таким образом, после оптимизации среднее время ответа уменьшилось в 5 раз.
diff --git a/config/application.rb b/config/application.rb
index 1b4c391f..b030a9a9 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -9,6 +9,7 @@
module PracticalDeveloper
class Application < Rails::Application
config.load_defaults 5.1
+ # config.web_console.whitelisted_ips = '192.168.0.0/16'
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
diff --git a/config/environments/local_production.rb b/config/environments/local_production.rb
new file mode 100644
index 00000000..a9d7c3b2
--- /dev/null
+++ b/config/environments/local_production.rb
@@ -0,0 +1,138 @@
+# rubocop:disable Metrics/BlockLength
+
+Rails.application.configure do
+ # Verifies that versions and hashed value of the package contents in the project's package.json
+ config.webpacker.check_yarn_integrity = false
+ config.middleware.use Rack::Deflater
+
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # Code is not reloaded between requests.
+ config.cache_classes = true
+
+ # Eager load code on boot. This eager loads most of Rails and
+ # your application in memory, allowing both threaded web servers
+ # and those relying on copy on write to perform better.
+ # Rake tasks automatically ignore this option for performance.
+ config.eager_load = true
+
+ # Full error reports are disabled and caching is turned on.
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
+ # Add `rack-cache` to your Gemfile before enabling this.
+ # For large-scale production use, consider using a caching reverse proxy like
+ # NGINX, varnish or squid.
+ # config.action_dispatch.rack_cache = true
+ config.read_encrypted_secrets = true
+
+ # Disable serving static files from the `/public` folder by default since
+ # Apache or NGINX already handles this.
+ config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
+ config.public_file_server.headers = {
+ "Cache-Control" => "public, s-maxage=2592000, max-age=86400"
+ }
+
+ # Compress JavaScripts and CSS.
+ config.assets.js_compressor = Uglifier.new(harmony: true)
+ # config.assets.css_compressor = :sass
+
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
+ config.assets.compile = true
+
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
+ # yet still be able to expire them through the digest params.
+ config.assets.digest = true
+
+ # `config.assets.precompile` and `config.assets.version`
+ # have moved to config/initializers/assets.rb
+
+ # Specifies the header that your server uses for sending files.
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
+
+ # Use the lowest log level to ensure availability of diagnostic information
+ # when problems arise.
+ config.log_level = :debug
+
+ # Prepend all log lines with the following tags.
+ config.log_tags = [:request_id]
+
+ # Use a different logger for distributed setups.
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
+
+ # Use a different cache store in production.
+ # config.cache_store = :mem_cache_store
+
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
+ config.action_controller.asset_host = ENV["FASTLY_CDN_URL"]
+ config.action_mailer.perform_caching = true
+
+ # Ignore bad email addresses and do not raise email delivery errors.
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation cannot be found).
+ config.i18n.fallbacks = [I18n.default_locale]
+
+ # Send deprecation notices to registered listeners.
+ config.active_support.deprecation = :notify
+
+ # Use default logging formatter so that PID and timestamp are not suppressed.
+ # config.log_formatter = ::Logger::Formatter.new
+ config.log_formatter = ::Logger::Formatter.new
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
+ logger = ActiveSupport::Logger.new(STDOUT)
+ logger.formatter = config.log_formatter
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
+ end
+
+ # Timber.io logger
+ send_logs_to_timber = ENV["SEND_LOGS_TO_TIMBER"] || "false" # <---- production should send timber logs by default
+ log_device = send_logs_to_timber == "true" ? Timber::LogDevices::HTTP.new(ENV["TIMBER"]) : STDOUT
+ logger = Timber::Logger.new(log_device)
+ logger.level = config.log_level
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
+
+ # Do not dump schema after migrations.
+ config.active_record.dump_schema_after_migration = false
+
+ if Rails.root.join("tmp/caching-dev.txt").exist?
+ config.action_controller.perform_caching = true
+
+ config.cache_store = :memory_store
+ config.public_file_server.headers = {
+ "Cache-Control" => "public, max-age=172800"
+ }
+ else
+ config.action_controller.perform_caching = false
+
+ config.cache_store = :null_store
+ end
+
+ config.app_domain = "localhost:3000"
+
+ config.action_mailer.default_url_options = { host: "localhost:3000" }
+ config.action_mailer.delivery_method = :smtp
+ config.action_mailer.perform_deliveries = true
+ config.action_mailer.default_url_options = { host: config.app_domain }
+ config.action_mailer.smtp_settings = {
+ address: "smtp.gmail.com",
+ port: "587",
+ enable_starttls_auto: true,
+ user_name: '<%= ENV["DEVELOPMENT_EMAIL_USERNAME"] %>',
+ password: '<%= ENV["DEVELOPMENT_EMAIL_PASSWORD"] %>',
+ authentication: :plain,
+ domain: "localhost:3000"
+ }
+
+ config.middleware.use Rack::HostRedirect,
+ "practicaldev.herokuapp.com" => "dev.to"
+end
+
+# rubocop:enable Metrics/BlockLength
diff --git a/config/initializers/airbrake.rb b/config/initializers/airbrake.rb
index 0a3fffc7..c530ddc8 100644
--- a/config/initializers/airbrake.rb
+++ b/config/initializers/airbrake.rb
@@ -41,7 +41,7 @@
# environments.
# NOTE: This option *does not* work if you don't set the 'environment' option.
# https://github.com/airbrake/airbrake-ruby#ignore_environments
- c.ignore_environments = %w[test development]
+ c.ignore_environments = %w[test development local_production]
# A list of parameters that should be filtered out of what is sent to
# Airbrake. By default, all "password" attributes will have their contents
diff --git a/config/initializers/mini_profiler.rb b/config/initializers/mini_profiler.rb
new file mode 100644
index 00000000..26437779
--- /dev/null
+++ b/config/initializers/mini_profiler.rb
@@ -0,0 +1 @@
+Rack::MiniProfiler.config.authorization_mode = :allow_authorized
diff --git a/config/newrelic.yml b/config/newrelic.yml
new file mode 100644
index 00000000..2c7046ea
--- /dev/null
+++ b/config/newrelic.yml
@@ -0,0 +1,879 @@
+#
+# This file configures the New Relic agent. New Relic monitors Ruby, Java,
+# .NET, PHP, Python, Node, and Go applications with deep visibility and low
+# overhead. For more information, visit www.newrelic.com.
+
+# Generated May 25, 2024, for version 9.9.0
+#
+# For full documentation of agent configuration options, please refer to
+# https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration
+
+common: &default_settings
+ # Your application name. Renaming here affects where data displays in New
+ # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications
+ app_name: rails-opt
+
+ # To disable the agent regardless of other settings, uncomment the following:
+ # agent_enabled: false
+
+ # Logging level for log/newrelic_agent.log; options are error, warn, info, or
+ # debug.
+ log_level: info
+
+ # All of the following configuration options are optional. Review them, and
+ # uncomment or edit them if they appear relevant to your application needs.
+
+ # An array of ActiveSupport custom event names to subscribe to and instrument. For
+ # example,
+ # - one.custom.event
+ # - another.event
+ # - a.third.event
+ # active_support_custom_events_names: []
+
+ # If false, all LLM instrumentation (OpenAI only for now) will be disabled and no
+ # metrics, events, or spans will be sent. AI Monitoring is automatically disabled
+ # if high_security mode is enabled.
+ # ai_monitoring.enabled: false
+
+ # If false, LLM instrumentation (OpenAI only for now) will not capture input and
+ # output content on specific LLM events.
+ # The excluded attributes include:
+ # * content from LlmChatCompletionMessage events
+ # * input from LlmEmbedding events
+ # ai_monitoring.record_content.enabled: true
+
+ # If true, enables capture of all HTTP request headers for all destinations.
+ # allow_all_headers: false
+
+ # Your New Relic userKey. Required when using the New Relic REST API v2 to record
+ # deployments using the newrelic deployments command.
+ # api_key: ""
+
+ # If true, enables log decoration and the collection of log events and metrics.
+ # application_logging.enabled: true
+
+ # A hash with key/value pairs to add as custom attributes to all log events
+ # forwarded to New Relic. If sending using an environment variable, the value must
+ # be formatted like: "key1=value1,key2=value2"
+ # application_logging.forwarding.custom_attributes: {}
+
+ # If true, the agent captures log records emitted by your application.
+ # application_logging.forwarding.enabled: true
+
+ # Sets the minimum level a log event must have to be forwarded to New Relic.
+ # This is based on the integer values of Ruby's Logger::Severity constants:
+ # https://github.com/ruby/ruby/blob/master/lib/logger/severity.rb
+ # The intention is to forward logs with the level given to the configuration, as
+ # well as any logs with a higher level of severity.
+ # For example, setting this value to "debug" will forward all log events to New
+ # Relic. Setting this value to "error" will only forward log events with the
+ # levels "error", "fatal", and "unknown".
+ # Valid values (ordered lowest to highest):
+ # * "debug"
+ # * "info"
+ # * "warn"
+ # * "error"
+ # * "fatal"
+ # * "unknown"
+ # application_logging.forwarding.log_level: debug
+
+ # Defines the maximum number of log records to buffer in memory at a time.
+ # application_logging.forwarding.max_samples_stored: 10000
+
+ # If true, the agent decorates logs with metadata to link to entities, hosts,
+ # traces, and spans.
+ # application_logging.local_decorating.enabled: false
+
+ # If true, the agent captures metrics related to logging for your application.
+ # application_logging.metrics.enabled: true
+
+ # If true, enables capture of attributes for all destinations.
+ # attributes.enabled: true
+
+ # Prefix of attributes to exclude from all destinations. Allows * as wildcard at
+ # end.
+ # attributes.exclude: []
+
+ # Prefix of attributes to include in all destinations. Allows * as wildcard at
+ # end.
+ # attributes.include: []
+
+ # If true, enables an audit log which logs communications with the New Relic
+ # collector.
+ # audit_log.enabled: false
+
+ # List of allowed endpoints to include in audit log.
+ # audit_log.endpoints: [".*"]
+
+ # Specifies a path to the audit log file (including the filename).
+ # audit_log.path: log/newrelic_audit.log
+
+ # Specify a list of constants that should prevent the agent from starting
+ # automatically. Separate individual constants with a comma ,. For example,
+ # "Rails::Console,UninstrumentedBackgroundJob".
+ # autostart.denylisted_constants: Rails::Command::ConsoleCommand,Rails::Command::CredentialsCommand,Rails::Command::Db::System::ChangeCommand,Rails::Command::DbConsoleCommand,Rails::Command::DestroyCommand,Rails::Command::DevCommand,Rails::Command::EncryptedCommand,Rails::Command::GenerateCommand,Rails::Command::InitializersCommand,Rails::Command::NotesCommand,Rails::Command::RoutesCommand,Rails::Command::SecretsCommand,Rails::Console,Rails::DBConsole
+
+ # Defines a comma-delimited list of executables that the agent should not
+ # instrument. For example, "rake,my_ruby_script.rb".
+ # autostart.denylisted_executables: irb,rspec
+
+ # Defines a comma-delimited list of Rake tasks that the agent should not
+ # instrument. For example, "assets:precompile,db:migrate".
+ # autostart.denylisted_rake_tasks: about,assets:clean,assets:clobber,assets:environment,assets:precompile,assets:precompile:all,db:create,db:drop,db:fixtures:load,db:migrate,db:migrate:status,db:rollback,db:schema:cache:clear,db:schema:cache:dump,db:schema:dump,db:schema:load,db:seed,db:setup,db:structure:dump,db:version,doc:app,log:clear,middleware,notes,notes:custom,rails:template,rails:update,routes,secret,spec,spec:features,spec:requests,spec:controllers,spec:helpers,spec:models,spec:views,spec:routing,spec:rcov,stats,test,test:all,test:all:db,test:recent,test:single,test:uncommitted,time:zones:all,tmp:clear,tmp:create,webpacker:compile
+
+ # Backports the faster ActiveRecord connection lookup introduced in Rails 6, which
+ # improves agent performance when instrumenting ActiveRecord. Note that this
+ # setting may not be compatible with other gems that patch ActiveRecord.
+ # backport_fast_active_record_connection_lookup: false
+
+ # If true, the agent captures attributes from browser monitoring.
+ # browser_monitoring.attributes.enabled: false
+
+ # Prefix of attributes to exclude from browser monitoring. Allows * as wildcard at
+ # end.
+ # browser_monitoring.attributes.exclude: []
+
+ # Prefix of attributes to include in browser monitoring. Allows * as wildcard at
+ # end.
+ # browser_monitoring.attributes.include: []
+
+ # If true, enables auto-injection of the JavaScript header for page load timing
+ # (sometimes referred to as real user monitoring or RUM).
+ # browser_monitoring.auto_instrument: true
+
+ # Manual override for the path to your local CA bundle. This CA bundle will be
+ # used to validate the SSL certificate presented by New Relic's data collection
+ # service.
+ # ca_bundle_path: nil
+
+ # Enable or disable the capture of memcache keys from transaction traces.
+ # capture_memcache_keys: false
+
+ # When true, the agent captures HTTP request parameters and attaches them to
+ # transaction traces, traced errors, and TransactionError events.
+ # When using the capture_params setting, the Ruby agent will not attempt to filter
+ # secret information. Recommendation: To filter secret information from request
+ # parameters, use the attributes.include setting instead. For more information,
+ # see the Ruby attribute examples.
+ # capture_params: false
+
+ # If true, the agent will clear Tracer::State in Agent.drop_buffered_data.
+ # clear_transaction_state_after_fork: false
+
+ # If true, the agent will report source code level metrics for traced methods.
+ # see:
+ # https://docs.newrelic.com/docs/apm/agents/ruby-agent/features/ruby-codestream-integration/
+ # code_level_metrics.enabled: true
+
+ # Path to newrelic.yml. If undefined, the agent checks the following directories
+ # (in order):
+ # * config/newrelic.yml
+ # * newrelic.yml
+ # * $HOME/.newrelic/newrelic.yml
+ # * $HOME/newrelic.yml
+ # config_path: newrelic.yml
+
+ # If false, custom attributes will not be sent on events.
+ # custom_attributes.enabled: true
+
+ # If true, the agent captures custom events.
+ # custom_insights_events.enabled: true
+
+ # Specify a maximum number of custom events to buffer in memory at a time.
+ # custom_insights_events.max_samples_stored: 3000
+
+ # If false, the agent will not add database_name parameter to transaction or slow
+ # sql traces.
+ # datastore_tracer.database_name_reporting.enabled: true
+
+ # If false, the agent will not report datastore instance metrics, nor add host or
+ # port_path_or_id parameters to transaction or slow SQL traces.
+ # datastore_tracer.instance_reporting.enabled: true
+
+ # If true, disables Action Cable instrumentation.
+ # disable_action_cable_instrumentation: false
+
+ # If true, disables Action Controller instrumentation.
+ # disable_action_controller: false
+
+ # If true, disables Action Mailbox instrumentation.
+ # disable_action_mailbox: false
+
+ # If true, disables Action Mailer instrumentation.
+ # disable_action_mailer: false
+
+ # If true, disables Active Record instrumentation.
+ # disable_active_record_instrumentation: false
+
+ # If true, disables instrumentation for Active Record 4+
+ # disable_active_record_notifications: false
+
+ # If true, disables Active Storage instrumentation.
+ # disable_active_storage: false
+
+ # If true, disables Active Support instrumentation.
+ # disable_active_support: false
+
+ # If true, disables Active Job instrumentation.
+ # disable_activejob: false
+
+ # If true, the agent won't sample the CPU usage of the host process.
+ # disable_cpu_sampler: false
+
+ # If true, the agent won't measure the depth of Delayed Job queues.
+ # disable_delayed_job_sampler: false
+
+ # If true, disables the use of GC::Profiler to measure time spent in garbage
+ # collection
+ # disable_gc_profiler: false
+
+ # If true, the agent won't sample the memory usage of the host process.
+ # disable_memory_sampler: false
+
+ # If true, the agent won't wrap third-party middlewares in instrumentation
+ # (regardless of whether they are installed via Rack::Builder or Rails).
+ # When middleware instrumentation is disabled, if an application is using
+ # middleware that could alter the response code, the HTTP status code reported on
+ # the transaction may not reflect the altered value.
+ # disable_middleware_instrumentation: false
+
+ # If true, disables agent middleware for Roda. This middleware is responsible for
+ # advanced feature support such as page load timing and error collection.
+ # disable_roda_auto_middleware: false
+
+ # If true, disables the collection of sampler metrics. Sampler metrics are metrics
+ # that are not event-based (such as CPU time or memory usage).
+ # disable_samplers: false
+
+ # If true, disables Sequel instrumentation.
+ # disable_sequel_instrumentation: false
+
+ # If true, disables Sidekiq instrumentation.
+ # disable_sidekiq: false
+
+ # If true, disables agent middleware for Sinatra. This middleware is responsible
+ # for advanced feature support such as cross application tracing, page load
+ # timing, and error collection.
+ # Cross application tracing is deprecated in favor of distributed tracing.
+ # Distributed tracing is on by default for Ruby agent versions 8.0.0 and above.
+ # Middlewares are not required to support distributed tracing.
+ # To continue using cross application tracing, update the following options in
+ # your newrelic.yml configuration file:
+ # ``yaml
+ # # newrelic.yml
+ # cross_application_tracer:
+ # enabled: true
+ # distributed_tracing:
+ # enabled: false
+ # ``
+ # disable_sinatra_auto_middleware: false
+
+ # If true, disables view instrumentation.
+ # disable_view_instrumentation: false
+
+ # If true, the agent won't sample performance measurements from the Ruby VM.
+ # disable_vm_sampler: false
+
+ # Distributed tracing lets you see the path that a request takes through your
+ # distributed system. Enabling distributed tracing changes the behavior of some
+ # New Relic features, so carefully consult the transition guide before you enable
+ # this feature.
+ # distributed_tracing.enabled: true
+
+ # If true, the agent captures Elasticsearch queries in transaction traces.
+ # elasticsearch.capture_queries: true
+
+ # If true, the agent obfuscates Elasticsearch queries in transaction traces.
+ # elasticsearch.obfuscate_queries: true
+
+ # If true, the agent captures attributes from error collection.
+ # error_collector.attributes.enabled: true
+
+ # Prefix of attributes to exclude from error collection. Allows * as wildcard at
+ # end.
+ # error_collector.attributes.exclude: []
+
+ # Prefix of attributes to include in error collection. Allows * as wildcard at
+ # end.
+ # error_collector.attributes.include: []
+
+ # If true, the agent collects TransactionError events.
+ # error_collector.capture_events: true
+
+ # If true, the agent captures traced errors and error count metrics.
+ # error_collector.enabled: true
+
+ # A list of error classes that the agent should treat as expected.
+ # This option can't be set via environment variable.
+ # error_collector.expected_classes: []
+
+ # A map of error classes to a list of messages. When an error of one of the
+ # classes specified here occurs, if its error message contains one of the strings
+ # corresponding to it here, that error will be treated as expected.
+ # This option can't be set via environment variable.
+ # error_collector.expected_messages: {}
+
+ # A comma separated list of status codes, possibly including ranges. Errors
+ # associated with these status codes, where applicable, will be treated as
+ # expected.
+ # error_collector.expected_status_codes: ""
+
+ # A list of error classes that the agent should ignore.
+ # This option can't be set via environment variable.
+ # error_collector.ignore_classes: ["ActionController::RoutingError", "Sinatra::NotFound"]
+
+ # A map of error classes to a list of messages. When an error of one of the
+ # classes specified here occurs, if its error message contains one of the strings
+ # corresponding to it here, that error will be ignored.
+ # This option can't be set via environment variable.
+ # error_collector.ignore_messages: {}
+
+ # A comma separated list of status codes, possibly including ranges. Errors
+ # associated with these status codes, where applicable, will be ignored.
+ # error_collector.ignore_status_codes: ""
+
+ # Defines the maximum number of frames in an error backtrace. Backtraces over this
+ # amount are truncated in the middle, preserving the beginning and the end of the
+ # stack trace.
+ # error_collector.max_backtrace_frames: 50
+
+ # Defines the maximum number of TransactionError events reported per harvest
+ # cycle.
+ # error_collector.max_event_samples_stored: 100
+
+ # Allows newrelic distributed tracing headers to be suppressed on outbound
+ # requests.
+ # exclude_newrelic_header: false
+
+ # Forces the exit handler that sends all cached data to collector before shutting
+ # down to be installed regardless of detecting scenarios where it generally should
+ # not be. Known use-case for this option is where Sinatra is running as an
+ # embedded service within another framework and the agent is detecting the Sinatra
+ # app and skipping the at_exit handler as a result. Sinatra classically runs the
+ # entire application in an at_exit block and would otherwise misbehave if the
+ # agent's at_exit handler was also installed in those circumstances. Note:
+ # send_data_on_exit should also be set to true in tandem with this setting.
+ # force_install_exit_handler: false
+
+ # Ordinarily the agent reports dyno names with a trailing dot and process ID (for
+ # example, worker.3). You can remove this trailing data by specifying the prefixes
+ # you want to report without trailing data (for example, worker).
+ # heroku.dyno_name_prefixes_to_shorten: ["scheduler", "run"]
+
+ # If true, the agent uses Heroku dyno names as the hostname.
+ # heroku.use_dyno_names: true
+
+ # If true, enables high security mode. Ensure you understand the implications of
+ # high security mode before enabling this setting.
+ # high_security: false
+
+ # If true (the default), data sent to the trace observer is batched instead of
+ # sending each span individually.
+ # infinite_tracing.batching: true
+
+ # Configure the compression level for data sent to the trace observer.
+ # May be one of: :none, :low, :medium, :high.
+ # Set the level to :none to disable compression.
+ # infinite_tracing.compression_level: high
+
+ # Configures the hostname for the trace observer Host. When configured, enables
+ # tail-based sampling by sending all recorded spans to a trace observer for
+ # further sampling decisions, irrespective of any usual agent sampling decision.
+ # infinite_tracing.trace_observer.host: ""
+
+ # Configures the TCP/IP port for the trace observer Host
+ # infinite_tracing.trace_observer.port: 443
+
+ # Controls auto-instrumentation of ActiveSupport::BroadcastLogger at start up. May
+ # be one of: auto, prepend, chain, disabled. Used in Rails versions >= 7.1.
+ # instrumentation.active_support_broadcast_logger: auto
+
+ # Controls auto-instrumentation of ActiveSupport::Logger at start up. May be one
+ # of: auto, prepend, chain, disabled. Used in Rails versions below 7.1.
+ # instrumentation.active_support_logger: auto
+
+ # Controls auto-instrumentation of Async::HTTP at start up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.async_http: auto
+
+ # Controls auto-instrumentation of bunny at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.bunny: auto
+
+ # Controls auto-instrumentation of the concurrent-ruby library at start-up. May be
+ # one of: auto, prepend, chain, disabled.
+ # instrumentation.concurrent_ruby: auto
+
+ # Controls auto-instrumentation of Curb at start-up. May be one of: auto, prepend,
+ # chain, disabled.
+ # instrumentation.curb: auto
+
+ # Controls auto-instrumentation of Delayed Job at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.delayed_job: auto
+
+ # Controls auto-instrumentation of the elasticsearch library at start-up. May be
+ # one of: auto, prepend, chain, disabled.
+ # instrumentation.elasticsearch: auto
+
+ # Controls auto-instrumentation of ethon at start up. May be one of
+ # [auto|prepend|chain|disabled]
+ # instrumentation.ethon: auto
+
+ # Controls auto-instrumentation of Excon at start-up. May be one of: enabled,
+ # disabled.
+ # instrumentation.excon: enabled
+
+ # Controls auto-instrumentation of the Fiber class at start-up. May be one of:
+ # auto, prepend, chain, disabled.
+ # instrumentation.fiber: auto
+
+ # Controls auto-instrumentation of Grape at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.grape: auto
+
+ # Specifies a list of hostname patterns separated by commas that will match gRPC
+ # hostnames that traffic is to be ignored by New Relic for. New Relic's gRPC
+ # client instrumentation will ignore traffic streamed to a host matching any of
+ # these patterns, and New Relic's gRPC server instrumentation will ignore traffic
+ # for a server running on a host whose hostname matches any of these patterns. By
+ # default, no traffic is ignored when gRPC instrumentation is itself enabled. For
+ # example, "private.com$,exception.*"
+ # instrumentation.grpc.host_denylist: []
+
+ # Controls auto-instrumentation of gRPC clients at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.grpc_client: auto
+
+ # Controls auto-instrumentation of gRPC servers at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.grpc_server: auto
+
+ # Controls auto-instrumentation of HTTPClient at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.httpclient: auto
+
+ # Controls auto-instrumentation of http.rb gem at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.httprb: auto
+
+ # Controls auto-instrumentation of httpx at start up. May be one of
+ # [auto|prepend|chain|disabled]
+ # instrumentation.httpx: auto
+
+ # Controls auto-instrumentation of Ruby standard library Logger at start-up. May
+ # be one of: auto, prepend, chain, disabled.
+ # instrumentation.logger: auto
+
+ # Controls auto-instrumentation of dalli gem for Memcache at start-up. May be one
+ # of: auto, prepend, chain, disabled.
+ # instrumentation.memcache: auto
+
+ # Controls auto-instrumentation of memcache-client gem for Memcache at start-up.
+ # May be one of: auto, prepend, chain, disabled.
+ # instrumentation.memcache_client: auto
+
+ # Controls auto-instrumentation of memcached gem for Memcache at start-up. May be
+ # one of: auto, prepend, chain, disabled.
+ # instrumentation.memcached: auto
+
+ # Controls auto-instrumentation of Mongo at start-up. May be one of: enabled,
+ # disabled.
+ # instrumentation.mongo: enabled
+
+ # Controls auto-instrumentation of Net::HTTP at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.net_http: auto
+
+ # Controls auto-instrumentation of Puma::Rack. When enabled, the agent hooks into
+ # the to_app method in Puma::Rack::Builder to find gems to instrument during
+ # application startup. May be one of: auto, prepend, chain, disabled.
+ # instrumentation.puma_rack: auto
+
+ # Controls auto-instrumentation of Puma::Rack::URLMap at start-up. May be one of:
+ # auto, prepend, chain, disabled.
+ # instrumentation.puma_rack_urlmap: auto
+
+ # Controls auto-instrumentation of Rack. When enabled, the agent hooks into the
+ # to_app method in Rack::Builder to find gems to instrument during application
+ # startup. May be one of: auto, prepend, chain, disabled.
+ # instrumentation.rack: auto
+
+ # Controls auto-instrumentation of Rack::URLMap at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.rack_urlmap: auto
+
+ # Controls auto-instrumentation of rake at start-up. May be one of: auto, prepend,
+ # chain, disabled.
+ # instrumentation.rake: auto
+
+ # Controls auto-instrumentation of Redis at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.redis: auto
+
+ # Controls auto-instrumentation of resque at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.resque: auto
+
+ # Controls auto-instrumentation of Roda at start-up. May be one of: auto, prepend,
+ # chain, disabled.
+ # instrumentation.roda: auto
+
+ # Controls auto-instrumentation of the ruby-openai gem at start-up. May be one of:
+ # auto, prepend, chain, disabled.
+ # instrumentation.ruby_openai: auto
+
+ # Controls auto-instrumentation of Sinatra at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.sinatra: auto
+
+ # Controls auto-instrumentation of Stripe at startup. May be one of: enabled,
+ # disabled.
+ # instrumentation.stripe: enabled
+
+ # Controls auto-instrumentation of the Thread class at start-up to allow the agent
+ # to correctly nest spans inside of an asynchronous transaction. This does not
+ # enable the agent to automatically trace all threads created (see
+ # instrumentation.thread.tracing). May be one of: auto, prepend, chain, disabled.
+ # instrumentation.thread: auto
+
+ # Controls auto-instrumentation of the Thread class at start-up to automatically
+ # add tracing to all Threads created in the application.
+ # instrumentation.thread.tracing: true
+
+ # Controls auto-instrumentation of the Tilt template rendering library at
+ # start-up. May be one of: auto, prepend, chain, disabled.
+ # instrumentation.tilt: auto
+
+ # Controls auto-instrumentation of Typhoeus at start-up. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.typhoeus: auto
+
+ # Controls auto-instrumentation of ViewComponent at startup. May be one of: auto,
+ # prepend, chain, disabled.
+ # instrumentation.view_component: auto
+
+ # A dictionary of label names and values that will be applied to the data sent
+ # from this agent. May also be expressed as a semicolon-delimited ; string of
+ # colon-separated : pairs. For example, Server:One;Data Center:Primary.
+ # labels: ""
+
+ # Defines a name for the log file.
+ # log_file_name: newrelic_agent.log
+
+ # Defines a path to the agent log file, excluding the filename.
+ # log_file_path: log/
+
+ # Specifies a marshaller for transmitting data to the New Relic collector.
+ # Currently json is the only valid value for this setting.
+ # marshaller: json
+
+ # If true, the agent will collect metadata about messages and attach them as
+ # segment parameters.
+ # message_tracer.segment_parameters.enabled: true
+
+ # If true, the agent captures Mongo queries in transaction traces.
+ # mongo.capture_queries: true
+
+ # If true, the agent obfuscates Mongo queries in transaction traces.
+ # mongo.obfuscate_queries: true
+
+ # When true, the agent transmits data about your app to the New Relic collector.
+ # monitor_mode: true
+
+ # If true, uses Module#prepend rather than alias_method for ActiveRecord
+ # instrumentation.
+ # prepend_active_record_instrumentation: false
+
+ # Specify a custom host name for display in the New Relic UI.
+ # process_host.display_name: default hostname
+
+ # Defines a host for communicating with the New Relic collector via a proxy
+ # server.
+ # proxy_host: nil
+
+ # Defines a password for communicating with the New Relic collector via a proxy
+ # server.
+ # proxy_pass: nil
+
+ # Defines a port for communicating with the New Relic collector via a proxy
+ # server.
+ # proxy_port: 8080
+
+ # Defines a user for communicating with the New Relic collector via a proxy
+ # server.
+ # proxy_user: nil
+
+ # Timeout for waiting on connect to complete before a rake task
+ # rake.connect_timeout: 10
+
+ # Specify an Array of Rake tasks to automatically instrument. This configuration
+ # option converts the Array to a RegEx list. If you'd like to allow all tasks by
+ # default, use rake.tasks: [.+]. No rake tasks will be instrumented unless they're
+ # added to this list. For more information, visit the New Relic Rake
+ # Instrumentation docs.
+ # rake.tasks: []
+
+ # Define transactions you want the agent to ignore, by specifying a list of
+ # patterns matching the URI you want to ignore. For more detail, see the docs on
+ # ignoring specific transactions.
+ # rules.ignore_url_regexes: []
+
+ # Applies Language Agent Security Policy settings.
+ # security_policies_token: ""
+
+ # If true, enables the exit handler that sends data to the New Relic collector
+ # before shutting down.
+ # send_data_on_exit: true
+
+ # If true, the agent will operate in a streamlined mode suitable for use with
+ # short-lived serverless functions. NOTE: Only AWS Lambda functions are supported
+ # currently and this option is not intended for use without New Relic's Ruby
+ # Lambda layer offering.
+ # serverless_mode.enabled: false
+
+ # An array of strings that will collectively serve as a denylist for filtering
+ # which Sidekiq job arguments get reported to New Relic. To capture any Sidekiq
+ # arguments, 'job.sidekiq.args.*' must be added to the separate
+ # :'attributes.include' configuration option. Each string in this array will be
+ # turned into a regular expression via Regexp.new to permit advanced matching. For
+ # job argument hashes, if either a key or value matches the pair will be excluded.
+ # All matching job argument array elements and job argument scalars will be
+ # excluded.
+ # sidekiq.args.exclude: []
+
+ # An array of strings that will collectively serve as an allowlist for filtering
+ # which Sidekiq job arguments get reported to New Relic. To capture any Sidekiq
+ # arguments, 'job.sidekiq.args.*' must be added to the separate
+ # :'attributes.include' configuration option. Each string in this array will be
+ # turned into a regular expression via Regexp.new to permit advanced matching. For
+ # job argument hashes, if either a key or value matches the pair will be included.
+ # All matching job argument array elements and job argument scalars will be
+ # included.
+ # sidekiq.args.include: []
+
+ # If true, the agent collects slow SQL queries.
+ # slow_sql.enabled: true
+
+ # If true, the agent collects explain plans in slow SQL queries. If this setting
+ # is omitted, the transaction_tracer.explain_enabled setting will be applied as
+ # the default setting for explain plans in slow SQL as well.
+ # slow_sql.explain_enabled: true
+
+ # Specify a threshold in seconds. The agent collects slow SQL queries and explain
+ # plans that exceed this threshold.
+ # slow_sql.explain_threshold: 0.5
+
+ # Defines an obfuscation level for slow SQL queries. Valid options are obfuscated,
+ # raw, or none.
+ # slow_sql.record_sql: obfuscated
+
+ # Generate a longer sql_id for slow SQL traces. sql_id is used for aggregation of
+ # similar queries.
+ # slow_sql.use_longer_sql_id: false
+
+ # If true, the agent captures attributes on span events.
+ # span_events.attributes.enabled: true
+
+ # Prefix of attributes to exclude from span events. Allows * as wildcard at end.
+ # span_events.attributes.exclude: []
+
+ # Prefix of attributes to include on span events. Allows * as wildcard at end.
+ # span_events.attributes.include: []
+
+ # If true, enables span event sampling.
+ # span_events.enabled: true
+
+ # Defines the maximum number of span events reported from a single harvest. Any
+ # Integer between 1 and 10000 is valid.
+ # span_events.max_samples_stored: 2000
+
+ # Sets the maximum number of span events to buffer when streaming to the trace
+ # observer.
+ # span_events.queue_size: 10000
+
+ # Specify a list of exceptions you do not want the agent to strip when
+ # strip_exception_messages is true. Separate exceptions with a comma. For example,
+ # "ImportantException,PreserveMessageException".
+ # strip_exception_messages.allowed_classes: ""
+
+ # If true, the agent strips messages from all exceptions except those in the
+ # allowlist. Enabled automatically in high security mode.
+ # strip_exception_messages.enabled: false
+
+ # An array of strings to specify which keys and/or values inside a Stripe event's
+ # user_data hash should
+ # not be reported to New Relic. Each string in this array will be turned into a
+ # regular expression via
+ # Regexp.new to permit advanced matching. For each hash pair, if either the key or
+ # value is matched the
+ # pair will not be reported. By default, no user_data is reported, so this option
+ # should only be used if
+ # the stripe.user_data.include option is being used.
+ # stripe.user_data.exclude: []
+
+ # An array of strings to specify which keys inside a Stripe event's user_data hash
+ # should be reported
+ # to New Relic. Each string in this array will be turned into a regular expression
+ # via Regexp.new to
+ # permit advanced matching. Setting the value to ["."] will report all user_data.
+ # stripe.user_data.include: []
+
+ # When set to true, forces a synchronous connection to the New Relic collector
+ # during application startup. For very short-lived processes, this helps ensure
+ # the New Relic agent has time to report.
+ # sync_startup: false
+
+ # If true, tracer state storage is thread-local, otherwise, fiber-local
+ # thread_local_tracer_state: false
+
+ # If true, enables use of the thread profiler.
+ # thread_profiler.enabled: false
+
+ # Defines the maximum number of seconds the agent should spend attempting to
+ # connect to the collector.
+ # timeout: 120
+
+ # If true, the agent captures attributes from transaction events.
+ # transaction_events.attributes.enabled: true
+
+ # Prefix of attributes to exclude from transaction events. Allows * as wildcard at
+ # end.
+ # transaction_events.attributes.exclude: []
+
+ # Prefix of attributes to include in transaction events. Allows * as wildcard at
+ # end.
+ # transaction_events.attributes.include: []
+
+ # If true, enables transaction event sampling.
+ # transaction_events.enabled: true
+
+ # Defines the maximum number of transaction events reported from a single harvest.
+ # transaction_events.max_samples_stored: 1200
+
+ # If true, the agent captures attributes on transaction segments.
+ # transaction_segments.attributes.enabled: true
+
+ # Prefix of attributes to exclude from transaction segments. Allows * as wildcard
+ # at end.
+ # transaction_segments.attributes.exclude: []
+
+ # Prefix of attributes to include on transaction segments. Allows * as wildcard at
+ # end.
+ # transaction_segments.attributes.include: []
+
+ # If true, the agent captures attributes from transaction traces.
+ # transaction_tracer.attributes.enabled: true
+
+ # Prefix of attributes to exclude from transaction traces. Allows * as wildcard at
+ # end.
+ # transaction_tracer.attributes.exclude: []
+
+ # Prefix of attributes to include in transaction traces. Allows * as wildcard at
+ # end.
+ # transaction_tracer.attributes.include: []
+
+ # If true, enables collection of transaction traces.
+ # transaction_tracer.enabled: true
+
+ # If true, enables the collection of explain plans in transaction traces. This
+ # setting will also apply to explain plans in slow SQL traces if
+ # slow_sql.explain_enabled is not set separately.
+ # transaction_tracer.explain_enabled: true
+
+ # Threshold (in seconds) above which the agent will collect explain plans.
+ # Relevant only when explain_enabled is true.
+ # transaction_tracer.explain_threshold: 0.5
+
+ # Maximum number of transaction trace nodes to record in a single transaction
+ # trace.
+ # transaction_tracer.limit_segments: 4000
+
+ # If true, the agent records Redis command arguments in transaction traces.
+ # transaction_tracer.record_redis_arguments: false
+
+ # Obfuscation level for SQL queries reported in transaction trace nodes.
+ # By default, this is set to obfuscated, which strips out the numeric and string
+ # literals.
+ # - If you do not want the agent to capture query information, set this to none.
+ # - If you want the agent to capture all query information in its original form,
+ # set this to raw.
+ # - When you enable high security mode, this is automatically set to obfuscated.
+ # transaction_tracer.record_sql: obfuscated
+
+ # Specify a threshold in seconds. The agent includes stack traces in transaction
+ # trace nodes when the stack trace duration exceeds this threshold.
+ # transaction_tracer.stack_trace_threshold: 0.5
+
+ # Specify a threshold in seconds. Transactions with a duration longer than this
+ # threshold are eligible for transaction traces. Specify a float value or the
+ # string apdex_f.
+ # transaction_tracer.transaction_threshold: 1.0
+
+ # If true, the agent automatically detects that it is running in an AWS
+ # environment.
+ # utilization.detect_aws: true
+
+ # If true, the agent automatically detects that it is running in an Azure
+ # environment.
+ # utilization.detect_azure: true
+
+ # If true, the agent automatically detects that it is running in Docker.
+ # utilization.detect_docker: true
+
+ # If true, the agent automatically detects that it is running in an Google Cloud
+ # Platform environment.
+ # utilization.detect_gcp: true
+
+ # If true, the agent automatically detects that it is running in Kubernetes.
+ # utilization.detect_kubernetes: true
+
+ # If true, the agent automatically detects that it is running in a Pivotal Cloud
+ # Foundry environment.
+ # utilization.detect_pcf: true
+
+# Environment-specific settings are in this section.
+# RAILS_ENV or RACK_ENV (as appropriate) is used to determine the environment.
+# If your application has other named environments, configure them here.
+local_production:
+ <<: *default_settings
+ app_name: rails-opt (Development)
+ distributed_tracing:
+ enabled: true
+
+ # To disable the agent regardless of other settings, uncomment the following:
+
+ # agent_enabled: false
+
+ # Logging level for log/newrelic_agent.log
+ log_level: info
+
+ application_logging:
+ # If `true`, all logging-related features for the agent can be enabled or disabled
+ # independently. If `false`, all logging-related features are disabled.
+ enabled: true
+ forwarding:
+ # If `true`, the agent captures log records emitted by this application.
+ enabled: true
+ # Defines the maximum number of log records to buffer in memory at a time.
+ max_samples_stored: 10000
+ metrics:
+ # If `true`, the agent captures metrics related to logging for this application.
+ enabled: true
+ local_decorating:
+ # If `true`, the agent decorates logs with metadata to link to entities, hosts, traces, and spans.
+ # This requires a log forwarder to send your log files to New Relic.
+ # This should not be used when forwarding is enabled.
+ enabled: false
+
+test:
+ <<: *default_settings
+ # It doesn't make sense to report to New Relic from automated test runs.
+ monitor_mode: false
+
+staging:
+ <<: *default_settings
+ app_name: rails-opt (Staging)
+
+production:
+ <<: *default_settings
diff --git a/config/secrets.yml b/config/secrets.yml
index 73f5e05c..8bf3b1cf 100644
--- a/config/secrets.yml
+++ b/config/secrets.yml
@@ -13,6 +13,9 @@
development:
secret_key_base: a60edc976c913b19fd9fc8118936fbe1df2b07f4eecc5ad32f975e33cd4ea36b150c1ce933b681b90874a46568041629003dcbfc07238f7dca91741bcd1ec870
+local_production:
+ secret_key_base: a60edc976c913b19fd9fc8118936fbe1df2b07f4eecc5ad32f975e33cd4ea36b150c1ce933b681b90874a46568041629003dcbfc07238f7dca91741bcd1ec870
+
test:
secret_key_base: 42dd7834039ebbea271af22635a6782ee15e519b14629c5276bfcdd4cff841e9926994784bb43a335a8f8c9739bb254ea3afe831839d4dc65654ec7516ec25f0
diff --git a/config/webpacker.yml b/config/webpacker.yml
index 2dfcd170..5bc34a2d 100644
--- a/config/webpacker.yml
+++ b/config/webpacker.yml
@@ -46,6 +46,21 @@ test:
# Compile test packs to a separate directory
public_output_path: packs-test
+local_production:
+ <<: *default
+
+ # Production depends on precompilation of packs prior to booting for performance.
+ compile: false
+
+ # Cache manifest.json for performance
+ cache_manifest: true
+
+ dev_server:
+ host: localhost
+ port: 3035
+ hmr: false
+ https: false
+
production:
<<: *default
diff --git a/dip.yml b/dip.yml
index 1b2d1bad..e222e363 100644
--- a/dip.yml
+++ b/dip.yml
@@ -3,7 +3,7 @@ version: '7.1'
# Define default environment variables to pass
# to Docker Compose
environment:
- RAILS_ENV: development
+ RAILS_ENV: local_production
compose:
files:
diff --git a/img.png b/img.png
new file mode 100644
index 00000000..bf14b493
Binary files /dev/null and b/img.png differ
diff --git a/img_1.png b/img_1.png
new file mode 100644
index 00000000..21b6f1a4
Binary files /dev/null and b/img_1.png differ