-
Notifications
You must be signed in to change notification settings - Fork 136
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(rum): propagate sampling decision through tracestate #953
Conversation
📦 Bundlesize report
|
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Steps errors
Expand to view the steps failures
|
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.
Thanks @vigneshshanmugam , a few points:
- I think we still need some validation for
tracestate
to avoid sending a large header by mistake or a similar bug (Also adding a test for this) - The tests are failing at the moment
- I will review the spec in a bit more detail and give this another review.
@jahtalab I have added minimum validation for the values that we set, i think it should good to catch bugs that can arise due to bad sampling value. Also added and fixed the tests. |
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.
@vigneshshanmugam , I've added a few comments:
The spec mentions this as well, which is currently missing:
For non-sampled transactions set the transaction attributes sampled: false and sample_rate: 0, and omit context. No spans should be captured.
Also, the spec mentions storing the sampe_rate
on spans as well, are we relying on apm-server to do this?
Agents will record the sampling rate on transactions and spans as sample_rate
packages/rum-core/test/performance-monitoring/performance-monitoring.spec.js
Outdated
Show resolved
Hide resolved
I spoke with Server team yesterday and we would have to do this in the agent side for now as they cant infer in v2 API. I will change the code to propagate the info for spans. |
@vigneshshanmugam , would you please take a look at the failing tests as well? |
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.
LGTM
* feat(rum): propagate sampling decision through tracestate * chore: fix tests with sampling rate * docs: update docs with new config and cors * chore: add validation test and fix tests * chore: test if repeat function exists * chore: address review * chore: keep context as it is
propagateTracestate
boolean to optionally add the tracestate header to all outgoing requests from the browser that are captured as transactions and spans .sample_rate
andsr
in both v2 and v3 spec in the APM server.