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

feat: datadog integration to client side using datadog/browser-rum lib #1896

Merged
merged 17 commits into from
Aug 4, 2022

Conversation

thanhdatle
Copy link
Contributor

@thanhdatle thanhdatle commented Jul 25, 2022

Problem

datadog integration to client side

Solution

using datadog/browser-rum lib

@thanhdatle thanhdatle changed the title feat: updated Docker and CI for Datadog integration feat: datadog integration to client side using datadog/browser-rum lib Jul 25, 2022
Copy link
Member

@yong-jie yong-jie left a comment

Choose a reason for hiding this comment

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

I understand that this is probably still a WIP, but just leaving some initial comments that you could address along the way. Thanks for the work done so far!

src/server/index.ts Outdated Show resolved Hide resolved
webpack.config.ts Outdated Show resolved Hide resolved
webpack.config.ts Outdated Show resolved Hide resolved
src/shared/util/environment-variables.ts Outdated Show resolved Hide resolved
Comment on lines +192 to +197
- run: |
if [[ $GITHUB_REF == $STAGING_BRANCH ]]; then
echo SERVERLESS_STAGE=staging >> $GITHUB_ENV;
elif [[ $GITHUB_REF == $PRODUCTION_BRANCH ]]; then
echo SERVERLESS_STAGE=production >> $GITHUB_ENV;
fi
Copy link
Member

Choose a reason for hiding this comment

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

It looks like these file-changes were meant to fix a serverless deployment bug, and is out of scope of this PR.

As discussed in our agreement with squash-merging, doing multiple things within a PR can be dangerous with squash-merging, because fine-grained code changes can no longer be rolled back independently. Hypothetically if we needed to roll back the serverless fixes for further work, we would need to roll back your datadog integration code too (vice versa).

As such, could i trouble you to move these changes to a separate PR? thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did this because I need the SERVERLESS_STAGE in the docker build command as a build argument.

Copy link
Member

@yong-jie yong-jie Aug 2, 2022

Choose a reason for hiding this comment

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

makes sense. just a heads up, i'm seeing another PR that will remove the SERVERLESS_STAGE env variable in favor of BRANCH_ENV, which might be an incoming merge conflict.

.eslintrc.json Outdated
Comment on lines 2 to 5
"globals": {
"DD_SERVICE": true,
"DD_ENV": true
},
Copy link
Member

Choose a reason for hiding this comment

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

This declaration could be misleading (to both engineers, and ESLINT), because these variables only exist in the frontend, and aren't truly global

Relating to a previous comment, if DD_ENV and DD_SERVICE were injected into process.env instead of globally, we would not need to introduce global variables (bad coding practice) into our ESLINT config to begin with.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will take this discussion offline

Copy link
Member

Choose a reason for hiding this comment

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

TODO: figure a way to declare these variables only in the frontend client directory. Strangely, there is already a helper.d.ts file that declares these two variables as strings.

Comment on lines 1 to 2
declare let DD_SERVICE: string
declare let DD_ENV: string
Copy link
Member

Choose a reason for hiding this comment

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

Related to previous comments as well. This won't be necessary if we use process.env.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be taken offline as well

Copy link
Member

Choose a reason for hiding this comment

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

updates: worth trying to get this to work by itself without the help of the eslintrc config file. maybe this declaration file needs to be directly imported or something? 🤔

Copy link
Member

@yong-jie yong-jie left a comment

Choose a reason for hiding this comment

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

lgtm!

@yong-jie yong-jie merged commit 6db6bdd into develop Aug 4, 2022
@yong-jie yong-jie deleted the feature/datadog-client-integration branch August 4, 2022 05:47
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.

2 participants