Class: Trailer::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/trailer/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_nameObject

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_fieldsObject

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_idObject

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_regionObject

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_keyObject

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_methodObject

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

#enabledObject

Returns the value of attribute enabled.



7
8
9
# File 'lib/trailer/configuration.rb', line 7

def enabled
  @enabled
end

#environmentObject

Returns the value of attribute environment.



7
8
9
# File 'lib/trailer/configuration.rb', line 7

def environment
  @environment
end

#host_nameObject

Returns the value of attribute host_name.



7
8
9
# File 'lib/trailer/configuration.rb', line 7

def host_name
  @host_name
end

#service_nameObject

Returns the value of attribute service_name.



7
8
9
# File 'lib/trailer/configuration.rb', line 7

def service_name
  @service_name
end

#storageObject

Returns the value of attribute storage.



7
8
9
# File 'lib/trailer/configuration.rb', line 7

def storage
  @storage
end

#tag_fieldsObject

Returns the value of attribute tag_fields.



19
20
21
# File 'lib/trailer/configuration.rb', line 19

def tag_fields
  @tag_fields
end