designcourse icon indicating copy to clipboard operation
designcourse copied to clipboard

Question: initialize version after the first init

Open michaelrodov opened this issue 2 years ago • 5 comments

Hi guys, here's a question I can't find my way around.

Let's say I initialize the datadog rum agent as soon as possible in my index.html, and at the time of initialization I don't have my application version number, which I fetch via REST call later.

Is there a way to add this version later on? after the agent was already initialized?

michaelrodov avatar May 24 '22 10:05 michaelrodov

Hello @michaelrodov,

Currently, there is no way to change the application number after the init.

However, we should soon release an API allowing you to provide service and version when starting a view:

datadogRum.startView({ service: 'foo', version: '1.0.0' })

Would this address your need?

bcaudan avatar May 24 '22 11:05 bcaudan

Thank you, Currently, if I provide the version in the init, its automatically applied to all "views" and everything else. Does it mean i'll need to manually send views if I want to add "version" later than "init"?

michaelrodov avatar May 24 '22 13:05 michaelrodov

Yes, exactly.

bcaudan avatar May 24 '22 15:05 bcaudan

yea, so that would be an overkill. I would just like to update the version later on. once.

michaelrodov avatar May 25 '22 06:05 michaelrodov

Hello @michaelrodov . What about initializing the RUM SDK as soon as you have retrieved the version?

BenoitZugmeyer avatar May 25 '22 16:05 BenoitZugmeyer