You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: improved filtering function API (elastic#579)
Changes the `agent.addFilter()` function to be called once per event
instead of with an array of events.
Besides the existing filtering function, three new custom filtering
functions have been added:
- `agent.addErrorFilter()`
- `agent.addTransactionFilter()`
- `agent.addSpanFilter()`
BREAKING CHANGE: The `agent.addFilter()` API have changed.
@@ -714,6 +708,39 @@ See <<filter-http-headers,`filterHttpHeaders`>> for details.
714
708
Though you can also use filter functions to add new contextual information to the `user` and `custom` properties,
715
709
it's recommended that you use <<apm-set-user-context,`apm.setUserContext()`>> and <<apm-set-custom-context,`apm.setCustomContext()`>> for that purpose.
716
710
711
+
[[apm-add-error-filter]]
712
+
==== `apm.addErrorFilter()`
713
+
714
+
[source,js]
715
+
----
716
+
apm.addErrorFilter(callback)
717
+
----
718
+
719
+
Similar to <<apm-add-filter,`apm.addFilter()`>>,
720
+
but the `callback` will only be called with error payloads.
721
+
722
+
[[apm-add-transaction-filter]]
723
+
==== `apm.addTransactionFilter()`
724
+
725
+
[source,js]
726
+
----
727
+
apm.addTransactionFilter(callback)
728
+
----
729
+
730
+
Similar to <<apm-add-filter,`apm.addFilter()`>>,
731
+
but the `callback` will only be called with transaction payloads.
732
+
733
+
[[apm-add-span-filter]]
734
+
==== `apm.addSpanFilter()`
735
+
736
+
[source,js]
737
+
----
738
+
apm.addSpanFilter(callback)
739
+
----
740
+
741
+
Similar to <<apm-add-filter,`apm.addFilter()`>>,
742
+
but the `callback` will only be called with span payloads.
0 commit comments