Class: NewRelic::TelemetrySdk::Config
- Inherits:
-
Object
- Object
- NewRelic::TelemetrySdk::Config
- Defined in:
- lib/newrelic/telemetry_sdk/config.rb
Overview
This class allows setting configuration options for the Telemetry SDK via NewRelic::TelemetrySdk.configure.
Constant Summary collapse
- DEFAULT_TRACE_API_HOST =
Default host for the Trace Client
"https://trace-api.newrelic.com"
- DEFAULT_HARVEST_INTERVAL =
Default harvest interval in seconds
5
- DEFAULT_BACKOFF_FACTOR =
Default backoff strategy factorial
5
- DEFAULT_BACKOFF_MAX =
Default maximum backoff wait time in seconds
80
- DEFAULT_MAX_RETRIES =
Default number of retries to send same data
8
Instance Attribute Summary collapse
-
#api_insert_key ⇒ Object
A New Relic Insert API key.
-
#audit_logging_enabled ⇒ Object
If audit logging is enabled, the contents of every payload sent to New Relic will be recorded in logs.
-
#backoff_factor ⇒ Object
The amount of time (in seconds) to wait after sending data to New Relic fails before attempting to send again.
-
#backoff_max ⇒ Object
If data cannot be sent to New Relic intermittently, the SDK will retry the request at increasing intervals, but will stop increasing the retry intervals when they have reached
backoff_max
seconds. -
#harvest_interval ⇒ Object
The frequency of automatic harvest (in seconds) if sending data with a harvester.
-
#logger ⇒ Object
A Logger object customized with your preferred log output destination (if any) and log level.
-
#max_retries ⇒ Object
The maximum number of times to retry sending data to New Relic.
-
#trace_api_host ⇒ Object
An alternative New Relic host URL where spans can be sent.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
private
A new instance of Config.
Constructor Details
#initialize ⇒ Config
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Config.
84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/newrelic/telemetry_sdk/config.rb', line 84 def initialize @api_insert_key = ENV[API_INSERT_KEY] @logger = Logger.logger @audit_logging_enabled = false @harvest_interval = DEFAULT_HARVEST_INTERVAL @backoff_factor = DEFAULT_BACKOFF_FACTOR @backoff_max = DEFAULT_BACKOFF_MAX @max_retries = DEFAULT_MAX_RETRIES @trace_api_host = DEFAULT_TRACE_API_HOST end |
Instance Attribute Details
#api_insert_key ⇒ Object
A New Relic Insert API key. Necessary for sending data to New Relic via the Telemetry SDK. Defaults to API_INSERT_KEY
environment variable.
40 41 42 |
# File 'lib/newrelic/telemetry_sdk/config.rb', line 40 def api_insert_key @api_insert_key end |
#audit_logging_enabled ⇒ Object
If audit logging is enabled, the contents of every payload sent to New Relic will be recorded in logs. This is a very verbose log level for debugging purposes.
51 52 53 |
# File 'lib/newrelic/telemetry_sdk/config.rb', line 51 def audit_logging_enabled @audit_logging_enabled end |
#backoff_factor ⇒ Object
The amount of time (in seconds) to wait after sending data to New Relic fails before attempting to send again. Defaults to DEFAULT_HARVEST_INTERVAL seconds.
63 64 65 |
# File 'lib/newrelic/telemetry_sdk/config.rb', line 63 def backoff_factor @backoff_factor end |
#backoff_max ⇒ Object
If data cannot be sent to New Relic intermittently, the SDK will retry the request at increasing intervals, but will stop increasing the retry intervals when they have reached backoff_max
seconds. Defaults to DEFAULT_BACKOFF_MAX seconds.
71 72 73 |
# File 'lib/newrelic/telemetry_sdk/config.rb', line 71 def backoff_max @backoff_max end |
#harvest_interval ⇒ Object
The frequency of automatic harvest (in seconds) if sending data with a harvester. Defaults to DEFAULT_HARVEST_INTERVAL seconds.
57 58 59 |
# File 'lib/newrelic/telemetry_sdk/config.rb', line 57 def harvest_interval @harvest_interval end |
#logger ⇒ Object
A Logger object customized with your preferred log output destination (if any) and log level.
45 46 47 |
# File 'lib/newrelic/telemetry_sdk/config.rb', line 45 def logger @logger end |
#max_retries ⇒ Object
The maximum number of times to retry sending data to New Relic. Defaults to DEFAULT_MAX_RETRIES.
76 77 78 |
# File 'lib/newrelic/telemetry_sdk/config.rb', line 76 def max_retries @max_retries end |
#trace_api_host ⇒ Object
An alternative New Relic host URL where spans can be sent. Defaults to DEFAULT_TRACE_API_HOST
81 82 83 |
# File 'lib/newrelic/telemetry_sdk/config.rb', line 81 def trace_api_host @trace_api_host end |