Skip to content

Commit

Permalink
ar serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Oct 28, 2024
1 parent ca1eb13 commit 52d6a1d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/datadog/di/serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ def serialize_vars(vars)
end
end

def type_serialized_entry(cls, serialized)
{type: class_name(cls)}.update(serialized)
end

# Serializes a single named value.
#
# The name is needed to perform sensitive data redaction.
Expand Down Expand Up @@ -118,7 +114,7 @@ def serialize_value(value, name: nil, depth: settings.dynamic_instrumentation.ma
end
end

serialized = {}
serialized = {type: class_name(cls)}
case value
when NilClass
serialized.update(isNull: true)
Expand Down Expand Up @@ -218,9 +214,11 @@ def serialize_value(value, name: nil, depth: settings.dynamic_instrumentation.ma
serialized.update(fields: fields)
end
end
type_serialized_entry(cls, serialized)
serialized
end

private

# Returns the name for the specified class object.
#
# Ruby can have nameless classes, e.g. Class.new is a class object
Expand Down

0 comments on commit 52d6a1d

Please sign in to comment.