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

🐛[RUMF-990] restore global check to detect synthetics sessions #997

Merged
merged 1 commit into from
Aug 13, 2021

Conversation

bcaudan
Copy link
Contributor

@bcaudan bcaudan commented Aug 12, 2021

Motivation

User agent used by synthetics can be overwritten by the customer. So user agent check is not enough.

Changes

Restore check on global.
Previous PR:
#969

Testing

unit


I have gone over the contributing documentation.

@bcaudan bcaudan requested a review from a team as a code owner August 12, 2021 13:46
@@ -88,7 +90,8 @@ export function startRumAssembly(
date: timeStampNow(),
service: configuration.service,
session: {
type: sessionType,
// must be computed on each event because synthetics instrumentation can be done after sdk execution
Copy link
Contributor

Choose a reason for hiding this comment

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

Does that mean that if the first events happen before the synthetics instrumentation, they will be sent with the wrong session type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it was the previous behavior

Copy link
Contributor

Choose a reason for hiding this comment

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

We currently have a RFC that tries to relate RUM events to Synthetics tests, I think some solutions from that RFC could be used for this use case too. In particular, I like the idea of using a Set-Cookie header to pass data from Synthetics to the SDK. So we could set the session type based on the presence of a cookie.
Do you think it worth exploring that solution? may be as a follow-up to this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already discussed this topic during our daily yesterday, the solution describe in the RFC could indeed make the synthetics sessions detection more reliable. However, since this solution is not yet available, the goal of this PR is to fix the issue introduced with the previous change.

@bcaudan bcaudan merged commit 96b9b57 into main Aug 13, 2021
@bcaudan bcaudan deleted the bcaudan/restore-synthetics-global branch August 13, 2021 08:19
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