Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to modify payload within block
When instrumenting a block of code, it is sometimes useful for that block to add more things to the payload. A common example is when performing an http request, it is useful to include the response status code in the instrumentation. ``` instrument("example.request", url: url, body: body) do |payload| response = http.post(url, params: body) payload[:response] = response end ``` This change simply yields the payload to the block to enable this. NOTE: If the instrument method is called with no overriding payload, the payload yielded to the block is the default EMPTY_HASH that is frozen, which results in a FrozenError if the block attempts to add anything to the hash.
- Loading branch information