Skip to content

ref(tracing): Prework for initial tracestate implementation #3242

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

Conversation

lobsterkatie
Copy link
Member

#3092 had gotten unwieldy, so I pulled out everything which wasn't directly related to passing encoded tracestate headers, and this is the result.

Highlights:

  • Two new utility methods, unicodeToBase64 (which encodes the given string, first in UTF-8 and then in base64)
    and base64ToUnicode(which reverses the process) have been added.

    • Each handles browser and node environments separately, as each platform has base64 encoding and decoding methods not shared by the other
    • Testing this required an extension of the jsdom testing environment to include TextEncoder and TextDecoder (which exist in all real browsers, but are missing from jsdom)
  • Default environment is now set on the client rather than on each individual event, which makes it available early enough in the SDK lifecycle to be included in tracestate values.

  • core.request.eventToSentryRequest, which used to handle both error events and transaction events now delegates to separate methods for each.

@lobsterkatie lobsterkatie changed the title ref(tracing): Prework for full tracestate implementation ref(tracing): Prework for initial tracestate implementation Feb 6, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 20.35 KB (-0.03% 🔽)
@sentry/browser - Webpack 27.65 KB (+23.46% 🔺)
@sentry/react - Webpack 27.67 KB (+23.45% 🔺)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 27.37 KB (-0.04% 🔽)

@lobsterkatie
Copy link
Member Author

Since the only actual behavior change here is the time at which default environment is set, and since it's against a feature branch rather than master, I'm going to live dangerously and go ahead and merge this without approval so that I can move on with work on top of it.

@lobsterkatie lobsterkatie merged commit 6124bdb into kmclb-dynamic-sampling-data-in-envelopes Feb 6, 2021
@lobsterkatie lobsterkatie deleted the kmclb-encoded-tracestate-prework branch February 6, 2021 21:43
@lobsterkatie
Copy link
Member Author

P.S. I figured out what's happening here, though I don't yet know why. The entire buffer module is getting included in the bundle for some reason. Will work on that before all is said and done but leaving it be for now.

image

lobsterkatie added a commit that referenced this pull request Aug 24, 2021
This is the result of rebasing the feature branch for the initial implementation of `tracestate` header handling (which had grown very stale) on top of current `master`. That branch is going to get deleted, so for posterity, it included the following PRs (oldest -> newest):

feat(tracing): Add dynamic sampling correlation context data to envelope header (#3062)
chore(utils): Split browser/node compatibility utils into separate module (#3123)
ref(tracing): Prework for initial `tracestate` implementation (#3242)
feat(tracing): Add `tracestate` header to outgoing requests (#3092)
ref(tracing): Rework tracestate internals to allow for third-party data (#3266)
feat(tracing): Handle incoming tracestate data, allow for third-party data (#3275)
chore(tracing): Various small fixes to first `tracestate` implementation (#3291)
fix(tracing): Use `Request.headers.append` correctly (#3311)
feat(tracing): Add user data to tracestate header (#3343)
chore(various): Small fixes (#3368)
fix(build): Prevent Node's `Buffer` module from being included in browser bundles (#3372)
fix(tracing): Remove undefined tracestate data rather than setting it to `null` (#3373)

More detail in the PR description.
lobsterkatie added a commit that referenced this pull request Aug 30, 2021
This is the result of rebasing the feature branch for the initial implementation of `tracestate` header handling (which had grown very stale) on top of current `master`. That branch is going to get deleted, so for posterity, it included the following PRs (oldest -> newest):

feat(tracing): Add dynamic sampling correlation context data to envelope header (#3062)
chore(utils): Split browser/node compatibility utils into separate module (#3123)
ref(tracing): Prework for initial `tracestate` implementation (#3242)
feat(tracing): Add `tracestate` header to outgoing requests (#3092)
ref(tracing): Rework tracestate internals to allow for third-party data (#3266)
feat(tracing): Handle incoming tracestate data, allow for third-party data (#3275)
chore(tracing): Various small fixes to first `tracestate` implementation (#3291)
fix(tracing): Use `Request.headers.append` correctly (#3311)
feat(tracing): Add user data to tracestate header (#3343)
chore(various): Small fixes (#3368)
fix(build): Prevent Node's `Buffer` module from being included in browser bundles (#3372)
fix(tracing): Remove undefined tracestate data rather than setting it to `null` (#3373)

More detail in the PR description.
lobsterkatie added a commit that referenced this pull request Aug 31, 2021
This is the result of rebasing the feature branch for the initial implementation of `tracestate` header handling (which had grown very stale) on top of current `master`. That branch is going to get deleted, so for posterity, it included the following PRs (oldest -> newest):

feat(tracing): Add dynamic sampling correlation context data to envelope header (#3062)
chore(utils): Split browser/node compatibility utils into separate module (#3123)
ref(tracing): Prework for initial `tracestate` implementation (#3242)
feat(tracing): Add `tracestate` header to outgoing requests (#3092)
ref(tracing): Rework tracestate internals to allow for third-party data (#3266)
feat(tracing): Handle incoming tracestate data, allow for third-party data (#3275)
chore(tracing): Various small fixes to first `tracestate` implementation (#3291)
fix(tracing): Use `Request.headers.append` correctly (#3311)
feat(tracing): Add user data to tracestate header (#3343)
chore(various): Small fixes (#3368)
fix(build): Prevent Node's `Buffer` module from being included in browser bundles (#3372)
fix(tracing): Remove undefined tracestate data rather than setting it to `null` (#3373)

More detail in the PR description.
lobsterkatie added a commit that referenced this pull request Sep 15, 2021
This is the result of rebasing the feature branch for the initial implementation of `tracestate` header handling (which had grown very stale) on top of current `master`. That branch is going to get deleted, so for posterity, it included the following PRs (oldest -> newest):

feat(tracing): Add dynamic sampling correlation context data to envelope header (#3062)
chore(utils): Split browser/node compatibility utils into separate module (#3123)
ref(tracing): Prework for initial `tracestate` implementation (#3242)
feat(tracing): Add `tracestate` header to outgoing requests (#3092)
ref(tracing): Rework tracestate internals to allow for third-party data (#3266)
feat(tracing): Handle incoming tracestate data, allow for third-party data (#3275)
chore(tracing): Various small fixes to first `tracestate` implementation (#3291)
fix(tracing): Use `Request.headers.append` correctly (#3311)
feat(tracing): Add user data to tracestate header (#3343)
chore(various): Small fixes (#3368)
fix(build): Prevent Node's `Buffer` module from being included in browser bundles (#3372)
fix(tracing): Remove undefined tracestate data rather than setting it to `null` (#3373)

More detail in the PR description.
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.

1 participant