Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Nov 21, 2024
1 parent f24e240 commit 31a11b4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/datadog/di/serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ def serialize_vars(vars,
# Respects string length, collection size and traversal depth limits.
def serialize_value(value, name: nil,
depth: settings.dynamic_instrumentation.max_capture_depth,
attribute_count: settings.dynamic_instrumentation.max_capture_attribute_count,
attribute_count: nil,
type: nil)
attribute_count ||= settings.dynamic_instrumentation.max_capture_attribute_count
cls = type || value.class
begin
if redactor.redact_type?(value)
Expand Down
6 changes: 5 additions & 1 deletion sig/datadog/di/probe.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Datadog
@rate_limiter: Datadog::Core::RateLimiter

def initialize: (id: String, type: Symbol, ?file: String?, ?line_no: Integer?, ?type_name: String?, ?method_name: String?, ?template: String?, ?capture_snapshot: bool,
?max_capture_depth: Integer, ?rate_limit: Integer) -> void
?max_capture_depth: Integer, ?max_capture_attribute_count: Integer?, ?rate_limit: Integer) -> void

attr_reader id: String

Expand All @@ -35,6 +35,10 @@ module Datadog
attr_reader type_name: String?

attr_reader method_name: String?

attr_reader max_capture_depth: Integer?

attr_reader max_capture_attribute_count: Integer?

attr_reader template: String
attr_reader rate_limiter: Datadog::Core::RateLimiter
Expand Down
8 changes: 4 additions & 4 deletions sig/datadog/di/serializer.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ module Datadog

attr_reader telemetry: Core::Telemetry::Component

def serialize_args: (untyped args, untyped kwargs) -> untyped
def serialize_vars: (untyped vars) -> untyped
def serialize_value: (untyped value, ?name: String, ?depth: Integer) -> untyped
def serialize_args: (untyped args, untyped kwargs, ?depth: Integer, ?attribute_count: Integer?) -> untyped
def serialize_vars: (untyped vars, ?depth: Integer, ?attribute_count: Integer?) -> untyped
def serialize_value: (untyped value, ?name: String, ?depth: Integer, ?attribute_count: Integer?) -> untyped

def self.register: (?condition: Proc) {
(serializer: Serializer, value: untyped, name: Symbol, depth: Integer) -> untyped } -> void
(serializer: Serializer, value: untyped, name: Symbol, depth: Integer, ?attribute_count: Integer?) -> untyped } -> void

private
def class_name: (untyped cls) -> untyped
Expand Down

0 comments on commit 31a11b4

Please sign in to comment.