feat(tracing): Send sample rate and type in transaction item header in envelope#3068
Merged
lobsterkatie merged 4 commits intomasterfrom Dec 15, 2020
Merged
Conversation
Contributor
size-limit report
|
rhcarvalho
reviewed
Nov 26, 2020
Contributor
rhcarvalho
left a comment
There was a problem hiding this comment.
A few comments. Concerned about piggybacking on tags.
Based on the TODO in the PR description, I believe there's still some ironing out of the protocol in Relay? Is there an accompanying PR there?
ddb7375 to
cec14a5
Compare
HazAT
requested changes
Dec 15, 2020
Comment on lines
+24
to
+25
| const { __sentry_samplingMethod: samplingMethod, __sentry_sampleRate: sampleRate, ...otherTags } = event.tags || {}; | ||
| event.tags = otherTags; |
| import { eventToSentryRequest } from '../../src/request'; | ||
|
|
||
| describe('eventToSentryRequest', () => { | ||
| const api = new API('https://[email protected]/12312012'); |
Member
There was a problem hiding this comment.
I wonder how dogs can be bad at keeping secrets? 🤔
29467f2 to
0afb3c7
Compare
HazAT
approved these changes
Dec 15, 2020
AbhiPrasad
added a commit
that referenced
this pull request
Sep 19, 2022
In our initial work on Dynamic Sampling (#3068), we added the ability to track transaction sampling method. https://github.com/getsentry/sentry-javascript/pull/3068/files#diff-337facb22f742f05b3326aed66ca6b0d5eb9c782c7c03c88ef0170fd97dc410dR104-R109 ```ts export enum TransactionSamplingMethod { Explicit = 'explicitly_set', Sampler = 'client_sampler', Rate = 'client_rate', Inheritance = 'inheritance', } ``` To use this info, we set the transaction sampling method and sample rate on the transaction event header: ```ts sample_rates: [{ id: samplingMethod, rate: sampleRate }], ``` In Relay this is used here: https://github.com/getsentry/relay/blob/4b16d279ccf21d3c1d975b652ffca01ebd72a500/relay-general/src/protocol/metrics.rs#L7-L16 This is no longer needed for dynamic sampling context with the introduction of Dynamic Sampling Context, so we can remove this code.
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.
Product asked for this data, to get a sense of what kinds of sample rates people are using. It also may help inform future dynamic sampling work in relay.
TODO:
The spec didn't mention what should happen in either the case of sampling inheritance or of an explicitly set sampling decision, so I recorded it, but with no sample rate. Happy to change this to something else if anyone would prefer.EDIT: Agreed with @HazAT that we'll go with the simple version for now: sample rates sent if they come from either
traces_sampleror -traces_sample_rate, but not other methods (inheritance and having the sampling decision explicitly set). The rest, listed above, we'll hold on until it's clear we need to do it.