browser-sdk
browser-sdk copied to clipboard
[RUM] Action duration in custom actions
Hello! Does DataDog's browser SDK support setting duration for a custom action? From documentation it's not clear if this is possible, also events updated in beforeSend
ignore duration
field in action
object. It would be super useful for us to have custom actions visuailized in DataDog as a time frame (similar to network requests and long tasks), instead of a singular dot on a timeline. For now we are sending duration as a part of action's context to have at least some data, which is suboptimal, since we can't see where an action started on a timeline.
Hello @roman01la ,
For now, it's not possible, and might not be easy to do because of the way we designed actions: we are associating other events (resources, long task, errors) to the current action, so a single action can occur at a time. So in practice, custom actions to have durations would conflict with existing click actions.
We'll keep your use-case in mind though. We'll keep you updated!
Hey @BenoitZugmeyer have you folks revisited this case? Would be great to have durations associated to actions 🙏 Specially for debugging and tracing :)
Hi @fforres,
It is still something that we have in mind but anything planned around that yet.
That's great to know @bcaudan 🙏
ATM, Is there any alternative to add something with a custom duration? (With maybe addTiming
, something else?)
Heyo folks, reviving this old thread.
Noticed that on some of our traces, some actions showed up with a "length". Particularly actions like "Button clicked" that trigger an event, now have a duration. (As opposed to our manually tracked actions)
See:
That action is being automatically tracked (we haven't added it as part of our rum.addAction
call) . Once I look into the json attributes of it, I noticed that it has a "loading time" field.
Is there any way our custom added actions can leverage the same?
friendly ping on the above @bcaudan @BenoitZugmeyer 🙏
Hello! We don't support custom actions with duration yet. We still want to make it happen, and we already made a step in the good direction now that actions can overlap each other. But it's not there yet and we are working on other priorities.
Hello guys, as it did not get any updates and being quite new to this, is there now any way I can transmit my own built timings to rum, through custom actions or timings. Thanks for your answer 🙏
EDIT: passing a duration
value as additional context of an action and creating a "measure" from it allows me to compute stats on it.
I was also trying to figure out how to do this today and filed a support ticket with DataDog. The solutions engineer helpfully recommended the same process as you suggested @Yooooomi, which I'll quote here in case it's useful for others as well:
I do not think there is any specific mechanism to track the performance of custom code on the real user side (if it's a separate resource). I think, in case you are interested in the performance of one particular code block, you can use context to transfer those values to Datadog.
For example,
- Calculate timings with custom code (JS for example);
- Set up those values in a global context (an example is here) or create an event with that context (context object).
- Create a RUM metric from that Event context (link here)
The above seems like a reasonable workaround, but it would still be neat to see this supported natively someday!
👋 We're pleased to announce we've shipped a new kind of RUM events for this use case. Starting with v5.25.0, you can use the DD_RUM.startDurationVital
or DD_RUM.addDurationVital
APIs to report "Vital" events with durations to Datadog. See documentation.
Please note that the UI for this feature will be rolled out progerssively during the week.
Any feedback is welcome!