Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
208 commits
Select commit Hold shift + click to select a range
10fe77f
ref(tracing): Remove references to @sentry/apm (#4845)
AbhiPrasad Apr 7, 2022
f501391
ref(core): Delete `API` class (#4848)
AbhiPrasad Apr 7, 2022
1997ad5
ref(tracing): Delete deprecated `startSpan` and `child` methods (#4849)
AbhiPrasad Apr 7, 2022
5f0d7c2
ref(core): Remove `whitelistUrls`/`blacklistUrls` (#4850)
AbhiPrasad Apr 7, 2022
67bbb65
ref(gatsby): Remove `Sentry` from window (#4857)
AbhiPrasad Apr 7, 2022
c481f55
ref(hub): Remove `getActiveDomain` (#4858)
AbhiPrasad Apr 7, 2022
8ed1e9e
ref(types): Remove deprecated `user` dsn field (#4864)
AbhiPrasad Apr 7, 2022
ba4561c
ref(hub): Remove `setTransaction` scope method (#4865)
AbhiPrasad Apr 7, 2022
ebff719
ref: Drop support for Node 6 (#4851)
AbhiPrasad Apr 7, 2022
5a050ee
ref(tracing): Rename `registerRequestInstrumentation` -> `instrumentO…
AbhiPrasad Apr 7, 2022
bd509d0
fix(test): Increase MongoMemoryServer creation timeout (#4881)
Lms24 Apr 7, 2022
729aced
ref(node): Remove deprecated `frameContextLines` (#4884)
timfish Apr 7, 2022
0604aef
ref(browser): Remove top level eventbuilder exports (#4887)
timfish Apr 7, 2022
fc6aa54
ref(build): Update to TypeScript 3.8.3 (#4895)
lobsterkatie Apr 7, 2022
804640d
ref(bundles): Stop publishing CDN bundles on npm (#4901)
Apr 8, 2022
c64ca5e
ref(types): Delete `RequestSessionStatus` enum (#4889)
AbhiPrasad Apr 8, 2022
d096b02
ref(types): Delete Status enum (#4891)
AbhiPrasad Apr 8, 2022
9b1dfdf
ref(build): Rename `dist` directories to `cjs` (#4900)
Lms24 Apr 8, 2022
7f56b0f
ref(integrations): Remove old `angular`, `ember`, and `vue` integrati…
AbhiPrasad Apr 8, 2022
e6149ad
ref(types): Delete `SessionStatus` enum (#4890)
AbhiPrasad Apr 8, 2022
dcb1bb8
meta: 7.0.0-alpha.0 changelog (#4892)
AbhiPrasad Apr 8, 2022
87e9894
fix(build): Skip flags file when building integration bundles (#4906)
lobsterkatie Apr 9, 2022
bac2d91
fix(dev): Standardize yarn `clean` scripts (#4909)
lobsterkatie Apr 11, 2022
62e7189
chore(dev): Remove redundant `.gitignore` in `utils` package (#4905)
lobsterkatie Apr 11, 2022
53027de
ref(dev): Centralize jest config (#4907)
lobsterkatie Apr 11, 2022
f5a6ca8
release: 7.0.0-alpha.0
getsentry-bot Apr 11, 2022
b42472a
feat(docs): Add migration guide for v7 (#4910)
Apr 11, 2022
075d59b
feat(browser): Add debugging hints to browser integration tests (#4914)
lobsterkatie Apr 11, 2022
07d4ffd
ref(various): Remove usage of deprecated `event.stacktrace` (#4885)
timfish Apr 11, 2022
5d38a7e
chore(dev): Update `jest` and friends (#4897)
lobsterkatie Apr 11, 2022
05292b9
fix(dev): Fix unit test debugging configuration (#4915)
lobsterkatie Apr 12, 2022
a9cc619
ref: Port functionality from `Backend` to `Client` (#4911)
Lms24 Apr 12, 2022
43cb4a1
feat(docs): Add section for renaming of CDN bundles (#4918)
Apr 12, 2022
ea09e78
ref(backend): Delete `Backend` classes (#4919)
Lms24 Apr 12, 2022
2ffd78c
fix(wasm): Ensure wasm bundle exists before running wasm tests (#4916)
lobsterkatie Apr 12, 2022
6f09dd7
feat: Expose configurable stack parser (#4902)
timfish Apr 12, 2022
08f50c8
ref(browser): Remove stack parser support for Opera pre v15 (#4923)
timfish Apr 12, 2022
052263b
ref(tracing): Update `setMeasurements` to only set a single measureme…
Apr 13, 2022
b35fed9
feat(tracing): Make `setMeasurement` public API (#4933)
Apr 13, 2022
254e40e
ref(types): Stop using `Severity` enum (#4926)
lobsterkatie Apr 14, 2022
e214325
ref(build): Turn on `isolatedModules` TS option (#4896)
lobsterkatie Apr 14, 2022
3c7faf9
chore(types): Update `@types/jest` (#4929)
lobsterkatie Apr 14, 2022
fa34914
ref: Inject Transports into Client (#4921)
Lms24 Apr 14, 2022
b7c2494
feat(docs): Add `Backend` removal and `Transport` injection to migrat…
Lms24 Apr 14, 2022
b15912a
feat(docs): Add enum removal and deprecation section to migration doc…
Lms24 Apr 14, 2022
ec5ebe9
feat: Add `name` field to `EventProcessor` (#4932)
Apr 14, 2022
362375c
meta: 7.0.0-alpha.1 changelog (#4939)
AbhiPrasad Apr 14, 2022
23f8d6e
release: 7.0.0-alpha.1
getsentry-bot Apr 14, 2022
e5f26a5
chore(gatsby): Create type declarations for gatsby plugin files (#4928)
lobsterkatie Apr 14, 2022
92bf5d3
chore(dev): Remove `tslint` (#4940)
AbhiPrasad Apr 14, 2022
e816c34
ref(test): Switch to `mongodb-memory-server-global` (#4872)
onurtemizkan Apr 14, 2022
9cf57fd
fix(tests): Use non-delayed success endpoints to test `crashed` and `…
onurtemizkan Apr 14, 2022
9f3253d
ref(utils): Remove `forget` async utility function (#4941)
Lms24 Apr 14, 2022
1660047
feat(tracing): Add GB unit to device memory tag value (#4935)
dashed Apr 14, 2022
3f43c39
fix(build): Cache gatsby plugin types files in CI (#4944)
lobsterkatie Apr 14, 2022
d62c758
fix(tests): Fix type errors in tests (#4908)
lobsterkatie Apr 14, 2022
0d811bd
ref(node): Remove `raven-node` backward-compat code (#4942)
AbhiPrasad Apr 18, 2022
fe845d9
ref(build): Split up rollup config code (#4950)
lobsterkatie Apr 19, 2022
34d4ddb
ref(tests): Suppress unconstructive listener and open handle warnings…
onurtemizkan Apr 19, 2022
5ed6066
feat(core): Introduce separate client options (#4927)
AbhiPrasad Apr 19, 2022
1cc0e8a
fix(dev): Check out correct commit in manual GHA `Build & Test` workf…
lobsterkatie Apr 20, 2022
1b32e54
ref(core): Simplify the setup logic of integrations (#4952)
Apr 20, 2022
03d978a
ref(build): Rename CDN bundles to be es6 per default (#4958)
Apr 21, 2022
67cb07a
fix(angular): Use Angular compiler to compile @sentry/angular (#4641)
Lms24 Apr 21, 2022
4581faa
doc(angular): Add Angular migration instructions to migration doc (#4…
Lms24 Apr 21, 2022
deac0eb
ref: Enforce `stackParser` through options. (#4953)
AbhiPrasad Apr 21, 2022
c2ebd42
feat(tracing): Add Prisma ORM integration. (#4931)
onurtemizkan Apr 21, 2022
ec384db
meta(gha): Deploy action `enforce-license-compliance.yml` (#4961)
chadwhitacre Apr 21, 2022
df555d1
fix(dev): Correctly lint `scripts` typescript files (#4963)
lobsterkatie Apr 21, 2022
18257b1
feat(angular): Log warning if SDK is used with an older Angular versi…
Lms24 Apr 22, 2022
b5abe03
ref: Switch to new transports (#4943)
AbhiPrasad Apr 25, 2022
4a35b8d
chore(dev): Update `caniuse-lite` (#4975)
lobsterkatie Apr 26, 2022
8d52e14
chore(dev): Update `ts-node` to 10.7 (#4976)
lobsterkatie Apr 26, 2022
84555ac
fix(build): Replace `git.io` links with redirect targets (#4986)
asottile-sentry Apr 26, 2022
e6a51cb
fix(tracing): Adjust `sideEffects` package.json entry for v7 (#4987)
Lms24 Apr 26, 2022
a8591ea
ref: Delete old transports (#4967)
AbhiPrasad Apr 26, 2022
e0374a3
ref(minimal): Delete `@sentry/minimal` (#4971)
AbhiPrasad Apr 26, 2022
5037d76
fix(nextjs): Fix missing types build in `install-sentry-from-branch` …
kamilogorek Apr 26, 2022
299aeb3
ref: Delete store endpoint code (#4969)
AbhiPrasad Apr 26, 2022
a5c3808
fix(dev): Fix linting for top-level `scripts` folder (#4977)
lobsterkatie Apr 27, 2022
4176bcb
chore: set ignoreSentryErrors to true (#4994)
vladanpaunovic Apr 27, 2022
4ca2de2
ref(tests): Move top-level jest config to `jest` folder (#4978)
lobsterkatie Apr 27, 2022
87cf8c5
fix(tests): Silence dummy output in tests (#4979)
lobsterkatie Apr 27, 2022
8145ce9
ref(nextjs): Update webpack-plugin and change how cli binary is detec…
AbhiPrasad Apr 27, 2022
a71cfb9
fix(dev): Remove eslint cache when cleaning repo (#4980)
lobsterkatie Apr 27, 2022
e86fa94
ref(core): Delete API Details (#4999)
AbhiPrasad Apr 27, 2022
3a512bc
feat(dev): Add VSCode debugger config for ts-node scripts (#4990)
lobsterkatie Apr 27, 2022
7856952
ref: Add argument-less overload to `resolvedSyncPromise` (#5000)
Apr 27, 2022
d619372
fix(hub): Add missing parameter to `captureException` docstring (#5001)
lobsterkatie Apr 27, 2022
c55003f
chore(build): Remove unnecessary `esModuleInterop` settings (#4991)
lobsterkatie Apr 27, 2022
69028bf
ref: Remove unneeded logic from transports (#5002)
Apr 28, 2022
9e46944
ref(build): Switch tsconfig `target` to es6 (#5005)
lobsterkatie Apr 28, 2022
7f04d33
feat(build): Add sucrase build foundations (#4992)
lobsterkatie Apr 28, 2022
aefa9b1
ref: Refactor transport, request, and client report types (#5007)
Apr 28, 2022
ebc938a
fix(serverless): Adjust v6 Lambda layer hotfix for v7 (#5006)
Lms24 Apr 28, 2022
de2822b
feat(transport): Add client report hook to `makeTransport` (#5008)
Apr 28, 2022
389f4ee
ref(browser): Remove showReportDialog on browser client (#4973)
AbhiPrasad Apr 28, 2022
b3fddcd
feat(hub): Remove _invokeClient (#4972)
AbhiPrasad Apr 28, 2022
f979104
docs(transports): Update Migration document with custom Transport cha…
Lms24 Apr 28, 2022
1c5bff0
ref(core): Make event processing logs warnings (#5010)
AbhiPrasad Apr 28, 2022
031ffa7
docs(core): Improve documentation of `Options` and `ClientOptions` pr…
Lms24 Apr 29, 2022
dd1fb29
ref: Record dropped events in `BaseClient` (#5017)
Apr 29, 2022
b450538
ref: Add back client reporting to `BrowserClient` (#5018)
Apr 29, 2022
e16a699
test(tracing): Add Prisma ORM integration tests. (#4962)
onurtemizkan Apr 29, 2022
f18a938
fix(gatsby): Add script to ensure types files exist when testing (#5020)
lobsterkatie Apr 29, 2022
69e6275
fix(build): Fix temporary sucrase CI jobs (#5021)
lobsterkatie Apr 29, 2022
1130c1c
feat(build): Add various rollup plugins to sucrase build (#4993)
lobsterkatie Apr 30, 2022
16356cb
fix(tests): Add `const`-to-`var` ts-jest transformer (#5022)
lobsterkatie May 2, 2022
2df499b
ref: Make it easier to use stackParser (#5015)
AbhiPrasad May 3, 2022
d8fc94c
test(utils): Remove usage of testOnlyIfNodeVersionAtLeast(8) (#5025)
AbhiPrasad May 3, 2022
00c00fa
ref(browser): Don't use Breadcrumbs integration in send event flow (#…
May 3, 2022
39553b5
ref: Remove unused `_sendEvent` method in base client (#5026)
May 3, 2022
c9e8997
meta: 7.0.0-beta.0 CHANGELOG (#5011)
AbhiPrasad May 3, 2022
3532b33
feat: Export browser integrations individually (#5028)
AbhiPrasad May 3, 2022
50361b6
release: 7.0.0-beta.0
getsentry-bot May 3, 2022
add82b4
Merge branch 'release/7.0.0-beta.0' into 7.x
May 4, 2022
1b924e7
chore(browser): Rename `UserAgent` integration to `HttpContext` (#5027)
Lms24 May 4, 2022
794f65b
fix(browser): Change `UserAgent` export to `HttpContext` (#5033)
Lms24 May 4, 2022
6496a11
ref: Remove `critical` severity (#5032)
May 4, 2022
9782d69
ref: Delete unneeded `SDK_NAME` (#5040)
May 5, 2022
419416a
docs(migration): Add TLDR to v7 migration docs (#5041)
May 5, 2022
1e210fe
chore: update sentry logo in readme files (#5045)
mattjohnsonpint May 5, 2022
c9e3602
fix(tracing): Remove `isInstanceOf` check in Hub constructor (#5046)
Lms24 May 6, 2022
8b16378
ref(tracing): Reset IdleTimeout based on activities count (#5044)
AbhiPrasad May 6, 2022
8d475b1
ref(utils): Clean up dangerous type casts in object helper file (#5047)
May 9, 2022
5bd31ac
chore: Add NextJS cli fix to changelog (#5055)
AbhiPrasad May 9, 2022
8d36f0b
ref(utils): Add logic to enable skipping of normalization (#5052)
May 9, 2022
19a9d00
feat(build): Vendor polyfills injected during build (#5051)
lobsterkatie May 9, 2022
904b2d3
fix(integrations): Mark ExtraErrorData as already normalized (#5053)
May 9, 2022
cb9260f
feat(build): Add polyfill-extraction rollup plugin (#5023)
lobsterkatie May 10, 2022
1342c42
ref(node): Explicitly pass down node transport options (#5057)
AbhiPrasad May 10, 2022
52af0b1
ref(browser): Unify BrowserTransportOptions (#5058)
AbhiPrasad May 10, 2022
94554b3
ref(nextjs): Use new build process in vercel script (#5065)
lobsterkatie May 10, 2022
f715933
ref(build): Use rollup/sucrase for non-watch npm builds (#5035)
lobsterkatie May 10, 2022
529650c
chore(build): Handle npm tarballs (#5067)
lobsterkatie May 10, 2022
73ee42b
fix yarn.lock
lobsterkatie May 11, 2022
46400ff
chore(dev): Update `caniuse-lite` (#5069)
lobsterkatie May 11, 2022
5beee11
fix(utils): Consider 429 responses in transports (#5062)
May 11, 2022
656d7c4
ref(hub): Convert `Session` class to object and functions (#5054)
Lms24 May 11, 2022
8c185db
fix(build): Fix references to `rollup.bundle.config.js` (#5074)
lobsterkatie May 11, 2022
7bf6540
fix(tests): Fix node integration test linting and type errors (#5070)
lobsterkatie May 11, 2022
6536eb6
chore(docs): Fix unresolved rebase conflict in Migration.MD (#5076)
Lms24 May 11, 2022
cd71864
feat(react): Add react-router-v6 integration (#5042)
onurtemizkan May 11, 2022
7723d32
ref(build): Use sucrase for `watch` npm builds (#5059)
lobsterkatie May 11, 2022
6b3ea05
ref(build): Improve logging in prepack scripts (#5071)
lobsterkatie May 11, 2022
c8d9905
ref(build): Remove `es5`, `cjs`, and `esm` build commands (#5073)
lobsterkatie May 11, 2022
23982cf
chore(dev): Remove redundant `prepublishOnly` build step in CI (#5083)
lobsterkatie May 12, 2022
e5bfbaa
feat(dev): Add default Node version for CI jobs (#5081)
lobsterkatie May 12, 2022
d9722dc
ref(dev): Use `lerna exec` for top-level `link:yarn` yarn script (#5084)
lobsterkatie May 12, 2022
e39b3f6
feat(build): Add args and templates to rollup debugger plugin (#5085)
lobsterkatie May 12, 2022
042e96e
fix(types): Make `@sentry/types` a runtime dependency in gatsby and n…
lobsterkatie May 12, 2022
f4a1840
ref(utils): Remove `Object.setPrototypeOf` polyfill (#5087)
lobsterkatie May 12, 2022
1badac1
ref(node): Improve Node manual test logging (#5088)
lobsterkatie May 12, 2022
28c09ad
ref(core): Log warning on NOK transport response (#5091)
May 12, 2022
845346a
fix(dev): Restrict size check action to PRs (#5082)
lobsterkatie May 12, 2022
10bca50
meta: 7.0.0-beta.1 changelog (#5092)
AbhiPrasad May 12, 2022
30a9092
release: 7.0.0-beta.1
getsentry-bot May 12, 2022
472a473
Merge branch 'release/7.0.0-beta.1' into 7.x
May 12, 2022
e0ad5c1
fix(ember): Export sha hashes of injected scripts (#5089)
May 13, 2022
5c34152
ref(serverless): Do not throw on flush error (#5090)
May 13, 2022
8a4039d
ref(serverless): Use GitHub action to zip lambda layer (second try) (…
antonpirker May 13, 2022
25aed4d
ref(serverless): Improve handling of SDK version in GitHub action (#5…
antonpirker May 13, 2022
fa7e3b7
ref(serverless): Correctly exit on failed version extraction during b…
kamilogorek May 13, 2022
ce665e2
ref(build): Run repo-level builds in parallel (#5094)
lobsterkatie May 13, 2022
3534f15
ref(dev): Split up top-level `yarn clean` script (#5095)
lobsterkatie May 13, 2022
cac6312
fix(build): Fix express import in `gcpfunction` (#5097)
lobsterkatie May 13, 2022
98bc01a
ref(dev): Consolidate `.gitignore` files (#5096)
lobsterkatie May 13, 2022
78d7304
add changelog entries (#5102)
lobsterkatie May 13, 2022
6b6e746
fix(build): Narrow scope of build cache in GHA (#5105)
lobsterkatie May 17, 2022
774065f
chore(dev): Clean up main tsconfigs (#5114)
lobsterkatie May 17, 2022
797fe90
fix(build): Strip `eslint-enable` comments in rollup plugin (#5112)
lobsterkatie May 17, 2022
95db446
fix(build): Prevent redundant typechecking (#5115)
lobsterkatie May 17, 2022
66a6b59
ref(build): Use sucrase for es6 bundles (#5111)
lobsterkatie May 17, 2022
33e48ca
chore(tests): Fix react `act` warning in tests (#5113)
lobsterkatie May 17, 2022
0a6b4f2
feat(utils): Introduce Baggage API (#5066)
AbhiPrasad May 17, 2022
888f2b8
chore(build): Move aws lambda build step (#5123)
lobsterkatie May 18, 2022
a917dda
fix(build): Ensure bundle builds have needed dependencies (#5119)
lobsterkatie May 18, 2022
efbd343
docs(migration): Add upgrading information for multiple Sentry packag…
Lms24 May 18, 2022
d478c77
feat(core): Send Baggage in Envelope Header (#5104)
Lms24 May 18, 2022
8d08a8b
Change DSN in Lambda Layer to point to relay running in Lambda Extens…
antonpirker May 18, 2022
457b806
feat: Add attachments API (#5004)
timfish May 18, 2022
152e3c5
feat(ci): Add Node 18 to test matrix (#5049)
AbhiPrasad May 19, 2022
263257f
feat(build): Add rollup config for Node bundles (#5142)
lobsterkatie May 20, 2022
7c71013
feat(build): Allow for multiple bundle entrypoints (#5143)
lobsterkatie May 20, 2022
161d302
feat(build): Add ability to combine package-specific rollup config wi…
lobsterkatie May 20, 2022
18af87d
feat(build): Add option to build only specified bundle variants (#5145)
lobsterkatie May 20, 2022
9759e27
ref: Rename baggage env header to trace (#5128)
AbhiPrasad May 23, 2022
d48711f
feat(tracing): Add empty baggage header propagation to outgoing reque…
Lms24 May 23, 2022
945437a
ref(tracing): Reduce metrics bundle size (#5122)
AbhiPrasad May 23, 2022
5a782c3
Deactivated deployment of Lambda Layer until new Lambda Extension is …
antonpirker May 23, 2022
06930f5
meta: Update 7.0.0-beta.2 CHANGELOG (#5137)
AbhiPrasad May 23, 2022
c146db5
release: 7.0.0-beta.2
getsentry-bot May 23, 2022
2808c6e
Merge branch 'release/7.0.0-beta.2' into 7.x
May 23, 2022
bbc9d3d
fix(browser): Fix memory leak in `addEventListener` instrumentation (…
May 24, 2022
fa5712e
fix(tracing): Don't use `querySelector` when not available (#5160)
May 24, 2022
b0950aa
ref(dev): Improve labeling of checkout step in GHA (#5156)
lobsterkatie May 24, 2022
ef9a5d9
ref(core): Remove unnecessary nested `dropUndefinedKeys` call (#5161)
Lms24 May 25, 2022
7b9747f
ref(core): Actually ensure attachments are added to the envelope (#5159)
timfish May 25, 2022
31595e3
ref(core): Make hint callback argument non-optional (#5141)
timfish May 25, 2022
0ad2971
fix(utils): Fix infinite recursion in `dropUndefinedKeys` (#5163)
May 25, 2022
98c2ccc
ref(core): Test mutation of attachments in hint (#5140)
timfish May 25, 2022
549512d
ref(build): Use rollup to build AWS lambda layer (#5146)
lobsterkatie May 25, 2022
2b36cab
feat(nextjs): Make tracing package treeshakable (#5166)
May 25, 2022
1823003
meta: Update 7.0.0-rc.0 CHANGELOG (#5165)
May 25, 2022
8f0cb52
release: 7.0.0-rc.0
getsentry-bot May 25, 2022
23e04f5
Merge branch 'release/7.0.0-rc.0' into 7.x
May 25, 2022
b0919ef
ref(node): Allow node stack parser to work in browser context (#5135)
timfish May 27, 2022
e80ccdc
meta: 7.0.0 CHANGELOG (#5177)
AbhiPrasad May 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(tracing): Add empty baggage header propagation to outgoing reque…
…sts (#5133)

Adds the propagation of an "empty" baggage header. The word "empty" is however kind of misleading as the header is not necessarily empty. In order to comply with the baggage spec, as of this patch, we propagate incoming (3rd party) baggage to outgoing requests. The important part is that we actually add the `baggage` HTTP header to outgoing requests which is a breaking change in terms of CORS rules having to be adjusted.

We don't yet add `sentry-` baggage entries to the propagated baggage. This will come in a follow up PR which does not necessarily have to be part of the initial v7 release as it is no longer a breaking change. 

Overall, this is heavily inspired from #3945 (thanks @lobsterkatie for doing the hard work)

More specifically, this PR does the following things:

1. Extract incoming baggage headers and store them in the created transaction's metadata. Incoming baggage data is intercepted at:
* Node SDK: TracingHandler
* Serverless SDK: AWS wrapHandler
* Serverless SDK: GCP wrapHttpFunction
* Next.js: SDK makeWrappedReqHandler
* Next.js: SDK withSentry
* BrowserTracing Integration: by parsing the `<meta>` tags (analogously to the `sentry-trace` header)

2. Add the extracted baggage data to outgoing requests we instrument at:
* Node SDK: HTTP integration
* Tracing: instrumented Fetch and XHR callbacks

Co-authored-by: Luca Forstner <[email protected]>
  • Loading branch information
Lms24 and Luca Forstner authored May 23, 2022
commit d48711f09d5bebe9233e8f8e0a200837b933fe85
9 changes: 9 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Below we will outline all the breaking changes you should consider when upgradin
- We bumped the TypeScript version we generate our types with to 3.8.3. Please check if your TypeScript projects using TypeScript version 3.7 or lower still compile. Otherwise, upgrade your TypeScript version.
- `whitelistUrls` and `blacklistUrls` have been renamed to `allowUrls` and `denyUrls` in the `Sentry.init()` options.
- The `UserAgent` integration is now called `HttpContext`.
- If you are using Performance Monitoring and with tracing enabled, you might have to [make adjustments to
your server's CORS settings](#-propagation-of-baggage-header)

## Dropping Support for Node.js v6

Expand Down Expand Up @@ -319,6 +321,13 @@ session.update({ environment: 'prod' });
session.close('ok');
```

## Propagation of Baggage Header

We introduced a new way of propagating tracing and transaction-related information between services. This
change adds the [`baggage` HTTP header](https://www.w3.org/TR/baggage/) to outgoing requests if the instrumentation of requests is enabled. Since this adds a header to your HTTP requests, you might need
to adjust your Server's CORS settings to allow this additional header. Take a look at the [Sentry docs](https://docs.sentry.io/platforms/javascript/performance/connect-services/#navigation-and-other-xhr-requests)
for more in-depth instructions what to change.

## General API Changes

For our efforts to reduce bundle size of the SDK we had to remove and refactor parts of the package which introduced a few changes to the API:
Expand Down
3 changes: 1 addition & 2 deletions packages/core/test/lib/envelope.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DsnComponents, Event } from '@sentry/types';
import { EventTraceContext } from '@sentry/types/build/types/envelope';
import { DsnComponents, Event, EventTraceContext } from '@sentry/types';

import { createEventEnvelope } from '../../src/envelope';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<head>
<meta charset="utf-8" />
<meta name="sentry-trace" content="12312012123120121231201212312012-1121201211212012-1" />
<meta name="baggage" content="sentry-version=2.1.12" />
</head>
</html>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect } from '@playwright/test';
import { Event } from '@sentry/types';
import { Event, EventEnvelopeHeaders } from '@sentry/types';

import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';
import { envelopeHeaderRequestParser, getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest(
'should create a pageload transaction based on `sentry-trace` <meta>',
Expand All @@ -21,6 +21,20 @@ sentryTest(
},
);

// TODO this we can't really test until we actually propagate sentry- entries in baggage
// skipping for now but this must be adjusted later on
sentryTest.skip(
'should pick up `baggage` <meta> tag and propagate the content in transaction',
async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

const envHeader = await getFirstSentryEnvelopeRequest<EventEnvelopeHeaders>(page, url, envelopeHeaderRequestParser);

expect(envHeader.trace).toBeDefined();
expect(envHeader.trace).toEqual('{version:2.1.12}');
},
);

sentryTest(
"should create a navigation that's not influenced by `sentry-trace` <meta>",
async ({ getLocalTestPath, page }) => {
Expand Down
13 changes: 12 additions & 1 deletion packages/nextjs/src/utils/instrumentServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ import {
startTransaction,
} from '@sentry/node';
import { extractTraceparentData, getActiveTransaction, hasTracingEnabled } from '@sentry/tracing';
import { addExceptionMechanism, fill, isString, logger, stripUrlQueryAndFragment } from '@sentry/utils';
import {
addExceptionMechanism,
fill,
isString,
logger,
parseBaggageString,
stripUrlQueryAndFragment,
} from '@sentry/utils';
import * as domain from 'domain';
import * as http from 'http';
import { default as createNextServer } from 'next';
Expand Down Expand Up @@ -252,6 +259,9 @@ function makeWrappedReqHandler(origReqHandler: ReqHandler): WrappedReqHandler {
IS_DEBUG_BUILD && logger.log(`[Tracing] Continuing trace ${traceparentData?.traceId}.`);
}

const baggage =
nextReq.headers && isString(nextReq.headers.baggage) && parseBaggageString(nextReq.headers.baggage);

// pull off query string, if any
const reqPath = stripUrlQueryAndFragment(nextReq.url);

Expand All @@ -265,6 +275,7 @@ function makeWrappedReqHandler(origReqHandler: ReqHandler): WrappedReqHandler {
op: 'http.server',
metadata: { requestPath: reqPath },
...traceparentData,
...(baggage && { metadata: { baggage: baggage } }),
},
// Extra context passed to the `tracesSampler` (Note: We're combining `nextReq` and `req` this way in order
// to not break people's `tracesSampler` functions, even though the format of `nextReq` has changed (see
Expand Down
12 changes: 11 additions & 1 deletion packages/nextjs/src/utils/withSentry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { captureException, flush, getCurrentHub, Handlers, startTransaction } from '@sentry/node';
import { extractTraceparentData, hasTracingEnabled } from '@sentry/tracing';
import { Transaction } from '@sentry/types';
import { addExceptionMechanism, isString, logger, objectify, stripUrlQueryAndFragment } from '@sentry/utils';
import {
addExceptionMechanism,
isString,
logger,
objectify,
parseBaggageString,
stripUrlQueryAndFragment,
} from '@sentry/utils';
import * as domain from 'domain';
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';

Expand Down Expand Up @@ -48,6 +55,8 @@ export const withSentry = (origHandler: NextApiHandler): WrappedNextApiHandler =
IS_DEBUG_BUILD && logger.log(`[Tracing] Continuing trace ${traceparentData?.traceId}.`);
}

const baggage = req.headers && isString(req.headers.baggage) && parseBaggageString(req.headers.baggage);

const url = `${req.url}`;
// pull off query string, if any
let reqPath = stripUrlQueryAndFragment(url);
Expand All @@ -66,6 +75,7 @@ export const withSentry = (origHandler: NextApiHandler): WrappedNextApiHandler =
name: `${reqMethod}${reqPath}`,
op: 'http.server',
...traceparentData,
...(baggage && { metadata: { baggage: baggage } }),
},
// extra context passed to the `tracesSampler`
{ request: req },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import * as path from 'path';

import { getAPIResponse, runServer } from '../../../../utils/index';
import { TestAPIResponse } from '../server';

test('Should assign `baggage` header which contains 3rd party trace baggage data of an outgoing request.', async () => {
const url = await runServer(__dirname, `${path.resolve(__dirname, '..')}/server.ts`);

const response = (await getAPIResponse(new URL(`${url}/express`), {
baggage: 'foo=bar,bar=baz',
})) as TestAPIResponse;

expect(response).toBeDefined();
expect(response).toMatchObject({
test_data: {
host: 'somewhere.not.sentry',
baggage: expect.stringContaining('foo=bar,bar=baz'),
},
});
});

test('Should assign `baggage` header which contains sentry trace baggage data of an outgoing request.', async () => {
const url = await runServer(__dirname, `${path.resolve(__dirname, '..')}/server.ts`);

const response = (await getAPIResponse(new URL(`${url}/express`), {
baggage: 'sentry-version=1.0.0,sentry-environment=production',
})) as TestAPIResponse;

expect(response).toBeDefined();
expect(response).toMatchObject({
test_data: {
host: 'somewhere.not.sentry',
baggage: expect.stringContaining('sentry-version=1.0.0,sentry-environment=production'),
},
});
});

test('Should assign `baggage` header which contains sentry and 3rd party trace baggage data of an outgoing request.', async () => {
const url = await runServer(__dirname, `${path.resolve(__dirname, '..')}/server.ts`);

const response = (await getAPIResponse(new URL(`${url}/express`), {
baggage: 'sentry-version=1.0.0,sentry-environment=production,dogs=great',
})) as TestAPIResponse;

expect(response).toBeDefined();
expect(response).toMatchObject({
test_data: {
host: 'somewhere.not.sentry',
baggage: expect.stringContaining('dogs=great,sentry-version=1.0.0,sentry-environment=production'),
},
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as path from 'path';

import { getAPIResponse, runServer } from '../../../../utils/index';
import { TestAPIResponse } from '../server';

test('should attach a `baggage` header to an outgoing request.', async () => {
const url = await runServer(__dirname, `${path.resolve(__dirname, '..')}/server.ts`);

const response = (await getAPIResponse(new URL(`${url}/express`))) as TestAPIResponse;

expect(response).toBeDefined();
expect(response).toMatchObject({
test_data: {
host: 'somewhere.not.sentry',
// TODO this is currently still empty but eventually it should contain sentry data
baggage: expect.stringMatching(''),
},
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import http from 'http';

const app = express();

export type TestAPIResponse = { test_data: { host: string; 'sentry-trace': string } };
export type TestAPIResponse = { test_data: { host: string; 'sentry-trace': string; baggage: string } };

Sentry.init({
dsn: 'https://[email protected]/1337',
Expand Down
9 changes: 5 additions & 4 deletions packages/node/src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
isString,
logger,
normalize,
parseBaggageString,
stripUrlQueryAndFragment,
} from '@sentry/utils';
import * as cookie from 'cookie';
Expand Down Expand Up @@ -61,16 +62,16 @@ export function tracingHandler(): (
next: (error?: any) => void,
): void {
// If there is a trace header set, we extract the data from it (parentSpanId, traceId, and sampling decision)
let traceparentData;
if (req.headers && isString(req.headers['sentry-trace'])) {
traceparentData = extractTraceparentData(req.headers['sentry-trace']);
}
const traceparentData =
req.headers && isString(req.headers['sentry-trace']) && extractTraceparentData(req.headers['sentry-trace']);
const baggage = req.headers && isString(req.headers.baggage) && parseBaggageString(req.headers.baggage);

const transaction = startTransaction(
{
name: extractExpressTransactionName(req, { path: true, method: true }),
op: 'http.server',
...traceparentData,
...(baggage && { metadata: { baggage: baggage } }),
},
// extra context passed to the tracesSampler
{ request: extractRequestData(req) },
Expand Down
11 changes: 9 additions & 2 deletions packages/node/src/integrations/http.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getCurrentHub } from '@sentry/core';
import { Integration, Span } from '@sentry/types';
import { fill, logger, parseSemver } from '@sentry/utils';
import { fill, logger, mergeAndSerializeBaggage, parseSemver } from '@sentry/utils';
import * as http from 'http';
import * as https from 'https';

Expand Down Expand Up @@ -123,7 +123,14 @@ function _createWrappedRequestMethodFactory(
logger.log(
`[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to ${requestUrl}: `,
);
requestOptions.headers = { ...requestOptions.headers, 'sentry-trace': sentryTraceHeader };

const headerBaggageString = requestOptions.headers && (requestOptions.headers.baggage as string);

requestOptions.headers = {
...requestOptions.headers,
'sentry-trace': sentryTraceHeader,
baggage: mergeAndSerializeBaggage(span.getBaggage(), headerBaggageString),
};
}
}

Expand Down
37 changes: 36 additions & 1 deletion packages/node/test/handlers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as sentryCore from '@sentry/core';
import * as sentryHub from '@sentry/hub';
import { Hub } from '@sentry/hub';
import { Transaction } from '@sentry/tracing';
import { Runtime } from '@sentry/types';
import { Baggage, Runtime } from '@sentry/types';
import { SentryError } from '@sentry/utils';
import * as http from 'http';
import * as net from 'net';
Expand Down Expand Up @@ -368,6 +368,41 @@ describe('tracingHandler', () => {
expect(transaction.traceId).toEqual('12312012123120121231201212312012');
expect(transaction.parentSpanId).toEqual('1121201211212012');
expect(transaction.sampled).toEqual(false);
expect(transaction.metadata?.baggage).toBeUndefined();
});

it("pulls parent's data from tracing and baggage headers on the request", () => {
req.headers = {
'sentry-trace': '12312012123120121231201212312012-1121201211212012-0',
baggage: 'sentry-version=1.0,sentry-environment=production',
};

sentryTracingMiddleware(req, res, next);

const transaction = (res as any).__sentry_transaction;

// since we have no tracesSampler defined, the default behavior (inherit if possible) applies
expect(transaction.traceId).toEqual('12312012123120121231201212312012');
expect(transaction.parentSpanId).toEqual('1121201211212012');
expect(transaction.sampled).toEqual(false);
expect(transaction.metadata?.baggage).toBeDefined();
expect(transaction.metadata?.baggage).toEqual([{ version: '1.0', environment: 'production' }, ''] as Baggage);
});

it("pulls parent's baggage (sentry + third party entries) headers on the request", () => {
req.headers = {
baggage: 'sentry-version=1.0,sentry-environment=production,dogs=great,cats=boring',
};

sentryTracingMiddleware(req, res, next);

const transaction = (res as any).__sentry_transaction;

expect(transaction.metadata?.baggage).toBeDefined();
expect(transaction.metadata?.baggage).toEqual([
{ version: '1.0', environment: 'production' },
'dogs=great,cats=boring',
] as Baggage);
});

it('extracts request data for sampling context', () => {
Expand Down
37 changes: 37 additions & 0 deletions packages/node/test/integrations/http.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,43 @@ describe('tracing', () => {

expect(sentryTraceHeader).not.toBeDefined();
});

it('attaches the baggage header to outgoing non-sentry requests', async () => {
nock('http://dogs.are.great').get('/').reply(200);

createTransactionOnScope();

const request = http.get('http://dogs.are.great/');
const baggageHeader = request.getHeader('baggage') as string;

expect(baggageHeader).toBeDefined();
// this might change once we actually add our baggage data to the header
expect(baggageHeader).toEqual('');
});

it('propagates 3rd party baggage header data to outgoing non-sentry requests', async () => {
nock('http://dogs.are.great').get('/').reply(200);

createTransactionOnScope();

const request = http.get({ host: 'http://dogs.are.great/', headers: { baggage: 'dog=great' } });
const baggageHeader = request.getHeader('baggage') as string;

expect(baggageHeader).toBeDefined();
// this might change once we actually add our baggage data to the header
expect(baggageHeader).toEqual('dog=great');
});

it("doesn't attach the sentry-trace header to outgoing sentry requests", () => {
nock('http://squirrelchasers.ingest.sentry.io').get('/api/12312012/store/').reply(200);

createTransactionOnScope();

const request = http.get('http://squirrelchasers.ingest.sentry.io/api/12312012/store/');
const baggage = request.getHeader('baggage');

expect(baggage).not.toBeDefined();
});
});

describe('default protocols', () => {
Expand Down
9 changes: 8 additions & 1 deletion packages/serverless/src/awslambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@sentry/node';
import { extractTraceparentData } from '@sentry/tracing';
import { Integration } from '@sentry/types';
import { extensionRelayDSN, isString, logger } from '@sentry/utils';
import { extensionRelayDSN, isString, logger, parseBaggageString } from '@sentry/utils';
// NOTE: I have no idea how to fix this right now, and don't want to waste more time, as it builds just fine — Kamil
// eslint-disable-next-line import/no-unresolved
import { Context, Handler } from 'aws-lambda';
Expand Down Expand Up @@ -288,10 +288,17 @@ export function wrapHandler<TEvent, TResult>(
if (eventWithHeaders.headers && isString(eventWithHeaders.headers['sentry-trace'])) {
traceparentData = extractTraceparentData(eventWithHeaders.headers['sentry-trace']);
}

const baggage =
eventWithHeaders.headers &&
isString(eventWithHeaders.headers.baggage) &&
parseBaggageString(eventWithHeaders.headers.baggage);

const transaction = startTransaction({
name: context.functionName,
op: 'awslambda.handler',
...traceparentData,
...(baggage && { metadata: { baggage: baggage } }),
});

const hub = getCurrentHub();
Expand Down
Loading