-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We've received requests in the past to merge sample data. Our API was inconsistent in merging some sample data like tags, but not others (params, headers, session data and custom data). Support merging sample data for all sample data. All helpers now are called `add_<data type>`. I've added aliases for the `set_<data type>` methods. This merging behavior is the new default, which is a breaking change. I've added a SampleData helper class to handle the sample data being merged. Array and Hashes are supported, same as in our extension. Other types are not supported. If the root value type switches between a Hash and Array between values being merged, the new value is leading, discarding the previous value. I've kept the behavior that if an application sets custom params/headers/session data/custom data, we do not set it from our integrations. This would merge it with the custom set data from the app, which I don't know if we want to do that.
- Loading branch information
Showing
25 changed files
with
834 additions
and
570 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
bump: major | ||
type: change | ||
--- | ||
|
||
The transaction sample data is now merged by default. Previously, the sample data (except for tags) would be overwritten when an `Appsignal.set_*` helper was called. | ||
|
||
```ruby | ||
# Old behavior | ||
Appsignal.set_params("param1" => "value") | ||
Appsignal.set_params("param2" => "value") | ||
# The parameters are: | ||
# { "param2" => "value" } | ||
|
||
|
||
# New behavior | ||
Appsignal.add_params("param1" => "value") | ||
Appsignal.add_params("param2" => "value") | ||
# The parameters are: | ||
# { "param1" => "value", "param2" => "value" } | ||
``` | ||
|
||
New helpers have been added: | ||
|
||
- `Appsignal.add_tags` | ||
- `Appsignal.add_params` | ||
- `Appsignal.add_session_data` | ||
- `Appsignal.add_headers` | ||
- `Appsignal.add_custom_data` | ||
|
||
The old named helpers that start with `set_` will still work. They will also use the new merging behavior. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.