Class: Sqreen::Kit::Configuration
- Inherits:
-
Object
- Object
- Sqreen::Kit::Configuration
- Defined in:
- lib/sqreen/kit/configuration.rb
Class Attribute Summary collapse
-
.api_key ⇒ Object
authentication.
-
.app_name ⇒ Object
authentication.
-
.batch_flush_size ⇒ Object
batch collector.
-
.batch_max_delay_s ⇒ Object
batch collector.
-
.batch_max_size ⇒ Object
batch collector.
-
.certificate_store ⇒ Object
http client related.
-
.connect_timeout ⇒ Object
http client related.
-
.default_source ⇒ Object
Default value for source in signals taking a generic value Something like ‘sqreen:agent:ruby:1.11.1’ XXX: do not provide default and force user to explicitly set source?.
-
.ingestion_url ⇒ Object
http client related.
-
.logger ⇒ Object
Returns the value of attribute logger.
-
.proxy_address ⇒ Object
http client related.
-
.proxy_pass ⇒ Object
http client related.
-
.proxy_port ⇒ Object
http client related.
-
.proxy_user ⇒ Object
http client related.
-
.read_timeout ⇒ Object
http client related.
-
.retry_max_retries ⇒ Object
retry policy.
-
.retry_wait_s ⇒ Object
retry policy.
-
.session_key ⇒ Object
authentication.
Class Method Summary collapse
- .proxy_url=(url) ⇒ Object
-
.set_defaults ⇒ Object
default values.
Class Attribute Details
.api_key ⇒ Object
authentication
30 31 32 |
# File 'lib/sqreen/kit/configuration.rb', line 30 def api_key @api_key end |
.app_name ⇒ Object
authentication
30 31 32 |
# File 'lib/sqreen/kit/configuration.rb', line 30 def app_name @app_name end |
.batch_flush_size ⇒ Object
batch collector
35 36 37 |
# File 'lib/sqreen/kit/configuration.rb', line 35 def batch_flush_size @batch_flush_size end |
.batch_max_delay_s ⇒ Object
batch collector
35 36 37 |
# File 'lib/sqreen/kit/configuration.rb', line 35 def batch_max_delay_s @batch_max_delay_s end |
.batch_max_size ⇒ Object
batch collector
35 36 37 |
# File 'lib/sqreen/kit/configuration.rb', line 35 def batch_max_size @batch_max_size end |
.certificate_store ⇒ Object
http client related
16 17 18 |
# File 'lib/sqreen/kit/configuration.rb', line 16 def certificate_store @certificate_store end |
.connect_timeout ⇒ Object
http client related
16 17 18 |
# File 'lib/sqreen/kit/configuration.rb', line 16 def connect_timeout @connect_timeout end |
.default_source ⇒ Object
Default value for source in signals taking a generic value Something like ‘sqreen:agent:ruby:1.11.1’ XXX: do not provide default and force user to explicitly set source?
42 43 44 |
# File 'lib/sqreen/kit/configuration.rb', line 42 def default_source @default_source end |
.ingestion_url ⇒ Object
http client related
16 17 18 |
# File 'lib/sqreen/kit/configuration.rb', line 16 def ingestion_url @ingestion_url end |
.logger ⇒ Object
Returns the value of attribute logger.
13 14 15 |
# File 'lib/sqreen/kit/configuration.rb', line 13 def logger @logger end |
.proxy_address ⇒ Object
http client related
16 17 18 |
# File 'lib/sqreen/kit/configuration.rb', line 16 def proxy_address @proxy_address end |
.proxy_pass ⇒ Object
http client related
16 17 18 |
# File 'lib/sqreen/kit/configuration.rb', line 16 def proxy_pass @proxy_pass end |
.proxy_port ⇒ Object
http client related
16 17 18 |
# File 'lib/sqreen/kit/configuration.rb', line 16 def proxy_port @proxy_port end |
.proxy_user ⇒ Object
http client related
16 17 18 |
# File 'lib/sqreen/kit/configuration.rb', line 16 def proxy_user @proxy_user end |
.read_timeout ⇒ Object
http client related
16 17 18 |
# File 'lib/sqreen/kit/configuration.rb', line 16 def read_timeout @read_timeout end |
.retry_max_retries ⇒ Object
retry policy
26 27 28 |
# File 'lib/sqreen/kit/configuration.rb', line 26 def retry_max_retries @retry_max_retries end |
.retry_wait_s ⇒ Object
retry policy
26 27 28 |
# File 'lib/sqreen/kit/configuration.rb', line 26 def retry_wait_s @retry_wait_s end |
.session_key ⇒ Object
authentication
30 31 32 |
# File 'lib/sqreen/kit/configuration.rb', line 30 def session_key @session_key end |
Class Method Details
.proxy_url=(url) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/sqreen/kit/configuration.rb', line 45 def proxy_url=(url) if url.nil? self.proxy_address = self.proxy_port = self.proxy_user = self.proxy_pass = nil return end parsed = URI.parse(url) raise ArgumentError, 'only http proxies are supported' unless parsed.scheme == 'http' self.proxy_address = parsed.host self.proxy_port = parsed.port self.proxy_user = parsed.user self.proxy_port = parsed.port end |
.set_defaults ⇒ Object
default values
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/sqreen/kit/configuration.rb', line 65 def self.set_defaults instance_variables.each do |ia| instance_variable_set(ia, nil) end self.logger = ::Logger.new(STDERR) logger.level = ::Logger::WARN logger.progname = 'sqreen-kit' self.ingestion_url = 'https://ingestion.sqreen.com/' self.default_source = "sqreen:kit:#{Sqreen::Kit.version}" end |