Class: BrainzLab::Configuration

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

Constant Summary collapse

LEVELS =
%i[debug info warn error fatal].freeze
SELF_TRACKING_SERVICES =

Services that should not track themselves to avoid circular dependencies

{
  'recall' => :recall_enabled,
  'reflex' => :reflex_enabled,
  'pulse' => :pulse_enabled,
  'flux' => :flux_enabled,
  'signal' => :signal_enabled
}.freeze
MODES =
%i[production development].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/brainzlab/configuration.rb', line 178

def initialize
  # SDK enabled flag — set BRAINZLAB_SDK_ENABLED=false to completely disable
  @enabled = ENV.fetch('BRAINZLAB_SDK_ENABLED', 'true') != 'false'

  # Authentication
  @secret_key = ENV.fetch('BRAINZLAB_SECRET_KEY', nil)

  # Environment
  @environment = ENV['BRAINZLAB_ENVIRONMENT'] || detect_environment
  @service = ENV.fetch('BRAINZLAB_SERVICE', nil)
  @host = ENV['BRAINZLAB_HOST'] || detect_host

  # App name for auto-provisioning
  @app_name = ENV.fetch('BRAINZLAB_APP_NAME', nil)

  # Git context
  @commit = ENV['GIT_COMMIT'] || ENV['COMMIT_SHA'] || detect_git_commit
  @branch = ENV['GIT_BRANCH'] || ENV['BRANCH_NAME'] || detect_git_branch

  # Debug mode - enables verbose logging
  @debug = ENV['BRAINZLAB_DEBUG'] == 'true'

  # SDK mode - :production (default) or :development (offline, local storage)
  @mode = ENV['BRAINZLAB_MODE']&.to_sym || :production

  # Development mode settings
  @development_db_path = ENV['BRAINZLAB_DEV_DB_PATH'] || 'tmp/brainzlab.sqlite3'
  @development_log_output = $stdout

  # Disable self-tracking - prevents services from tracking to themselves
  # e.g., Recall won't log to itself, Reflex won't track errors to itself
  @disable_self_tracking = ENV.fetch('BRAINZLAB_DISABLE_SELF_TRACKING', 'true') == 'true'

  # Recall settings
  @recall_enabled = true
  @recall_url = ENV['RECALL_URL'] || detect_product_url('recall')
  @recall_min_level = :debug
  @recall_buffer_size = 50
  @recall_flush_interval = 5
  @recall_master_key = ENV.fetch('RECALL_MASTER_KEY', nil)
  @recall_auto_provision = true

  # Reflex settings
  @reflex_enabled = true
  @reflex_url = ENV['REFLEX_URL'] || detect_product_url('reflex')
  @reflex_api_key = ENV.fetch('REFLEX_API_KEY', nil)
  @reflex_master_key = ENV.fetch('REFLEX_MASTER_KEY', nil)
  @reflex_auto_provision = true
  @reflex_excluded_exceptions = []
  @reflex_before_send = nil
  @reflex_sample_rate = nil
  @reflex_fingerprint = nil # Custom fingerprint callback

  # Pulse settings
  @pulse_enabled = true
  @pulse_url = ENV['PULSE_URL'] || detect_product_url('pulse')
  @pulse_api_key = ENV.fetch('PULSE_API_KEY', nil)
  @pulse_master_key = ENV.fetch('PULSE_MASTER_KEY', nil)
  @pulse_auto_provision = true
  @pulse_buffer_size = 50
  @pulse_flush_interval = 5
  @pulse_sample_rate = nil
  @pulse_excluded_paths = %w[/health /ping /up /assets]

  # Flux settings
  @flux_enabled = true
  @flux_url = ENV['FLUX_URL'] || 'https://flux.brainzlab.ai'
  @flux_api_key = ENV.fetch('FLUX_API_KEY', nil)
  @flux_ingest_key = ENV.fetch('FLUX_INGEST_KEY', nil)
  @flux_master_key = ENV.fetch('FLUX_MASTER_KEY', nil)
  @flux_auto_provision = true
  @flux_buffer_size = 100
  @flux_flush_interval = 5

  # Signal settings
  @signal_enabled = true
  @signal_url = ENV['SIGNAL_URL'] || detect_product_url('signal')
  @signal_api_key = ENV.fetch('SIGNAL_API_KEY', nil)
  @signal_ingest_key = ENV.fetch('SIGNAL_INGEST_KEY', nil)
  @signal_master_key = ENV.fetch('SIGNAL_MASTER_KEY', nil)
  @signal_auto_provision = true

  # Vault settings
  @vault_enabled = true
  @vault_url = ENV['VAULT_URL'] || 'https://vault.brainzlab.ai'
  @vault_api_key = ENV.fetch('VAULT_API_KEY', nil)
  @vault_master_key = ENV.fetch('VAULT_MASTER_KEY', nil)
  @vault_auto_provision = true
  @vault_cache_enabled = true
  @vault_cache_ttl = 300 # 5 minutes
  @vault_auto_load = ENV.fetch('VAULT_AUTO_LOAD', 'false') == 'true' # Auto-load secrets into ENV
  @vault_load_provider_keys = true # Also load provider keys (OpenAI, etc.)

  # Vision settings (AI browser automation)
  @vision_enabled = true
  @vision_url = ENV['VISION_URL'] || 'https://vision.brainzlab.ai'
  @vision_api_key = ENV.fetch('VISION_API_KEY', nil)
  @vision_ingest_key = ENV.fetch('VISION_INGEST_KEY', nil)
  @vision_master_key = ENV.fetch('VISION_MASTER_KEY', nil)
  @vision_auto_provision = true
  @vision_default_model = ENV['VISION_DEFAULT_MODEL'] || 'claude-sonnet-4'
  @vision_default_browser_provider = ENV['VISION_DEFAULT_BROWSER_PROVIDER'] || 'local'

  # Cortex settings (feature flags)
  @cortex_enabled = true
  @cortex_url = ENV['CORTEX_URL'] || 'https://cortex.brainzlab.ai'
  @cortex_api_key = ENV.fetch('CORTEX_API_KEY', nil)
  @cortex_master_key = ENV.fetch('CORTEX_MASTER_KEY', nil)
  @cortex_auto_provision = true
  @cortex_cache_enabled = true
  @cortex_cache_ttl = 60 # 1 minute
  @cortex_default_context = {}

  # Beacon settings (uptime monitoring)
  @beacon_enabled = true
  @beacon_url = ENV['BEACON_URL'] || 'https://beacon.brainzlab.ai'
  @beacon_api_key = ENV.fetch('BEACON_API_KEY', nil)
  @beacon_master_key = ENV.fetch('BEACON_MASTER_KEY', nil)
  @beacon_auto_provision = true

  # Nerve settings (job monitoring)
  @nerve_enabled = true
  @nerve_url = ENV['NERVE_URL'] || 'https://nerve.brainzlab.ai'
  @nerve_api_key = ENV.fetch('NERVE_API_KEY', nil)
  @nerve_master_key = ENV.fetch('NERVE_MASTER_KEY', nil)
  @nerve_auto_provision = true

  # Dendrite settings (AI documentation)
  @dendrite_enabled = true
  @dendrite_url = ENV['DENDRITE_URL'] || 'https://dendrite.brainzlab.ai'
  @dendrite_api_key = ENV.fetch('DENDRITE_API_KEY', nil)
  @dendrite_master_key = ENV.fetch('DENDRITE_MASTER_KEY', nil)
  @dendrite_auto_provision = true

  # Sentinel settings (host monitoring)
  @sentinel_enabled = true
  @sentinel_url = ENV['SENTINEL_URL'] || 'https://sentinel.brainzlab.ai'
  @sentinel_api_key = ENV.fetch('SENTINEL_API_KEY', nil)
  @sentinel_agent_key = ENV.fetch('SENTINEL_AGENT_KEY', nil)
  @sentinel_master_key = ENV.fetch('SENTINEL_MASTER_KEY', nil)
  @sentinel_auto_provision = true

  # Synapse settings (AI development orchestration)
  @synapse_enabled = true
  @synapse_url = ENV['SYNAPSE_URL'] || 'https://synapse.brainzlab.ai'
  @synapse_api_key = ENV.fetch('SYNAPSE_API_KEY', nil)
  @synapse_master_key = ENV.fetch('SYNAPSE_MASTER_KEY', nil)
  @synapse_auto_provision = true

  # Filtering
  @scrub_fields = %i[password password_confirmation token api_key secret]

  # Internal logger for debugging SDK issues
  @logger = nil

  # Debug callbacks
  # Called when an SDK error occurs (lambda/proc receiving error object and context hash)
  @on_error = nil
  # Called before each API request (lambda/proc receiving service, method, path, and payload)
  @on_send = nil

  # Instrumentation
  @instrument_http = true # Enable HTTP client instrumentation (Net::HTTP, Faraday, HTTParty)
  @instrument_active_record = true # AR breadcrumbs for Reflex
  @instrument_redis = true # Redis command instrumentation
  @instrument_sidekiq = true  # Sidekiq job instrumentation
  @instrument_graphql = true  # GraphQL query instrumentation
  @instrument_mongodb = true  # MongoDB/Mongoid instrumentation
  @instrument_elasticsearch = true  # Elasticsearch instrumentation
  @instrument_action_controller = true  # ActionController instrumentation (requests, redirects, filters)
  @instrument_action_view = true  # ActionView instrumentation (templates, partials, collections)
  @instrument_action_mailer = true  # ActionMailer instrumentation
  @instrument_active_job = true  # ActiveJob instrumentation (enqueue, perform, retry, discard)
  @instrument_active_support_cache = true  # ActiveSupport::Cache instrumentation (read, write, fetch)
  @instrument_delayed_job = true # Delayed::Job instrumentation
  @instrument_grape = true # Grape API instrumentation
  @instrument_solid_queue = true # Solid Queue job instrumentation
  @instrument_good_job = true # GoodJob instrumentation
  @instrument_resque = true # Resque instrumentation
  @instrument_excon = true # Excon HTTP client instrumentation
  @instrument_typhoeus = true # Typhoeus HTTP client instrumentation
  @instrument_dalli = true # Dalli/Memcached instrumentation
  @instrument_aws = true # AWS SDK instrumentation
  @instrument_stripe = true # Stripe API instrumentation
  @instrument_active_storage = true # ActiveStorage instrumentation (uploads, downloads, transforms)
  @instrument_action_cable = true # ActionCable WebSocket instrumentation
  @instrument_action_dispatch = true # ActionDispatch instrumentation (middleware, redirects, requests)
  @instrument_rails_deprecation = true # Rails deprecation warnings tracking
  @instrument_action_mailbox = true # ActionMailbox inbound email processing instrumentation
  @instrument_railties = true # Railties config initializer loading instrumentation
  @http_ignore_hosts = %w[localhost 127.0.0.1]
  @redis_ignore_commands = %w[ping info] # Commands to skip tracking

  # ActiveRecord slow-query / N+1 detection — all tunable so a single chatty
  # default can't flood Recall. Slow-query duration is APM data (Pulse already
  # records it), so it defaults to a quiet level (:debug) and a higher threshold.
  @slow_query_threshold       = (ENV['BRAINZLAB_SLOW_QUERY_THRESHOLD'] || 500).to_i      # ms (was hardcoded 100)
  @very_slow_query_threshold  = (ENV['BRAINZLAB_VERY_SLOW_QUERY_THRESHOLD'] || 2000).to_i # ms (was hardcoded 1000)
  @slow_query_log_level       = (ENV['BRAINZLAB_SLOW_QUERY_LOG_LEVEL'] || 'debug').to_sym  # was :warn → floods
  @very_slow_query_log_level  = (ENV['BRAINZLAB_VERY_SLOW_QUERY_LOG_LEVEL'] || 'warn').to_sym
  @n_plus_one_threshold       = (ENV['BRAINZLAB_N_PLUS_ONE_THRESHOLD'] || 10).to_i        # was hardcoded 5
  @n_plus_one_log_level       = (ENV['BRAINZLAB_N_PLUS_ONE_LOG_LEVEL'] || 'debug').to_sym  # was :warning

  # Log formatter settings
  @log_formatter_enabled = true
  @log_formatter_colors = nil # auto-detect TTY
  @log_formatter_hide_assets = false
  @log_formatter_compact_assets = true
  @log_formatter_show_params = true

  # DevTools settings (development error page and debug panel)
  @devtools_enabled = true
  @devtools_error_page_enabled = true
  @devtools_debug_panel_enabled = true
  @devtools_allowed_environments = %w[development test]
  @devtools_allowed_ips = ['127.0.0.1', '::1', '172.16.0.0/12', '192.168.0.0/16', '10.0.0.0/8']
  @devtools_asset_path = '/__brainzlab__'
  @devtools_panel_position = 'bottom-right'
  @devtools_expand_by_default = false

  # Rails instrumentation delegation
  # When true, brainzlab-rails gem handles Rails-specific instrumentation
  # SDK will only install non-Rails instrumentation (HTTP clients, Redis, etc.)
  @rails_instrumentation_handled_externally = false
end

Instance Attribute Details

#app_nameObject

Returns the value of attribute app_name.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def app_name
  @app_name
end

#beacon_api_keyObject

Returns the value of attribute beacon_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def beacon_api_key
  @beacon_api_key
end

#beacon_auto_provisionObject

Returns the value of attribute beacon_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def beacon_auto_provision
  @beacon_auto_provision
end

#beacon_enabledObject

Returns the value of attribute beacon_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def beacon_enabled
  @beacon_enabled
end

#beacon_master_keyObject

Returns the value of attribute beacon_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def beacon_master_key
  @beacon_master_key
end

#beacon_urlObject

Returns the value of attribute beacon_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def beacon_url
  @beacon_url
end

#branchObject

Returns the value of attribute branch.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def branch
  @branch
end

#commitObject

Returns the value of attribute commit.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def commit
  @commit
end

#cortex_api_keyObject

Returns the value of attribute cortex_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def cortex_api_key
  @cortex_api_key
end

#cortex_auto_provisionObject

Returns the value of attribute cortex_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def cortex_auto_provision
  @cortex_auto_provision
end

#cortex_cache_enabledObject

Returns the value of attribute cortex_cache_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def cortex_cache_enabled
  @cortex_cache_enabled
end

#cortex_cache_ttlObject

Returns the value of attribute cortex_cache_ttl.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def cortex_cache_ttl
  @cortex_cache_ttl
end

#cortex_default_contextObject

Returns the value of attribute cortex_default_context.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def cortex_default_context
  @cortex_default_context
end

#cortex_enabledObject

Returns the value of attribute cortex_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def cortex_enabled
  @cortex_enabled
end

#cortex_master_keyObject

Returns the value of attribute cortex_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def cortex_master_key
  @cortex_master_key
end

#cortex_urlObject

Returns the value of attribute cortex_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def cortex_url
  @cortex_url
end

#debugObject

Returns the value of attribute debug.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def debug
  @debug
end

#dendrite_api_keyObject

Returns the value of attribute dendrite_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def dendrite_api_key
  @dendrite_api_key
end

#dendrite_auto_provisionObject

Returns the value of attribute dendrite_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def dendrite_auto_provision
  @dendrite_auto_provision
end

#dendrite_enabledObject

Returns the value of attribute dendrite_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def dendrite_enabled
  @dendrite_enabled
end

#dendrite_master_keyObject

Returns the value of attribute dendrite_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def dendrite_master_key
  @dendrite_master_key
end

#dendrite_urlObject

Returns the value of attribute dendrite_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def dendrite_url
  @dendrite_url
end

#development_db_pathObject

Returns the value of attribute development_db_path.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def development_db_path
  @development_db_path
end

#development_log_outputObject

Returns the value of attribute development_log_output.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def development_log_output
  @development_log_output
end

#devtools_allowed_environmentsObject

Returns the value of attribute devtools_allowed_environments.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def devtools_allowed_environments
  @devtools_allowed_environments
end

#devtools_allowed_ipsObject

Returns the value of attribute devtools_allowed_ips.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def devtools_allowed_ips
  @devtools_allowed_ips
end

#devtools_asset_pathObject

Returns the value of attribute devtools_asset_path.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def devtools_asset_path
  @devtools_asset_path
end

#devtools_debug_panel_enabledObject

Returns the value of attribute devtools_debug_panel_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def devtools_debug_panel_enabled
  @devtools_debug_panel_enabled
end

#devtools_enabledObject

Returns the value of attribute devtools_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def devtools_enabled
  @devtools_enabled
end

#devtools_error_page_enabledObject

Returns the value of attribute devtools_error_page_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def devtools_error_page_enabled
  @devtools_error_page_enabled
end

#devtools_expand_by_defaultObject

Returns the value of attribute devtools_expand_by_default.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def devtools_expand_by_default
  @devtools_expand_by_default
end

#devtools_panel_positionObject

Returns the value of attribute devtools_panel_position.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def devtools_panel_position
  @devtools_panel_position
end

#disable_self_trackingObject

Returns the value of attribute disable_self_tracking.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def disable_self_tracking
  @disable_self_tracking
end

#enabledObject

Returns the value of attribute enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def enabled
  @enabled
end

#environmentObject

Returns the value of attribute environment.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def environment
  @environment
end

#flux_api_keyObject

Returns the value of attribute flux_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def flux_api_key
  @flux_api_key
end

#flux_auto_provisionObject

Returns the value of attribute flux_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def flux_auto_provision
  @flux_auto_provision
end

#flux_buffer_sizeObject

Returns the value of attribute flux_buffer_size.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def flux_buffer_size
  @flux_buffer_size
end

#flux_enabledObject

Returns the value of attribute flux_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def flux_enabled
  @flux_enabled
end

#flux_flush_intervalObject

Returns the value of attribute flux_flush_interval.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def flux_flush_interval
  @flux_flush_interval
end

#flux_ingest_keyObject

Returns the value of attribute flux_ingest_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def flux_ingest_key
  @flux_ingest_key
end

#flux_master_keyObject

Returns the value of attribute flux_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def flux_master_key
  @flux_master_key
end

#flux_urlObject

Returns the value of attribute flux_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def flux_url
  @flux_url
end

#hostObject

Returns the value of attribute host.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def host
  @host
end

#http_ignore_hostsObject

Returns the value of attribute http_ignore_hosts.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def http_ignore_hosts
  @http_ignore_hosts
end

#instrument_action_cableObject

Returns the value of attribute instrument_action_cable.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_action_cable
  @instrument_action_cable
end

#instrument_action_controllerObject

Returns the value of attribute instrument_action_controller.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_action_controller
  @instrument_action_controller
end

#instrument_action_dispatchObject

Returns the value of attribute instrument_action_dispatch.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_action_dispatch
  @instrument_action_dispatch
end

#instrument_action_mailboxObject

Returns the value of attribute instrument_action_mailbox.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_action_mailbox
  @instrument_action_mailbox
end

#instrument_action_mailerObject

Returns the value of attribute instrument_action_mailer.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_action_mailer
  @instrument_action_mailer
end

#instrument_action_viewObject

Returns the value of attribute instrument_action_view.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_action_view
  @instrument_action_view
end

#instrument_active_jobObject

Returns the value of attribute instrument_active_job.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_active_job
  @instrument_active_job
end

#instrument_active_recordObject

Returns the value of attribute instrument_active_record.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_active_record
  @instrument_active_record
end

#instrument_active_storageObject

Returns the value of attribute instrument_active_storage.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_active_storage
  @instrument_active_storage
end

#instrument_active_support_cacheObject

Returns the value of attribute instrument_active_support_cache.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_active_support_cache
  @instrument_active_support_cache
end

#instrument_awsObject

Returns the value of attribute instrument_aws.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_aws
  @instrument_aws
end

#instrument_dalliObject

Returns the value of attribute instrument_dalli.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_dalli
  @instrument_dalli
end

#instrument_delayed_jobObject

Returns the value of attribute instrument_delayed_job.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_delayed_job
  @instrument_delayed_job
end

#instrument_elasticsearchObject

Returns the value of attribute instrument_elasticsearch.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_elasticsearch
  @instrument_elasticsearch
end

#instrument_exconObject

Returns the value of attribute instrument_excon.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_excon
  @instrument_excon
end

#instrument_good_jobObject

Returns the value of attribute instrument_good_job.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_good_job
  @instrument_good_job
end

#instrument_grapeObject

Returns the value of attribute instrument_grape.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_grape
  @instrument_grape
end

#instrument_graphqlObject

Returns the value of attribute instrument_graphql.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_graphql
  @instrument_graphql
end

#instrument_httpObject

Returns the value of attribute instrument_http.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_http
  @instrument_http
end

#instrument_mongodbObject

Returns the value of attribute instrument_mongodb.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_mongodb
  @instrument_mongodb
end

#instrument_rails_deprecationObject

Returns the value of attribute instrument_rails_deprecation.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_rails_deprecation
  @instrument_rails_deprecation
end

#instrument_railtiesObject

Returns the value of attribute instrument_railties.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_railties
  @instrument_railties
end

#instrument_redisObject

Returns the value of attribute instrument_redis.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_redis
  @instrument_redis
end

#instrument_resqueObject

Returns the value of attribute instrument_resque.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_resque
  @instrument_resque
end

#instrument_sidekiqObject

Returns the value of attribute instrument_sidekiq.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_sidekiq
  @instrument_sidekiq
end

#instrument_solid_queueObject

Returns the value of attribute instrument_solid_queue.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_solid_queue
  @instrument_solid_queue
end

#instrument_stripeObject

Returns the value of attribute instrument_stripe.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_stripe
  @instrument_stripe
end

#instrument_typhoeusObject

Returns the value of attribute instrument_typhoeus.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def instrument_typhoeus
  @instrument_typhoeus
end

#log_formatter_colorsObject

Returns the value of attribute log_formatter_colors.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def log_formatter_colors
  @log_formatter_colors
end

#log_formatter_compact_assetsObject

Returns the value of attribute log_formatter_compact_assets.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def log_formatter_compact_assets
  @log_formatter_compact_assets
end

#log_formatter_enabledObject

Returns the value of attribute log_formatter_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def log_formatter_enabled
  @log_formatter_enabled
end

#log_formatter_hide_assetsObject

Returns the value of attribute log_formatter_hide_assets.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def log_formatter_hide_assets
  @log_formatter_hide_assets
end

#log_formatter_show_paramsObject

Returns the value of attribute log_formatter_show_params.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def log_formatter_show_params
  @log_formatter_show_params
end

#loggerObject

Returns the value of attribute logger.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def logger
  @logger
end

#modeObject

mode has a custom setter with validation



11
12
13
# File 'lib/brainzlab/configuration.rb', line 11

def mode
  @mode
end

#n_plus_one_log_levelObject

Returns the value of attribute n_plus_one_log_level.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def n_plus_one_log_level
  @n_plus_one_log_level
end

#n_plus_one_thresholdObject

Returns the value of attribute n_plus_one_threshold.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def n_plus_one_threshold
  @n_plus_one_threshold
end

#nerve_api_keyObject

Returns the value of attribute nerve_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def nerve_api_key
  @nerve_api_key
end

#nerve_auto_provisionObject

Returns the value of attribute nerve_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def nerve_auto_provision
  @nerve_auto_provision
end

#nerve_enabledObject

Returns the value of attribute nerve_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def nerve_enabled
  @nerve_enabled
end

#nerve_master_keyObject

Returns the value of attribute nerve_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def nerve_master_key
  @nerve_master_key
end

#nerve_urlObject

Returns the value of attribute nerve_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def nerve_url
  @nerve_url
end

#on_errorObject

Returns the value of attribute on_error.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def on_error
  @on_error
end

#on_sendObject

Returns the value of attribute on_send.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def on_send
  @on_send
end

#pulse_api_keyObject

Returns the value of attribute pulse_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def pulse_api_key
  @pulse_api_key
end

#pulse_auto_provisionObject

Returns the value of attribute pulse_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def pulse_auto_provision
  @pulse_auto_provision
end

#pulse_buffer_sizeObject

Returns the value of attribute pulse_buffer_size.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def pulse_buffer_size
  @pulse_buffer_size
end

#pulse_enabledObject

Returns the value of attribute pulse_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def pulse_enabled
  @pulse_enabled
end

#pulse_excluded_pathsObject

Returns the value of attribute pulse_excluded_paths.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def pulse_excluded_paths
  @pulse_excluded_paths
end

#pulse_flush_intervalObject

Returns the value of attribute pulse_flush_interval.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def pulse_flush_interval
  @pulse_flush_interval
end

#pulse_master_keyObject

Returns the value of attribute pulse_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def pulse_master_key
  @pulse_master_key
end

#pulse_sample_rateObject

Returns the value of attribute pulse_sample_rate.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def pulse_sample_rate
  @pulse_sample_rate
end

#pulse_urlObject

Returns the value of attribute pulse_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def pulse_url
  @pulse_url
end

#rails_instrumentation_handled_externallyObject

Returns the value of attribute rails_instrumentation_handled_externally.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def rails_instrumentation_handled_externally
  @rails_instrumentation_handled_externally
end

#recall_auto_provisionObject

Returns the value of attribute recall_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def recall_auto_provision
  @recall_auto_provision
end

#recall_buffer_sizeObject

Returns the value of attribute recall_buffer_size.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def recall_buffer_size
  @recall_buffer_size
end

#recall_enabledObject

Returns the value of attribute recall_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def recall_enabled
  @recall_enabled
end

#recall_flush_intervalObject

Returns the value of attribute recall_flush_interval.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def recall_flush_interval
  @recall_flush_interval
end

#recall_master_keyObject

Returns the value of attribute recall_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def recall_master_key
  @recall_master_key
end

#recall_min_levelObject

recall_min_level has a custom setter with validation



8
9
10
# File 'lib/brainzlab/configuration.rb', line 8

def recall_min_level
  @recall_min_level
end

#recall_urlObject

Returns the value of attribute recall_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def recall_url
  @recall_url
end

#redis_ignore_commandsObject

Returns the value of attribute redis_ignore_commands.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def redis_ignore_commands
  @redis_ignore_commands
end

#reflex_api_keyObject

Returns the value of attribute reflex_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def reflex_api_key
  @reflex_api_key
end

#reflex_auto_provisionObject

Returns the value of attribute reflex_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def reflex_auto_provision
  @reflex_auto_provision
end

#reflex_before_sendObject

Returns the value of attribute reflex_before_send.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def reflex_before_send
  @reflex_before_send
end

#reflex_enabledObject

Returns the value of attribute reflex_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def reflex_enabled
  @reflex_enabled
end

#reflex_excluded_exceptionsObject

Returns the value of attribute reflex_excluded_exceptions.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def reflex_excluded_exceptions
  @reflex_excluded_exceptions
end

#reflex_fingerprintObject

Returns the value of attribute reflex_fingerprint.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def reflex_fingerprint
  @reflex_fingerprint
end

#reflex_master_keyObject

Returns the value of attribute reflex_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def reflex_master_key
  @reflex_master_key
end

#reflex_sample_rateObject

Returns the value of attribute reflex_sample_rate.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def reflex_sample_rate
  @reflex_sample_rate
end

#reflex_urlObject

Returns the value of attribute reflex_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def reflex_url
  @reflex_url
end

#scrub_fieldsObject

Returns the value of attribute scrub_fields.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def scrub_fields
  @scrub_fields
end

#secret_keyObject

Returns the value of attribute secret_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def secret_key
  @secret_key
end

#sentinel_agent_keyObject

Returns the value of attribute sentinel_agent_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def sentinel_agent_key
  @sentinel_agent_key
end

#sentinel_api_keyObject

Returns the value of attribute sentinel_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def sentinel_api_key
  @sentinel_api_key
end

#sentinel_auto_provisionObject

Returns the value of attribute sentinel_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def sentinel_auto_provision
  @sentinel_auto_provision
end

#sentinel_enabledObject

Returns the value of attribute sentinel_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def sentinel_enabled
  @sentinel_enabled
end

#sentinel_master_keyObject

Returns the value of attribute sentinel_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def sentinel_master_key
  @sentinel_master_key
end

#sentinel_urlObject

Returns the value of attribute sentinel_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def sentinel_url
  @sentinel_url
end

#serviceObject

Returns the value of attribute service.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def service
  @service
end

#signal_api_keyObject

Returns the value of attribute signal_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def signal_api_key
  @signal_api_key
end

#signal_auto_provisionObject

Returns the value of attribute signal_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def signal_auto_provision
  @signal_auto_provision
end

#signal_enabledObject

Returns the value of attribute signal_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def signal_enabled
  @signal_enabled
end

#signal_ingest_keyObject

Returns the value of attribute signal_ingest_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def signal_ingest_key
  @signal_ingest_key
end

#signal_master_keyObject

Returns the value of attribute signal_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def signal_master_key
  @signal_master_key
end

#signal_urlObject

Returns the value of attribute signal_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def signal_url
  @signal_url
end

#slow_query_log_levelObject

Returns the value of attribute slow_query_log_level.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def slow_query_log_level
  @slow_query_log_level
end

#slow_query_thresholdObject

Returns the value of attribute slow_query_threshold.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def slow_query_threshold
  @slow_query_threshold
end

#synapse_api_keyObject

Returns the value of attribute synapse_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def synapse_api_key
  @synapse_api_key
end

#synapse_auto_provisionObject

Returns the value of attribute synapse_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def synapse_auto_provision
  @synapse_auto_provision
end

#synapse_enabledObject

Returns the value of attribute synapse_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def synapse_enabled
  @synapse_enabled
end

#synapse_master_keyObject

Returns the value of attribute synapse_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def synapse_master_key
  @synapse_master_key
end

#synapse_urlObject

Returns the value of attribute synapse_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def synapse_url
  @synapse_url
end

#vault_api_keyObject

Returns the value of attribute vault_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vault_api_key
  @vault_api_key
end

#vault_auto_loadObject

Returns the value of attribute vault_auto_load.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vault_auto_load
  @vault_auto_load
end

#vault_auto_provisionObject

Returns the value of attribute vault_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vault_auto_provision
  @vault_auto_provision
end

#vault_cache_enabledObject

Returns the value of attribute vault_cache_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vault_cache_enabled
  @vault_cache_enabled
end

#vault_cache_ttlObject

Returns the value of attribute vault_cache_ttl.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vault_cache_ttl
  @vault_cache_ttl
end

#vault_enabledObject

Returns the value of attribute vault_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vault_enabled
  @vault_enabled
end

#vault_load_provider_keysObject

Returns the value of attribute vault_load_provider_keys.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vault_load_provider_keys
  @vault_load_provider_keys
end

#vault_master_keyObject

Returns the value of attribute vault_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vault_master_key
  @vault_master_key
end

#vault_urlObject

Returns the value of attribute vault_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vault_url
  @vault_url
end

#very_slow_query_log_levelObject

Returns the value of attribute very_slow_query_log_level.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def very_slow_query_log_level
  @very_slow_query_log_level
end

#very_slow_query_thresholdObject

Returns the value of attribute very_slow_query_threshold.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def very_slow_query_threshold
  @very_slow_query_threshold
end

#vision_api_keyObject

Returns the value of attribute vision_api_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vision_api_key
  @vision_api_key
end

#vision_auto_provisionObject

Returns the value of attribute vision_auto_provision.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vision_auto_provision
  @vision_auto_provision
end

#vision_default_browser_providerObject

Returns the value of attribute vision_default_browser_provider.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vision_default_browser_provider
  @vision_default_browser_provider
end

#vision_default_modelObject

Returns the value of attribute vision_default_model.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vision_default_model
  @vision_default_model
end

#vision_enabledObject

Returns the value of attribute vision_enabled.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vision_enabled
  @vision_enabled
end

#vision_ingest_keyObject

Returns the value of attribute vision_ingest_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vision_ingest_key
  @vision_ingest_key
end

#vision_master_keyObject

Returns the value of attribute vision_master_key.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vision_master_key
  @vision_master_key
end

#vision_urlObject

Returns the value of attribute vision_url.



13
14
15
# File 'lib/brainzlab/configuration.rb', line 13

def vision_url
  @vision_url
end

Instance Method Details

#beacon_auth_keyObject



511
512
513
# File 'lib/brainzlab/configuration.rb', line 511

def beacon_auth_key
  beacon_api_key || secret_key
end

#beacon_valid?Boolean

Returns:

  • (Boolean)


506
507
508
509
# File 'lib/brainzlab/configuration.rb', line 506

def beacon_valid?
  key = beacon_api_key || secret_key
  !key.nil? && !key.empty?
end

#cortex_auth_keyObject



529
530
531
# File 'lib/brainzlab/configuration.rb', line 529

def cortex_auth_key
  cortex_api_key || secret_key
end

#cortex_valid?Boolean

Returns:

  • (Boolean)


524
525
526
527
# File 'lib/brainzlab/configuration.rb', line 524

def cortex_valid?
  key = cortex_api_key || secret_key
  !key.nil? && !key.empty?
end

#debug?Boolean

Returns:

  • (Boolean)


560
561
562
# File 'lib/brainzlab/configuration.rb', line 560

def debug?
  @debug == true
end

#debug_log(message) ⇒ Object



634
635
636
637
638
639
640
641
642
643
# File 'lib/brainzlab/configuration.rb', line 634

def debug_log(message)
  return unless debug?

  log_message = "[BrainzLab::Debug] #{message}"
  if logger
    logger.debug(log_message)
  else
    warn(log_message)
  end
end

#dendrite_auth_keyObject



538
539
540
# File 'lib/brainzlab/configuration.rb', line 538

def dendrite_auth_key
  dendrite_api_key || secret_key
end

#dendrite_valid?Boolean

Returns:

  • (Boolean)


533
534
535
536
# File 'lib/brainzlab/configuration.rb', line 533

def dendrite_valid?
  key = dendrite_api_key || secret_key
  !key.nil? && !key.empty?
end

#development_mode?Boolean

Returns:

  • (Boolean)


436
437
438
# File 'lib/brainzlab/configuration.rb', line 436

def development_mode?
  @mode == :development
end

#enabled?Boolean

Returns:

  • (Boolean)


448
449
450
# File 'lib/brainzlab/configuration.rb', line 448

def enabled?
  @enabled == true
end

#flux_auth_keyObject



475
476
477
# File 'lib/brainzlab/configuration.rb', line 475

def flux_auth_key
  flux_ingest_key || flux_api_key || secret_key
end

#flux_effectively_enabled?Boolean

Check if flux is effectively enabled (considering self-tracking)

Returns:

  • (Boolean)


613
614
615
616
617
618
619
620
621
# File 'lib/brainzlab/configuration.rb', line 613

def flux_effectively_enabled?
  return false unless @enabled
  return false unless @flux_enabled
  return true unless @disable_self_tracking

  # Disable if this is the Flux service itself
  normalized_app_name = @app_name.to_s.downcase.strip
  normalized_app_name != 'flux'
end

#flux_valid?Boolean

Returns:

  • (Boolean)


470
471
472
473
# File 'lib/brainzlab/configuration.rb', line 470

def flux_valid?
  key = flux_ingest_key || flux_api_key || secret_key
  !key.nil? && !key.empty?
end

#level_enabled?(level) ⇒ Boolean

Returns:

  • (Boolean)


440
441
442
# File 'lib/brainzlab/configuration.rb', line 440

def level_enabled?(level)
  LEVELS.index(level.to_sym) >= LEVELS.index(@recall_min_level)
end

#nerve_auth_keyObject



520
521
522
# File 'lib/brainzlab/configuration.rb', line 520

def nerve_auth_key
  nerve_api_key || secret_key
end

#nerve_valid?Boolean

Returns:

  • (Boolean)


515
516
517
518
# File 'lib/brainzlab/configuration.rb', line 515

def nerve_valid?
  key = nerve_api_key || secret_key
  !key.nil? && !key.empty?
end

#pulse_auth_keyObject



466
467
468
# File 'lib/brainzlab/configuration.rb', line 466

def pulse_auth_key
  pulse_api_key || secret_key
end

#pulse_effectively_enabled?Boolean

Check if pulse is effectively enabled (considering self-tracking)

Returns:

  • (Boolean)


602
603
604
605
606
607
608
609
610
# File 'lib/brainzlab/configuration.rb', line 602

def pulse_effectively_enabled?
  return false unless @enabled
  return false unless @pulse_enabled
  return true unless @disable_self_tracking

  # Disable if this is the Pulse service itself
  normalized_app_name = @app_name.to_s.downcase.strip
  normalized_app_name != 'pulse'
end

#pulse_valid?Boolean

Returns:

  • (Boolean)


461
462
463
464
# File 'lib/brainzlab/configuration.rb', line 461

def pulse_valid?
  key = pulse_api_key || secret_key
  !key.nil? && !key.empty?
end

#recall_effectively_enabled?Boolean

Check if recall is effectively enabled (considering self-tracking)

Returns:

  • (Boolean)


580
581
582
583
584
585
586
587
588
# File 'lib/brainzlab/configuration.rb', line 580

def recall_effectively_enabled?
  return false unless @enabled
  return false unless @recall_enabled
  return true unless @disable_self_tracking

  # Disable if this is the Recall service itself
  normalized_app_name = @app_name.to_s.downcase.strip
  normalized_app_name != 'recall'
end

#reflex_auth_keyObject



457
458
459
# File 'lib/brainzlab/configuration.rb', line 457

def reflex_auth_key
  reflex_api_key || secret_key
end

#reflex_effectively_enabled?Boolean

Check if reflex is effectively enabled (considering self-tracking)

Returns:

  • (Boolean)


591
592
593
594
595
596
597
598
599
# File 'lib/brainzlab/configuration.rb', line 591

def reflex_effectively_enabled?
  return false unless @enabled
  return false unless @reflex_enabled
  return true unless @disable_self_tracking

  # Disable if this is the Reflex service itself
  normalized_app_name = @app_name.to_s.downcase.strip
  normalized_app_name != 'reflex'
end

#reflex_valid?Boolean

Returns:

  • (Boolean)


452
453
454
455
# File 'lib/brainzlab/configuration.rb', line 452

def reflex_valid?
  key = reflex_api_key || secret_key
  !key.nil? && !key.empty?
end

#sdk_service_hostsObject

Returns hostnames of all configured SDK service URLs Used by Net::HTTP instrumentation to skip tracking SDK’s own HTTP calls



566
567
568
569
570
571
572
573
574
575
576
577
# File 'lib/brainzlab/configuration.rb', line 566

def sdk_service_hosts
  @sdk_service_hosts ||= begin
    urls = [
      @recall_url, @reflex_url, @pulse_url, @flux_url,
      @signal_url, @vault_url, @vision_url, @cortex_url,
      @beacon_url, @nerve_url, @dendrite_url, @sentinel_url,
      @synapse_url
    ].compact

    urls.filter_map { |url| URI.parse(url).host rescue nil }.uniq
  end
end

#sentinel_auth_keyObject



547
548
549
# File 'lib/brainzlab/configuration.rb', line 547

def sentinel_auth_key
  sentinel_api_key || secret_key
end

#sentinel_valid?Boolean

Returns:

  • (Boolean)


542
543
544
545
# File 'lib/brainzlab/configuration.rb', line 542

def sentinel_valid?
  key = sentinel_api_key || secret_key
  !key.nil? && !key.empty?
end

#signal_auth_keyObject



484
485
486
# File 'lib/brainzlab/configuration.rb', line 484

def signal_auth_key
  signal_ingest_key || signal_api_key || secret_key
end

#signal_effectively_enabled?Boolean

Check if signal is effectively enabled (considering self-tracking)

Returns:

  • (Boolean)


624
625
626
627
628
629
630
631
632
# File 'lib/brainzlab/configuration.rb', line 624

def signal_effectively_enabled?
  return false unless @enabled
  return false unless @signal_enabled
  return true unless @disable_self_tracking

  # Disable if this is the Signal service itself
  normalized_app_name = @app_name.to_s.downcase.strip
  normalized_app_name != 'signal'
end

#signal_valid?Boolean

Returns:

  • (Boolean)


479
480
481
482
# File 'lib/brainzlab/configuration.rb', line 479

def signal_valid?
  key = signal_ingest_key || signal_api_key || secret_key
  !key.nil? && !key.empty?
end

#synapse_auth_keyObject



556
557
558
# File 'lib/brainzlab/configuration.rb', line 556

def synapse_auth_key
  synapse_api_key || secret_key
end

#synapse_valid?Boolean

Returns:

  • (Boolean)


551
552
553
554
# File 'lib/brainzlab/configuration.rb', line 551

def synapse_valid?
  key = synapse_api_key || secret_key
  !key.nil? && !key.empty?
end

#valid?Boolean

Returns:

  • (Boolean)


444
445
446
# File 'lib/brainzlab/configuration.rb', line 444

def valid?
  @enabled && !@secret_key.nil? && !@secret_key.empty?
end

#vault_auth_keyObject



493
494
495
# File 'lib/brainzlab/configuration.rb', line 493

def vault_auth_key
  vault_api_key || secret_key
end

#vault_valid?Boolean

Returns:

  • (Boolean)


488
489
490
491
# File 'lib/brainzlab/configuration.rb', line 488

def vault_valid?
  key = vault_api_key || secret_key
  !key.nil? && !key.empty?
end

#vision_auth_keyObject



502
503
504
# File 'lib/brainzlab/configuration.rb', line 502

def vision_auth_key
  vision_ingest_key || vision_api_key || secret_key
end

#vision_valid?Boolean

Returns:

  • (Boolean)


497
498
499
500
# File 'lib/brainzlab/configuration.rb', line 497

def vision_valid?
  key = vision_ingest_key || vision_api_key || secret_key
  !key.nil? && !key.empty?
end