setBeforeSend
Runs your function on every event just before it's sent. Edit the event, or drop it. Redaction still runs afterwards, so a hook can't leak a credential by accident.
Parameters
hookfunction or nullrequiredTakes the event and returns it to send it, edited or not, or null to drop it. Pass null to remove the hook.
Example
Node
import { setBeforeSend } from "@octri/node";
setBeforeSend((event) => (event.path === "/health" ? null : event));In each language
| Language | Call |
|---|---|
| Node | setBeforeSend() |
| Python | octri.set_before_send() |
| Go | octri.SetBeforeSend() |
| Ruby | Octri.set_before_send |
| Java | Octri.setBeforeSend() |
| Kotlin | Octri.setBeforeSend() |
| PHP | Octri::setBeforeSend() |
| Rust | octri_monitoring::set_before_send() |
| Swift | Octri.setBeforeSend() |
| Dart | Octri.setBeforeSend() |
Related
- Other functions:
init,captureError,captureEvent,captureSpan,traceFromHeader,addScrubFields,startSpan,withSpan,instrument,autoInstrument. - Backend SDKs: installing a runtime and its framework integrations.