Repository navigation
Conversation
In the Logs plugin, the session context gets RUM's session manager, which samples at RUM's rate by default. Both lookups now pass Logs' own rate. Standalone Logs doesn't change, because its own manager already defaults to that rate. The two new sessionContext tests failed before this change and pass with it.
The comment ended in "pass Logs' own", which read as unfinished. Comment only: the sessionContext spec passes 6/6, and Prettier and ESLint are clean on the file.
Bundles Sizes Evolution
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 82ab7cc | Docs | View more details | Give us feedback! |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
The Logs plugin from the RFC uses RUM's session manager instead of starting its own. RUM's
findTrackedSession()samples at RUM'ssessionSampleRateby default, so logs would be sampled at RUM's rate instead of Logs'.This is the second of 4 stacked PRs. It makes Logs pass its own rate, with no change for
datadogLogs.init().Stacked on #5320.
Refs: RUM-19971
Changes
startSessionContext()now only needsfindTrackedSession, so it accepts RUM's read-only session manager from #5295. Both lookups passconfiguration.sessionSampleRate: the one that addssession_idand the one that discards logs from sessions Logs doesn't sample.Nothing changes for
datadogLogs.init(). Its own session manager already defaults to that rate, and the event bridge stub ignores it, as today.The two new tests use a mock of RUM's manager, with a session only Logs samples and one only RUM samples. Both fail without the change.
Test instructions
Standalone Logs still samples with its own rate. With
sessionSampleRate: 0the log is dropped, and with100it's sent with the session id:Expected output: nothing.
Expected output:
Then
yarn dev-server stopandrm sandbox/test-logs-sample-rate.html.Unit tests:
Checklist