Module: Datadog::SymbolDatabase Private

Defined in:
lib/datadog/symbol_database.rb,
lib/datadog/symbol_database/scope.rb,
lib/datadog/symbol_database/logger.rb,
lib/datadog/symbol_database/remote.rb,
lib/datadog/symbol_database/symbol.rb,
lib/datadog/symbol_database/uploader.rb,
lib/datadog/symbol_database/component.rb,
lib/datadog/symbol_database/extractor.rb,
lib/datadog/symbol_database/file_hash.rb,
lib/datadog/symbol_database/transport.rb,
lib/datadog/symbol_database/extensions.rb,
lib/datadog/symbol_database/configuration.rb,
lib/datadog/symbol_database/scope_batcher.rb,
lib/datadog/symbol_database/transport/http.rb,
lib/datadog/symbol_database/service_version.rb,
lib/datadog/symbol_database/transport/http/endpoint.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.

Namespace for Datadog symbol database upload.

Defined Under Namespace

Modules: Configuration, Extensions, FileHash, Remote, Transport Classes: Component, Extractor, Logger, Scope, ScopeBatcher, ServiceVersion, Symbol, Uploader

Constant Summary collapse

UNKNOWN_MIN_LINE =

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.

Sentinel value for unknown or unavailable minimum line number.

Used for:

  1. start_line when exact line cannot be determined (e.g., modules without methods)
  2. Symbol line numbers for FIELD, STATIC_FIELD, ARG symbols to indicate the symbol is available throughout the entire enclosing scope

Backend behavior: line=0 means symbol completes in every line of the scope

Reference: Symbol Database Backend RFC, section "Edge Cases"

  • "We use 0 for FIELD, STATIC_FIELD and ARG. It means that the symbol will be completed in every line of the enclosing scope (CLASS or METHOD)."
0
UNKNOWN_MAX_LINE =

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.

Sentinel value for unknown or unavailable maximum line number.

Used for:

  1. end_line when exact boundaries cannot be determined (e.g., modules, classes without methods, fallback when introspection fails)
  2. LOCAL symbol line numbers when exact line is unknown (future feature)

Value: 2147483647 (PostgreSQL signed INT_MAX, 2^31 - 1)

Backend behavior:

  • For scopes: indicates "entire file" or "unknown end"
  • For LOCAL symbols (future): included in method probe completions but excluded from line probe completions

Protocol specification:

  • "If the symbols of the scope should be available to all lines in the source_file of the scope, use start_line = 0 and end_line = 2147483647 (maximum signed integer, postgres int max)."
  • "For LOCAL symbols, we use 2147483647 (signed int max) to avoid completing the symbol for line probes, but keep it in the method for method probe completions."

Reference: Symbol Database Backend RFC, section "Scope" and "Edge Cases"

2147483647

Class Method Summary collapse

Class Method Details

.resolve_enabled(setting_value, di_fallback) ⇒ Boolean

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.

Collapses the symbol_database.enabled tri-state setting to a boolean. An explicit true/false wins; nil (unconfigured) yields the caller-supplied fallback.

Parameters:

  • setting_value (Boolean, nil)

    the symbol_database.enabled setting

  • di_fallback (Boolean)

    value used when the setting is unconfigured

Returns:

  • (Boolean)


57
58
59
# File 'lib/datadog/symbol_database.rb', line 57

def self.resolve_enabled(setting_value, di_fallback)
  setting_value.nil? ? di_fallback : setting_value
end

.supported_runtime?Boolean

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.

Whether the current Ruby runtime can run symbol database extraction: MRI (CRuby) on Ruby 2.7 or later. Used by the remote-config layer to avoid advertising the product on runtimes where Component.build would return nil (e.g. Ruby 2.6, which Dynamic Instrumentation supports but Symbol Database does not).

Returns:

  • (Boolean)


67
68
69
# File 'lib/datadog/symbol_database.rb', line 67

def self.supported_runtime?
  RUBY_ENGINE == "ruby" && RubyVersion.is?(">= 2.7")
end