question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing Sentry.setDataCallback

See original GitHub issue

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

4.0.2

Description

The previous version raven-js had the ability to add setDataCallback which was executed before data was sent out. Current version @sentry/browser enables beforeSend but it can be only set as part of the init process.

Could you please add an ability to set beforeSend callback also in a later stage? I am trying to fix my redux integration previously done using https://github.com/captbaritone/raven-for-redux/blob/master/index.js

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
HazATcommented, Sep 20, 2018

Hey, you should be able to use an event processor.

So in any point in time you can do:

Sentry.configureScope(scope => {
  scope.addEventProcessor(async event => {
    // Add anything to the event here
    // returning null will not send the event
    return event;
  });
});

Hope this helps.

0reactions
kamilogorekcommented, Jul 26, 2019

@cyounkins both are correct, but beforeSend can be set just once during initialization, where eventProcessors can be added anytime and they can also work for only specific events (scope) if desired. https://docs.sentry.io/platforms/node/#eventprocessors (JS docs are being reworked now, thus some parts may be missing, sorry about that)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Errors to Understand our Users (Episode 2) - Sentry
Error tracking that helps developers monitor and fix crashes in real time. Iterate continuously. Boost workflow efficiency. Improve user experience.
Read more >
raven-js | Yarn - Package Manager
3.23.0. NOTE: This release may introduce some new, previously uncaught errors that were silently occuring in the background. Your Sentry Issues stream may...
Read more >
How to use the raven-js.isSetup function in raven-js - Snyk
To help you get started, we've selected a few raven-js.isSetup examples, based on popular ways it is used in public projects.
Read more >
Sentry - LogRocket Docs
Integrating LogRocket with Sentry. ... Add a LogRocket session recording URL to every Sentry exception report. ... setDataCallback(data => { data.extra.
Read more >
Overview - Joe Sandbox
... processes where analyzed, report is missing behavior information ... this.k.release=t,this},setDataCallback:function(t){var e=this.k.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found