-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(performance): Add tracesSampleRate
and tracesSampler
to JS docs
#2376
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
65c3aa0
add tracesSampler to default comment in code snippets
lobsterkatie f59376e
fix koa code snippet
lobsterkatie 91013d5
add tracesSampleRate and tracesSampler to config options
lobsterkatie 0b06850
move autocapture and manual capture to their own pages
lobsterkatie 87cc9f6
change order of sections on index page
lobsterkatie f430e22
add enablement intro section
lobsterkatie e6fa5c5
add page on sampling and associated includes
lobsterkatie da8a13a
update main JS page
lobsterkatie 0ae4b8f
edit connecting front to back section and add sentry-trace header to it
lobsterkatie abb8582
reorganize filtering page and add transaction sampling
lobsterkatie 0197e07
general language-fixing
lobsterkatie 315f828
reword tracesSampleRate comment in code snippets
lobsterkatie b5c826c
respond to PR comments
lobsterkatie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
20 changes: 20 additions & 0 deletions
20
src/includes/performance/custom-sampling-context/javascript.mdx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
```javascript | ||
Sentry.startTransaction( | ||
{ | ||
// `transactionContext` - will be recorded on transaction | ||
name: 'Search from navbar', | ||
op: 'search', | ||
tags: { | ||
testGroup: 'A3', | ||
treatmentName: 'eager load', | ||
}, | ||
}, | ||
// `customSamplingContext` - won't be recorded | ||
{ | ||
// PII | ||
userId: '12312012', | ||
// too big to send | ||
resultsFromLastSearch: { ... } | ||
}, | ||
); | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
```javascript | ||
Sentry.startTransaction( | ||
{ | ||
// `transactionContext` - will be recorded on transaction | ||
name: 'GET /search', | ||
op: 'search', | ||
data: { | ||
queryParams: { | ||
animal: "dog", | ||
type: "very good" | ||
} | ||
}, | ||
}, | ||
// `customSamplingContext` - won't be recorded | ||
{ | ||
// PII | ||
userId: '12312012', | ||
// too big to send | ||
searchResults: { ... } | ||
}, | ||
); | ||
``` |
14 changes: 14 additions & 0 deletions
14
src/includes/performance/default-sampling-context/javascript.mdx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
For browser-based SDKs, it includes the following: | ||
|
||
```javascript | ||
// contents of `samplingContext` | ||
{ | ||
transactionContext: { | ||
name: string; // human-readable identifier, like "GET /users" | ||
op: string; // short description of transaction type, like "pageload" | ||
} | ||
parentSampled: boolean; // if this transaction has a parent, its sampling decision | ||
location: Location | WorkerLocation; // the window.location or self.location object | ||
... // custom context as passed to `startTransaction` | ||
} | ||
``` |
13 changes: 13 additions & 0 deletions
13
src/includes/performance/default-sampling-context/node.mdx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
The information contained in the `samplingContext` object passed to the `tracesSampler` when a transaction is created varies by platform. For node-based SDKs, it includes the following: | ||
|
||
```javascript | ||
{ | ||
transactionContext: { | ||
name: string; // human-readable identifier, like "GET /users" | ||
op: string; // short description of transaction type, like "pageload" | ||
} | ||
parentSampled: boolean; // if this transaction has a parent, its sampling decision | ||
request: object // in server contexts, information about the incoming request | ||
... // custom context as passed to `startTransaction` | ||
} | ||
``` |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.