Module: Datadog::SymbolDatabase::Remote Private

Defined in:
lib/datadog/symbol_database/remote.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Provides remote configuration integration for symbol database.

Responsibilities:

  • Registers with Core::Remote as a receiver for LIVE_DEBUGGING_SYMBOL_DB product
  • Processes remote config changes (insert/update/delete)
  • Calls Component.start_upload when upload_symbols: true
  • Calls Component.stop_upload when config deleted or upload_symbols: false

Flow:

  1. Remote config system calls receiver with repository and changes
  2. For each change, process_change called
  3. parse_config extracts upload_symbols flag
  4. enable_upload or disable_upload called on component

Created by: Symbol database initialization Accessed by: Core::Remote system when configurations change Requires: Component must exist (accessed via Datadog.send(:components).symbol_database)

Constant Summary collapse

PRODUCT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

"LIVE_DEBUGGING_SYMBOL_DB"

Class Method Summary collapse

Class Method Details

.capabilitiesArray

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.

Declare capabilities for this receiver.

Returns:

  • (Array)

    Capabilities (none for symbol database)



38
39
40
# File 'lib/datadog/symbol_database/remote.rb', line 38

def capabilities
  []
end

.deferred_products(settings) ⇒ Object

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.

Symbol Database follows DI when its enabled setting is nil — the default, or an explicit c.symbol_database.enabled = nil. In that follow-DI case the product is deferred and added/removed alongside DI so it is never advertised while DI is inactive. An explicit true/false is independent and manages its own product at startup.



47
48
49
50
51
52
53
54
55
# File 'lib/datadog/symbol_database/remote.rb', line 47

def deferred_products(settings)
  if settings.respond_to?(:symbol_database) &&
      settings.symbol_database.enabled.nil? &&
      Datadog::SymbolDatabase.supported_runtime?
    [PRODUCT]
  else
    []
  end
end

.productsArray<String>

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.

Declare products this receiver handles.

Returns:

  • (Array<String>)

    Product names



32
33
34
# File 'lib/datadog/symbol_database/remote.rb', line 32

def products
  [PRODUCT]
end

.receiver(products = [PRODUCT], &block) ⇒ Array<Receiver>

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.

Create a single receiver for the product.

Parameters:

  • products (Array<String>) (defaults to: [PRODUCT])

    Product names to match

Returns:

  • (Array<Receiver>)

    Receiver array



82
83
84
85
# File 'lib/datadog/symbol_database/remote.rb', line 82

def receiver(products = [PRODUCT], &block)
  matcher = Core::Remote::Dispatcher::Matcher::Product.new(products)
  [Core::Remote::Dispatcher::Receiver.new(matcher, &block)]
end

.receivers(_telemetry) ⇒ Array<Receiver>

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.

Create receivers for remote configuration.

Returns:

  • (Array<Receiver>)

    Array of receivers



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/datadog/symbol_database/remote.rb', line 59

def receivers(_telemetry)
  receiver do |repository, changes|
    telemetry = lookup_telemetry
    component = begin
      Datadog.send(:components, allow_initialization: false)&.symbol_database
    rescue Exception => e # standard:disable Lint/RescueException
      Datadog::DI.reraise_if_fatal(e)
      Datadog.logger.debug { "symdb: failed to look up component in RC receiver: #{e.class}: #{e.message}" }
      telemetry&.report(e, description: "symdb: failed to look up component in RC receiver")
      nil
    end

    if component
      changes.each do |change|
        process_change(component, change, telemetry)
      end
    end
  end
end