class NewRelic::Agent::ServerlessHandlerEventSources

ServerlessHandlerEventSources - New Relic’s language agent devs maintain a cross-agent JSON map of all AWS resources with the potential to invoke an AWS Lambda function by issuing it an event. This map is used to glean source specific attributes while instrumenting the function’s invocation.

Given that the event arrives as a Ruby hash argument to the AWS Lambda function, the JSON map’s values need to be converted into arrays that can be passed to ‘Hash#dig`. So a value such as `’records.name’‘ needs to be converted to `[’records’, 0, ‘name’]‘. This class’s ‘.to_hash` method yields the converted data.

Furthermore, ‘.length` calls are converted to Ruby `#size` notation to denote that a method call must be performed on the dug value.