Skip to content
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

Fix getInitConfiguration() behaviour #1893

Merged
merged 4 commits into from
Jan 11, 2023

Conversation

piotr-oles
Copy link
Contributor

Motivation

Context: Synthetics Profiler doesn't tag profiles with correct service tag

I need DD_RUM.getInitConfiguration() to return init configuration even if it's inside synthetic test. Currently, when I call DD_RUM.getInitConfiguration() inside synthetic test, it returns undefined, because initRum() function is interrupted by:

    if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {
      return
    }

which prevents from this code to be executed:

    getInitConfigurationStrategy = () => deepClone<InitConfiguration>(initConfiguration)

This breaks profile tagging, as we can't infer service name (and because of that, we can't resolve source maps)

I think that getInitConfiguration() should return init configuration even if init process was not successful (as this function is not called getValidInitConfiguration() or getInitConfigurationIfInitWasSuccessful())

Changes

Update RUM and Logs API - getInitConfiguration() will return init configuration regardless of init process outcome.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@piotr-oles piotr-oles self-assigned this Dec 23, 2022
@piotr-oles piotr-oles requested a review from a team as a code owner December 23, 2022 13:06
Copy link
Contributor

@bcaudan bcaudan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@piotr-oles piotr-oles merged commit 1d92fa1 into main Jan 11, 2023
@piotr-oles piotr-oles deleted the piotr-oles/fix-get-init-configuration branch January 11, 2023 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants