Skip to content

Commit

Permalink
Use better naming for helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoCaso committed Jun 5, 2023
1 parent 2034a37 commit deb8eb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/datadog/appsec/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ def self.record_via_span(span, *events)
)

# prepare and gather tags to apply
trace_root_tags = build_root_trace_tags(event_group)
trace_root_tags = build_service_entry_tags(event_group)
# complex types are unsupported, we need to serialize to a string
triggers = trace_root_tags.delete('_dd.appsec.triggers')
span.set_tag('_dd.appsec.json', JSON.dump({ triggers: triggers }))

# apply tags to root span
# apply tags to service entry span
trace_root_tags.each do |key, value|
span.set_tag(key, value)
end
end
end

def self.build_root_trace_tags(event_group)
def self.build_service_entry_tags(event_group)
event_group.each_with_object({}) do |event, tags|
# TODO: assume HTTP request context for now

Expand Down

0 comments on commit deb8eb8

Please sign in to comment.