Skip to content

Commit

Permalink
DEBUG-2334 add types for dynamic instrumentation settings (#3924)
Browse files Browse the repository at this point in the history
Co-authored-by: Oleg Pudeyev <code@olegp.name>
  • Loading branch information
p-datadog and p authored Sep 19, 2024
1 parent 6de9cbb commit e97a23c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/datadog/di/redactor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,13 @@ def redacted_type_names_regexp
if name.start_with?("::")
# :: prefix is redundant, all names are expected to be
# fully-qualified.
name = name[2...name.length]
#
# Defaulting to empty string is for steep.
name = name[2...name.length] || ""
end
if name.end_with?("*")
name = name[0..-2]
# Defaulting to empty string is for steep.
name = name[0..-2] || ""
suffix = ".*"
else
suffix = ""
Expand Down
40 changes: 40 additions & 0 deletions sig/datadog/core/configuration/settings.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,44 @@ module Datadog
def templates: () -> _TemplatesBlock
end

interface _DI
def enabled: () -> bool

def enabled=: (bool) -> void

def untargeted_trace_points: () -> bool

def untargeted_trace_points=: (bool) -> void

def propagate_all_exceptions: () -> bool

def propagate_all_exceptions=: (bool) -> void

def redacted_identifiers: () -> Array[String]

def redacted_identifiers=: (Array[String]) -> void

def redacted_type_names: () -> Array[String]

def redacted_type_names=: (Array[String]) -> void

def max_capture_depth: () -> Integer

def max_capture_depth=: (Integer) -> void

def max_capture_collection_size: () -> Integer

def max_capture_collection_size=: (Integer) -> void

def max_capture_string_length: () -> Integer

def max_capture_string_length=: (Integer) -> void

def max_capture_attribute_count: () -> Integer

def max_capture_attribute_count=: (Integer) -> void
end

interface _TemplatesBlock
def html=: (::String) -> void

Expand Down Expand Up @@ -84,6 +122,8 @@ module Datadog

def appsec: (?untyped? options) -> Datadog::Core::Configuration::Settings::_AppSec

def dynamic_instrumentation: (?untyped? options) -> Datadog::Core::Configuration::Settings::_DI

def remote: (?untyped? options) -> Datadog::Core::Configuration::Settings::_Remote
end
end
Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/di/redactor.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Datadog

def initialize: (untyped settings) -> void

attr_reader settings: untyped
attr_reader settings: Datadog::Core::Configuration::Settings

def redact_identifier?: (String name) -> (true | false)

Expand Down
2 changes: 1 addition & 1 deletion sig/datadog/di/serializer.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Datadog

def initialize: (untyped settings, untyped redactor) -> void

attr_reader settings: untyped
attr_reader settings: Datadog::Core::Configuration::Settings

attr_reader redactor: untyped
def serialize_args: (untyped args, untyped kwargs) -> untyped
Expand Down

0 comments on commit e97a23c

Please sign in to comment.