This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
web: initial Datadog RUM integration #34063
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
valerybugakov
added
frontend-platform
Issues related to our frontend platform, owned collectively by our frontend crew.
observability
labels
Apr 19, 2022
} | ||
|
||
/** | ||
* Datadog is initialized only if: |
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.
loving these comments!
valerybugakov
requested review from
umpox,
lrhacker,
daxmc99,
filiphaftek,
a team and
jasongornall
April 21, 2022 07:51
eseliger
approved these changes
Apr 21, 2022
umpox
approved these changes
Apr 21, 2022
Co-authored-by: Tom Ross <[email protected]>
Co-authored-by: Tom Ross <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
cla-signed
frontend-platform
Issues related to our frontend platform, owned collectively by our frontend crew.
observability
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This PR integrates Datadog RUM SDK into the web application.
Closes https://github.com/sourcegraph/sourcegraph/issues/33992
Related to: https://github.com/sourcegraph/sourcegraph/issues/29651 and RFC 575 APPROVED: Cloud Observability tooling
Changes
observability.logging
key.@datadog/browser-rum-slim
is added todevDependencies
to allow usage of Typescript types, and it's not added to the application bundle.Notes integration trade-offs
Since we didn't decide which solution we would want to use for the observability OKR set for the Frontend Platform team next quarter, it's essential to integrate the Datadog RUM SDK as a POC without hurting our performance metrics on production.
The best strategy for POC is to load it via async script to avoid hurting our bundle size. This way, we keep Sentry in place and see how they compare.
Production
Merging this PR won't enable Datadog RUM on any production instance automatically. To enable it, the Datadog RUM configuration should be added to the site configuration via site-admin.
Test plan
Local development
Datadog is initialized only if:
index.html
template (app.html). Meaning thatSourcegraphDotComMode == true
.process.env.ENABLE_MONITORING || process.env.NODE_ENV === 'production'
to prevent log spam in the development environment.Based on the requirements above to test Datadog RUM locally run:
ENABLE_MONITORING=true sg start dotcom
Datadog access
Datadog RUM application logs are available here. If the link is inaccessible for you, check if Datadog is added to your Okta profile. If it's not there — reach out to #it-tech-ops
Testing
ENABLE_MONITORING=true sg start dotcom