-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⚗️[RUM-4780] Remote configuration #2799
Conversation
@@ -452,6 +502,22 @@ describe('preStartRum', () => { | |||
|
|||
expect(strategy.initConfiguration).toEqual(initConfiguration) | |||
}) | |||
|
|||
it('returns the initConfiguration with the remote configuration when a remoteConfigurationId is provided', (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this behaviour. Basically DD_RUM.getInitConfiguration()
will also have the remote configuration values. It has the advantage to make the browser extension reflect the remote config without any change.
Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 thought: Currently DD_RUM.getInitConfiguration()
returns exactly what the customer called init()
with. I wouldn't mind it to return what the SDK was actually initialised with, this means the combination of what the customer called init()
with, the remote config if applicable and the defaults.
I think it would be useful information to debug rum, both for customers, for us through telemetry and even for support.
I'm not sure if it is safe to do that or if this will be a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could review our usages of getInitConfiguration
https://github.com/search?q=repo%3ADataDog%2Fsynthetics-worker%20getInitConfiguration&type=code
To me it doesn't matter much, but we'll maybe need a onInitConfigurationReady(cb)
API in the future if we have use-cases where we need to access the resolved config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I identifyed in Datadog repos, we use the API for
- Browser SDK extension: to display the conf
- synthetics-worker: Use it to get the
applicationId
- rum-react-integration-examples (old not maintained repo) uses it to get
trackViewsManually
- dd-profile-browser: it is used to collected profiles with
service
,env
, andversion
tags
Clearly if we get one of fields applicationId, service, env or version, from the RC we will have some issues. But luckily for now they won't be available in RC :). So the question is, should we anticipate by introducing a new API right away and defining the getInitConfiguration()
has only returning whats passed to the init()
API
I'll create an RFC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seen with @BenoitZugmeyer, since the feature is under FF, lets keep the behaviour as is and revisite later when needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect! Sounds good!
import { display, addEventListener, assign } from '@datadog/browser-core' | ||
import type { RumInitConfiguration } from './configuration' | ||
|
||
export const REMOTE_CONFIGURATION_URL = 'https://www.datad0g-browser-agent.com/configuration' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For testing purposes, I hosted the RC in the same CDN as the bundles but it will change once the Remote config provides their CDN
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
@@ -452,6 +502,22 @@ describe('preStartRum', () => { | |||
|
|||
expect(strategy.initConfiguration).toEqual(initConfiguration) | |||
}) | |||
|
|||
it('returns the initConfiguration with the remote configuration when a remoteConfigurationId is provided', (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 thought: Currently DD_RUM.getInitConfiguration()
returns exactly what the customer called init()
with. I wouldn't mind it to return what the SDK was actually initialised with, this means the combination of what the customer called init()
with, the remote config if applicable and the defaults.
I think it would be useful information to debug rum, both for customers, for us through telemetry and even for support.
I'm not sure if it is safe to do that or if this will be a breaking change.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2799 +/- ##
==========================================
+ Coverage 93.65% 93.66% +0.01%
==========================================
Files 243 244 +1
Lines 7140 7168 +28
Branches 1599 1603 +4
==========================================
+ Hits 6687 6714 +27
- Misses 453 454 +1 ☔ View full report in Codecov by Sentry. |
/to-staging |
🚂 Branch Integration: starting soon, median merge time is 10m Commit 10bc671246 will soon be integrated into staging-24. Use |
Integrated commit sha: 10bc671 Co-authored-by: Aymeric Mortemousque <[email protected]>
🚂 Branch Integration: This commit was successfully integrated Commit 10bc671246 has been merged into staging-24 in merge commit 4e239e6834. Check out the triggered pipeline on Gitlab 🦊 |
@@ -452,6 +502,22 @@ describe('preStartRum', () => { | |||
|
|||
expect(strategy.initConfiguration).toEqual(initConfiguration) | |||
}) | |||
|
|||
it('returns the initConfiguration with the remote configuration when a remoteConfigurationId is provided', (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could review our usages of getInitConfiguration
https://github.com/search?q=repo%3ADataDog%2Fsynthetics-worker%20getInitConfiguration&type=code
To me it doesn't matter much, but we'll maybe need a onInitConfigurationReady(cb)
API in the future if we have use-cases where we need to access the resolved config.
Motivation
Add remote configuration capability
Changes
remoteConfigurationId
How to test
Testing
I have gone over the contributing documentation.