Octri

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 nullrequired

Takes 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

LanguageCall
NodesetBeforeSend()
Pythonoctri.set_before_send()
Gooctri.SetBeforeSend()
RubyOctri.set_before_send
JavaOctri.setBeforeSend()
KotlinOctri.setBeforeSend()
PHPOctri::setBeforeSend()
Rustoctri_monitoring::set_before_send()
SwiftOctri.setBeforeSend()
DartOctri.setBeforeSend()