Class: Trailer::Configuration
- Inherits:
-
Object
- Object
- Trailer::Configuration
- Defined in:
- lib/trailer/configuration.rb
Instance Attribute Summary collapse
-
#application_name ⇒ Object
Returns the value of attribute application_name.
-
#auto_tag_fields ⇒ Object
Returns the value of attribute auto_tag_fields.
-
#aws_access_key_id ⇒ Object
Returns the value of attribute aws_access_key_id.
-
#aws_region ⇒ Object
Returns the value of attribute aws_region.
-
#aws_secret_access_key ⇒ Object
Returns the value of attribute aws_secret_access_key.
-
#current_user_method ⇒ Object
Returns the value of attribute current_user_method.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#host_name ⇒ Object
Returns the value of attribute host_name.
-
#service_name ⇒ Object
Returns the value of attribute service_name.
-
#storage ⇒ Object
Returns the value of attribute storage.
-
#tag_fields ⇒ Object
Returns the value of attribute tag_fields.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Constructor.
Constructor Details
#initialize ⇒ Configuration
Constructor.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/trailer/configuration.rb', line 22 def initialize # The global application or company name. @application_name = ENV['TRAILER_APPLICATION_NAME'] # When tracing ActiveRecord instances, we can tag our trace with fields matching this regex. @auto_tag_fields = /(_id|_at)$/.freeze # AWS access key with CloudWatch write permission. @aws_access_key_id = ENV['AWS_ACCESS_KEY_ID'] # The AWS region to log to. @aws_region = ENV.fetch('AWS_REGION', 'us-east-1') # The AWS secret. @aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] # Allows tracing to be explicitly disabled. @enabled = true # The environment that the application is running (eg. 'production', 'test'). @environment = ENV['TRAILER_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] # Optional - the name of the individual host or server within the service. @host_name = ENV['TRAILER_HOST_NAME'] # The name of the service within the application. @service_name = ENV['TRAILER_SERVICE_NAME'] # The storage backend class to use. @storage = Trailer::Storage::CloudWatch # Optional - When tracing ActiveRecord instances, we can tag our trace with these fields explicitly. @tag_fields = %i[name] end |
Instance Attribute Details
#application_name ⇒ Object
Returns the value of attribute application_name.
7 8 9 |
# File 'lib/trailer/configuration.rb', line 7 def application_name @application_name end |
#auto_tag_fields ⇒ Object
Returns the value of attribute auto_tag_fields.
7 8 9 |
# File 'lib/trailer/configuration.rb', line 7 def auto_tag_fields @auto_tag_fields end |
#aws_access_key_id ⇒ Object
Returns the value of attribute aws_access_key_id.
7 8 9 |
# File 'lib/trailer/configuration.rb', line 7 def aws_access_key_id @aws_access_key_id end |
#aws_region ⇒ Object
Returns the value of attribute aws_region.
7 8 9 |
# File 'lib/trailer/configuration.rb', line 7 def aws_region @aws_region end |
#aws_secret_access_key ⇒ Object
Returns the value of attribute aws_secret_access_key.
7 8 9 |
# File 'lib/trailer/configuration.rb', line 7 def aws_secret_access_key @aws_secret_access_key end |
#current_user_method ⇒ Object
Returns the value of attribute current_user_method.
7 8 9 |
# File 'lib/trailer/configuration.rb', line 7 def current_user_method @current_user_method end |
#enabled ⇒ Object
Returns the value of attribute enabled.
7 8 9 |
# File 'lib/trailer/configuration.rb', line 7 def enabled @enabled end |
#environment ⇒ Object
Returns the value of attribute environment.
7 8 9 |
# File 'lib/trailer/configuration.rb', line 7 def environment @environment end |
#host_name ⇒ Object
Returns the value of attribute host_name.
7 8 9 |
# File 'lib/trailer/configuration.rb', line 7 def host_name @host_name end |
#service_name ⇒ Object
Returns the value of attribute service_name.
7 8 9 |
# File 'lib/trailer/configuration.rb', line 7 def service_name @service_name end |
#storage ⇒ Object
Returns the value of attribute storage.
7 8 9 |
# File 'lib/trailer/configuration.rb', line 7 def storage @storage end |
#tag_fields ⇒ Object
Returns the value of attribute tag_fields.
19 20 21 |
# File 'lib/trailer/configuration.rb', line 19 def tag_fields @tag_fields end |