Whether you are just starting your observability journey or already are an expert, our courses will help advance your knowledge and practical skills.
Expert insight, best practices and information on everything related to Observability issues, trends and solutions.
Explore our guides on a broad range of observability related topics.
Enable event access and modification before sending data to Coralogix using beforeSend
. This feature allows you to modify content or discard events as needed.
The beforeSend
callback method can be configured to filter error events just before they are sent to the server. This method provides a final opportunity to decide whether to send or modify the data. The beforeSend
function receives the event object as a parameter, allowing you to use custom logic to either alter the event’s data or discard it entirely by returning null.
Here is an example demonstrating how to use beforeSend
:
CoralogixRum.init({ // ... beforeSend: (event) => { // Discard events from @company.com users. if (event.session_context.user_email?.endsWith('@company.com')) { return null; } // Redact sensitive information from the page URL. event.page_context.page_url = event.page_context.page_url.replace( 'sensitive-info', 'redacted' ); return event; }, });
Notes:
return event
. null
.Need help?
Our world-class customer success team is available 24/7 to assist you with your setup and answer any questions you may have.
Feel free to reach out to us via our in-app chat or by emailing support@coralogix.com.