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: add Datadog RUM to template and components #790

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dcshzj
Copy link
Contributor

@dcshzj dcshzj commented Oct 18, 2024

Problem

We don't have RUM set up on our template, so we are not able to monitor the user behaviour on the actual Isomer Next sites.

Solution

Breaking Changes

  • Yes - this PR contains breaking changes
  • No - this PR is backwards compatible

Features:

  • Set up Datadog RUM monitoring as a component, and use the component inside the Skeleton layout.
  • The sampling rate is configured using the environment variable NEXT_PUBLIC_ISOMER_NEXT_RUM_SAMPLING_RATE, which is injected at build time to feature flag the level of sampling.

@dcshzj dcshzj requested a review from a team as a code owner October 18, 2024 10:42
Copy link

vercel bot commented Oct 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
isomer-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 10:50am

@datadog-opengovsg
Copy link

datadog-opengovsg bot commented Oct 18, 2024

Datadog Report

Branch report: feat/add-datadog-rum
Commit report: 3b1692a
Test service: isomer-studio

✅ 0 Failed, 129 Passed, 23 Skipped, 31.39s Total Time
➡️ Test Sessions change in coverage: 1 no change

Comment on lines +8 to +24
datadogRum.init({
applicationId: PUBLIC_RUM_APPLICATION_ID,
clientToken: PUBLIC_DD_RUM_CLIENT_TOKEN,
site: "datadoghq.com",
service: "isomer-next-sites",
env: "production",
sessionSampleRate: Number(
process.env.NEXT_PUBLIC_ISOMER_NEXT_RUM_SAMPLING_RATE ?? 0,
),
sessionReplaySampleRate: Number(
process.env.NEXT_PUBLIC_ISOMER_NEXT_RUM_SAMPLING_RATE ?? 0,
),
trackUserInteractions: true,
trackResources: true,
trackLongTasks: true,
defaultPrivacyLevel: "allow",
})
Copy link
Contributor

Choose a reason for hiding this comment

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

should we pass in production as ENV too? or check that its production/staging before rendering. so as to not dirty the data + not have it run on dev and incur unncessary cost

Copy link
Contributor

Choose a reason for hiding this comment

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

ooo why this file will change ah?

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