designcourse icon indicating copy to clipboard operation
designcourse copied to clipboard

stack trace/source mapping for custom action

Open b3nb5n opened this issue 10 months ago • 7 comments

Hey! I just got sourcemapping set up for my RUM app and its working great for errors. Is there a way to do the same thing for custom actions? i.e have an unminified stack trace visible in the datadog console for actions tracked via datadogRum.addAction

b3nb5n avatar Apr 11 '24 20:04 b3nb5n

Hello 👋

Unfortunately, only errors collected by RUM and logs of level error collected by browser-logs can be unminified using source maps.

Check more on the official documentation.

N-Boutaib avatar Apr 12 '24 12:04 N-Boutaib

thank you for confirming, are there any workarounds i could try using custom attributes or something similar? If not whats the recommended way of dealing with events with the same name across many different files/locations?

b3nb5n avatar Apr 15 '24 18:04 b3nb5n

Hello @b3nb5n, Could you clarify what you're trying to acheive? Basically:

  • if you want to manually collect errors with unminified stack trace you can use addError
  • for collecting your own view performance timings, you can use the addTiming
  • otherwise you can use addAction

amortemousque avatar Apr 17 '24 07:04 amortemousque

yeah. basically we're using addAction all over our app to log custom actions, and I'm trying to get a consistent way of finding the exact call site in the source based on the information available on the event in the web console. The problem is that some of our events have names that are used in many different places throughout the app, so running a global search on the codebase shows multiple results. Our current solution is to just include the file name and line number in the event name, but thats too easy to mess up during refactoring or forget all together. Is there an easier/better way to uniquely identify were the actions are actually coming from?

b3nb5n avatar Apr 17 '24 17:04 b3nb5n

Hello @b3nb5n , To identify where the actions are actually coming from, you can filter them using view.name. Otherwise, if this does not work for you, could you clarify a specific step-by-step use case where the view.name does not lead to the correct location? Plus don't hesitate to contact our Support Team for configuration helps.

cy-moi avatar Apr 22 '24 14:04 cy-moi

Hi, if there are multiple events in the same view with the same name it could still be ambiguous where the event came from.

b3nb5n avatar Apr 23 '24 22:04 b3nb5n

Hi,

Regarding this:

it could still be ambiguous where the event came from

Could you give us an example (a code piece or implementation steps) of using addAction() which lead to this? Maybe we can offer more help from there.

cy-moi avatar Apr 24 '24 15:04 cy-moi