Class: Appsignal::Config::ConfigDSL
- Defined in:
- lib/appsignal/config.rb,
sig/appsignal.rbs
Overview
Configuration DSL for use in configuration blocks.
This class provides a Domain Specific Language for configuring AppSignal
within the Appsignal.configure block. It provides getter and setter
methods for all configuration options.
String Configuration Options collapse
-
#activejob_report_errors ⇒ String
@return — Error reporting mode for ActiveJob ("all", "discard" or "none").
-
#bind_address ⇒ String
@return — The host to the agent binds to for its HTTP server.
-
#ca_file_path ⇒ String
@return — Path to the CA certificate file.
-
#endpoint ⇒ String
@return — Push API endpoint URL.
-
#host_role ⇒ String
@return — Role of the host for grouping in metrics.
-
#hostname ⇒ String
@return — Override for the detected hostname.
-
#http_proxy ⇒ String
@return — HTTP proxy URL.
-
#log ⇒ String
@return — Log destination ("file" or "stdout").
-
#log_level ⇒ String
@return — AppSignal internal logger log level ("error", "warn", "info", "debug", "trace").
-
#log_path ⇒ String
@return — Path to the log directory.
-
#logging_endpoint ⇒ String
@return — Endpoint for log transmission.
-
#name ⇒ String
@return — The application name.
-
#nginx_port ⇒ String
@return — Port for Nginx metrics collection.
-
#push_api_key ⇒ String
@return — AppSignal Push API key.
-
#revision ⇒ String
@return — Application revision identifier.
-
#sidekiq_report_errors ⇒ String
@return — Error reporting mode for Sidekiq ("all", "discard" or "none").
-
#statsd_port ⇒ String
@return — Port for StatsD metrics.
-
#working_directory_path ⇒ String
@return — Override for the agent working directory.
Boolean Configuration Options collapse
-
#active ⇒ Boolean
@return — Activate AppSignal for the loaded environment.
-
#enable_active_support_event_log_reporter ⇒ Boolean
@return — Configure whether ActiveSupport::EventReporter integration is enabled.
-
#enable_allocation_tracking ⇒ Boolean
@return — Configure whether allocation tracking is enabled.
-
#enable_at_exit_reporter ⇒ Boolean
@return — Configure whether the at_exit reporter is enabled.
-
#enable_gvl_global_timer ⇒ Boolean
@return — Configure whether the GVL global timer instrumentationis enabled.
-
#enable_gvl_waiting_threads ⇒ Boolean
@return — Configure whether GVL waiting threads instrumentation is enabled.
-
#enable_host_metrics ⇒ Boolean
@return — Configure whether host metrics collection is enabled.
-
#enable_job_enqueue_instrumentation ⇒ Boolean
@return — Configure whether to record an event when a background job is enqueued.
-
#enable_minutely_probes ⇒ Boolean
@return — Configure whether minutely probes are enabled.
-
#enable_nginx_metrics ⇒ Boolean
@return — Configure whether the agent's NGINX metrics endpoint is enabled.
-
#enable_rails_error_reporter ⇒ Boolean
@return — Configure whether Rails error reporter integration is enabled.
-
#enable_rake_performance_instrumentation ⇒ Boolean
@return — Configure whether Rake performance instrumentation is enabled.
-
#enable_statsd ⇒ Boolean
@return — Configure whether the StatsD metrics endpoint on the agent is enabled.
-
#files_world_accessible ⇒ Boolean
@return — Configure whether files created by AppSignal should be world accessible.
-
#instrument_active_job ⇒ Boolean
@return — Configure whether to instrument Active Job.
-
#instrument_delayed_job ⇒ Boolean
@return — Configure whether to instrument Delayed Job.
-
#instrument_excon ⇒ Boolean
@return — Configure whether to instrument requests made with the Excon gem.
-
#instrument_faraday ⇒ Boolean
@return — Configure whether to instrument requests made with the Faraday gem.
-
#instrument_http_rb ⇒ Boolean
@return — Configure whether to instrument requests made with the http.rb gem.
-
#instrument_mongo ⇒ Boolean
@return — Configure whether to instrument MongoDB queries.
-
#instrument_net_http ⇒ Boolean
@return — Configure whether to instrument requests made with Net::HTTP.
-
#instrument_ownership ⇒ Boolean
@return — Configure whether to instrument the Ownership gem.
-
#instrument_que ⇒ Boolean
@return — Configure whether to instrument Que.
-
#instrument_redis ⇒ Boolean
@return — Configure whether to instrument Redis queries.
-
#instrument_resque ⇒ Boolean
@return — Configure whether to instrument Resque.
-
#instrument_sequel ⇒ Boolean
@return — Configure whether to instrument Sequel queries.
-
#instrument_shoryuken ⇒ Boolean
@return — Configure whether to instrument Shoryuken.
-
#instrument_sidekiq ⇒ Boolean
@return — Configure whether to instrument Sidekiq.
-
#ownership_set_namespace ⇒ Boolean
@return — Configure whether the Ownership gem instrumentation should set namespace.
-
#running_in_container ⇒ Boolean
@return — Configure whether the application is running in a container.
-
#send_environment_metadata ⇒ Boolean
@return — Configure whether to send environment metadata.
-
#send_params ⇒ Boolean
@return — Configure whether to send request parameters.
-
#send_session_data ⇒ Boolean
@return — Configure whether to send request session data.
Array Configuration Options collapse
-
#dns_servers ⇒ ::Array[String]
@return — Custom DNS servers to use.
-
#filter_metadata ⇒ ::Array[String]
@return — Metadata keys to filter from trace data.
-
#filter_parameters ⇒ ::Array[String]
@return — Keys of parameter to filter.
-
#filter_session_data ⇒ ::Array[String]
@return — Request session data keys to filter.
-
#ignore_actions ⇒ ::Array[String]
@return — Ignore traces by action names.
-
#ignore_errors ⇒ ::Array[String]
@return — List of errors to not report.
-
#ignore_logs ⇒ ::Array[String]
@return — Ignore log messages by substrings.
-
#ignore_namespaces ⇒ ::Array[String]
@return — Ignore traces by namespaces.
-
#request_headers ⇒ ::Array[String]
@return — HTTP request headers to include in error reports.
Float Configuration Options collapse
-
#cpu_count ⇒ Float
@return — CPU count override for metrics collection.
Hash Configuration Options collapse
-
#default_tags ⇒ Object
Custom getter for default_tags to ensure consistent format.
Instance Method Summary collapse
-
#activate_if_environment(*envs) ⇒ Boolean
Activates AppSignal if the current environment matches any of the given environments.
-
#app_path ⇒ String
Returns the application's root path.
-
#env ⇒ String
Returns the current environment name.
-
#env?(given_env) ⇒ TrueClass, FalseClass
Returns true if the given environment name matches the loaded environment name.
Instance Attribute Details
#active ⇒ Boolean
@return — Activate AppSignal for the loaded environment
|
|
# File 'lib/appsignal/config.rb', line 842
|
#activejob_report_errors ⇒ String
@return — Error reporting mode for ActiveJob ("all", "discard" or "none")
|
|
# File 'lib/appsignal/config.rb', line 791
|
#bind_address ⇒ String
@return — The host to the agent binds to for its HTTP server
|
|
# File 'lib/appsignal/config.rb', line 791
|
#ca_file_path ⇒ String
@return — Path to the CA certificate file
|
|
# File 'lib/appsignal/config.rb', line 791
|
#cpu_count ⇒ Float
@return — CPU count override for metrics collection
|
|
# File 'lib/appsignal/config.rb', line 954
|
#default_tags ⇒ Object
Custom getter for default_tags to ensure consistent format
|
|
# File 'lib/appsignal/config.rb', line 970
|
#dns_servers ⇒ ::Array[String]
@return — Custom DNS servers to use
|
|
# File 'lib/appsignal/config.rb', line 922
|
#enable_active_support_event_log_reporter ⇒ Boolean
@return — Configure whether ActiveSupport::EventReporter integration is enabled
|
|
# File 'lib/appsignal/config.rb', line 842
|
#enable_allocation_tracking ⇒ Boolean
@return — Configure whether allocation tracking is enabled
|
|
# File 'lib/appsignal/config.rb', line 842
|
#enable_at_exit_reporter ⇒ Boolean
@return — Configure whether the at_exit reporter is enabled
|
|
# File 'lib/appsignal/config.rb', line 842
|
#enable_gvl_global_timer ⇒ Boolean
@return — Configure whether the GVL global timer instrumentationis enabled
|
|
# File 'lib/appsignal/config.rb', line 842
|
#enable_gvl_waiting_threads ⇒ Boolean
@return — Configure whether GVL waiting threads instrumentation is enabled
|
|
# File 'lib/appsignal/config.rb', line 842
|
#enable_host_metrics ⇒ Boolean
@return — Configure whether host metrics collection is enabled
|
|
# File 'lib/appsignal/config.rb', line 842
|
#enable_job_enqueue_instrumentation ⇒ Boolean
@return — Configure whether to record an event when a background job is enqueued
|
|
# File 'lib/appsignal/config.rb', line 842
|
#enable_minutely_probes ⇒ Boolean
@return — Configure whether minutely probes are enabled
|
|
# File 'lib/appsignal/config.rb', line 842
|
#enable_nginx_metrics ⇒ Boolean
@return — Configure whether the agent's NGINX metrics endpoint is enabled
|
|
# File 'lib/appsignal/config.rb', line 842
|
#enable_rails_error_reporter ⇒ Boolean
@return — Configure whether Rails error reporter integration is enabled
|
|
# File 'lib/appsignal/config.rb', line 842
|
#enable_rake_performance_instrumentation ⇒ Boolean
@return — Configure whether Rake performance instrumentation is enabled
|
|
# File 'lib/appsignal/config.rb', line 842
|
#enable_statsd ⇒ Boolean
@return — Configure whether the StatsD metrics endpoint on the agent is enabled
|
|
# File 'lib/appsignal/config.rb', line 842
|
#endpoint ⇒ String
@return — Push API endpoint URL
|
|
# File 'lib/appsignal/config.rb', line 791
|
#files_world_accessible ⇒ Boolean
@return — Configure whether files created by AppSignal should be world accessible
|
|
# File 'lib/appsignal/config.rb', line 842
|
#filter_metadata ⇒ ::Array[String]
@return — Metadata keys to filter from trace data
|
|
# File 'lib/appsignal/config.rb', line 922
|
#filter_parameters ⇒ ::Array[String]
@return — Keys of parameter to filter
|
|
# File 'lib/appsignal/config.rb', line 922
|
#filter_session_data ⇒ ::Array[String]
@return — Request session data keys to filter
|
|
# File 'lib/appsignal/config.rb', line 922
|
#host_role ⇒ String
@return — Role of the host for grouping in metrics
|
|
# File 'lib/appsignal/config.rb', line 791
|
#hostname ⇒ String
@return — Override for the detected hostname
|
|
# File 'lib/appsignal/config.rb', line 791
|
#http_proxy ⇒ String
@return — HTTP proxy URL
|
|
# File 'lib/appsignal/config.rb', line 791
|
#ignore_actions ⇒ ::Array[String]
@return — Ignore traces by action names
|
|
# File 'lib/appsignal/config.rb', line 922
|
#ignore_errors ⇒ ::Array[String]
@return — List of errors to not report
|
|
# File 'lib/appsignal/config.rb', line 922
|
#ignore_logs ⇒ ::Array[String]
@return — Ignore log messages by substrings
|
|
# File 'lib/appsignal/config.rb', line 922
|
#ignore_namespaces ⇒ ::Array[String]
@return — Ignore traces by namespaces
|
|
# File 'lib/appsignal/config.rb', line 922
|
#instrument_active_job ⇒ Boolean
@return — Configure whether to instrument Active Job
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_delayed_job ⇒ Boolean
@return — Configure whether to instrument Delayed Job
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_excon ⇒ Boolean
@return — Configure whether to instrument requests made with the Excon gem
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_faraday ⇒ Boolean
@return — Configure whether to instrument requests made with the Faraday gem
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_http_rb ⇒ Boolean
@return — Configure whether to instrument requests made with the http.rb gem
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_mongo ⇒ Boolean
@return — Configure whether to instrument MongoDB queries
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_net_http ⇒ Boolean
@return — Configure whether to instrument requests made with Net::HTTP
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_ownership ⇒ Boolean
@return — Configure whether to instrument the Ownership gem
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_que ⇒ Boolean
@return — Configure whether to instrument Que
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_redis ⇒ Boolean
@return — Configure whether to instrument Redis queries
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_resque ⇒ Boolean
@return — Configure whether to instrument Resque
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_sequel ⇒ Boolean
@return — Configure whether to instrument Sequel queries
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_shoryuken ⇒ Boolean
@return — Configure whether to instrument Shoryuken
|
|
# File 'lib/appsignal/config.rb', line 842
|
#instrument_sidekiq ⇒ Boolean
@return — Configure whether to instrument Sidekiq
|
|
# File 'lib/appsignal/config.rb', line 842
|
#log ⇒ String
@return — Log destination ("file" or "stdout")
|
|
# File 'lib/appsignal/config.rb', line 791
|
#log_level ⇒ String
@return — AppSignal internal logger log level ("error", "warn", "info", "debug", "trace")
|
|
# File 'lib/appsignal/config.rb', line 791
|
#log_path ⇒ String
@return — Path to the log directory
|
|
# File 'lib/appsignal/config.rb', line 791
|
#logging_endpoint ⇒ String
@return — Endpoint for log transmission
|
|
# File 'lib/appsignal/config.rb', line 791
|
#name ⇒ String
@return — The application name
|
|
# File 'lib/appsignal/config.rb', line 791
|
#nginx_port ⇒ String
@return — Port for Nginx metrics collection
|
|
# File 'lib/appsignal/config.rb', line 791
|
#ownership_set_namespace ⇒ Boolean
@return — Configure whether the Ownership gem instrumentation should set namespace
|
|
# File 'lib/appsignal/config.rb', line 842
|
#push_api_key ⇒ String
@return — AppSignal Push API key
|
|
# File 'lib/appsignal/config.rb', line 791
|
#request_headers ⇒ ::Array[String]
@return — HTTP request headers to include in error reports
|
|
# File 'lib/appsignal/config.rb', line 922
|
#revision ⇒ String
@return — Application revision identifier
|
|
# File 'lib/appsignal/config.rb', line 791
|
#running_in_container ⇒ Boolean
@return — Configure whether the application is running in a container
|
|
# File 'lib/appsignal/config.rb', line 842
|
#send_environment_metadata ⇒ Boolean
@return — Configure whether to send environment metadata
|
|
# File 'lib/appsignal/config.rb', line 842
|
#send_params ⇒ Boolean
@return — Configure whether to send request parameters
|
|
# File 'lib/appsignal/config.rb', line 842
|
#send_session_data ⇒ Boolean
@return — Configure whether to send request session data
|
|
# File 'lib/appsignal/config.rb', line 842
|
#sidekiq_report_errors ⇒ String
@return — Error reporting mode for Sidekiq ("all", "discard" or "none")
|
|
# File 'lib/appsignal/config.rb', line 791
|
#statsd_port ⇒ String
@return — Port for StatsD metrics
|
|
# File 'lib/appsignal/config.rb', line 791
|
#working_directory_path ⇒ String
@return — Override for the agent working directory
|
|
# File 'lib/appsignal/config.rb', line 791
|
Instance Method Details
#activate_if_environment(*envs) ⇒ Boolean
Activates AppSignal if the current environment matches any of the given environments.
@param envs — List of environment names to activate for
@return — true if AppSignal was activated, false otherwise
Activate for production and staging
config.activate_if_environment(:production, :staging)
785 786 787 |
# File 'lib/appsignal/config.rb', line 785 def activate_if_environment(*envs) self.active = envs.map(&:to_s).include?(env) end |
#app_path ⇒ String
Returns the application's root path.
@return — The root path of the application
758 759 760 |
# File 'lib/appsignal/config.rb', line 758 def app_path @config.root_path end |
#env ⇒ String
Returns the current environment name.
@return — The environment name (e.g., "production", "development")
765 766 767 |
# File 'lib/appsignal/config.rb', line 765 def env @config.env end |
#env?(given_env) ⇒ TrueClass, FalseClass
Returns true if the given environment name matches the loaded environment name.
@param given_env
774 775 776 |
# File 'lib/appsignal/config.rb', line 774 def env?(given_env) env == given_env.to_s end |