Skip to content

Commit

Permalink
Merge branch 'main' into kw-parse-native-cause
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich committed Aug 11, 2023
2 parents 8163cb0 + a36d5e1 commit 949dc8b
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 96 deletions.
26 changes: 20 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
contain native JVM or Objective-C exception stack trace. Both JS and native stack trace
are processed by default no configuration needed.

- Add `tracePropagationTargets` option ([#3230](https://github.com/getsentry/sentry-react-native/pull/3230))

This release adds support for [distributed tracing](https://docs.sentry.io/platforms/react-native/usage/distributed-tracing/)
without requiring performance monitoring to be active on the React Native SDK.
This means even if there is no sampled transaction/span, the SDK will still propagate traces to downstream services.
Distributed Tracing can be configured with the `tracePropagationTargets` option,
which controls what requests to attach the `sentry-trace` and `baggage` HTTP headers to (which is what propagates tracing information).

```javascript
Sentry.init({
tracePropagationTargets: ["third-party-site.com", /^https:\/\/yourserver\.io\/api/],
});
```

### Fixes

- `Sentry.init` must be called before `Sentry.wrap`([#3227](https://github.com/getsentry/sentry-react-native/pull/3227))
Expand All @@ -26,12 +40,12 @@
- Bump Cocoa SDK from v8.9.3 to v8.9.4 ([#3225](https://github.com/getsentry/sentry-react-native/pull/3225))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#894)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.9.3...8.9.4)
- Bump JavaScript SDK from v7.61.0 to v7.62.0 ([#3226](https://github.com/getsentry/sentry-react-native/pull/3226))
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7620)
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.61.0...7.62.0)
- Bump CLI from v2.19.4 to v2.20.4 ([#3212](https://github.com/getsentry/sentry-react-native/pull/3212))
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2204)
- [diff](https://github.com/getsentry/sentry-cli/compare/2.19.4...2.20.4)
- Bump JavaScript SDK from v7.61.0 to v7.63.0 ([#3226](https://github.com/getsentry/sentry-react-native/pull/3226), [#3235](https://github.com/getsentry/sentry-react-native/pull/3235))
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7630)
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.61.0...7.63.0)
- Bump CLI from v2.19.4 to v2.20.5 ([#3212](https://github.com/getsentry/sentry-react-native/pull/3212), [#3233](https://github.com/getsentry/sentry-react-native/pull/3233))
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2205)
- [diff](https://github.com/getsentry/sentry-cli/compare/2.19.4...2.20.5)

## 5.8.1

Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@
"react-native": ">=0.65.0"
},
"dependencies": {
"@sentry/browser": "7.62.0",
"@sentry/cli": "2.20.4",
"@sentry/core": "7.62.0",
"@sentry/hub": "7.62.0",
"@sentry/integrations": "7.62.0",
"@sentry/react": "7.62.0",
"@sentry/types": "7.62.0",
"@sentry/utils": "7.62.0"
"@sentry/browser": "7.63.0",
"@sentry/cli": "2.20.5",
"@sentry/core": "7.63.0",
"@sentry/hub": "7.63.0",
"@sentry/integrations": "7.63.0",
"@sentry/react": "7.63.0",
"@sentry/types": "7.63.0",
"@sentry/utils": "7.63.0"
},
"devDependencies": {
"@sentry-internal/eslint-config-sdk": "7.62.0",
"@sentry-internal/eslint-plugin-sdk": "7.62.0",
"@sentry-internal/eslint-config-sdk": "7.63.0",
"@sentry-internal/eslint-plugin-sdk": "7.63.0",
"@sentry/typescript": "^5.20.1",
"@sentry/wizard": "3.9.1",
"@types/jest": "^29.5.3",
Expand Down
2 changes: 1 addition & 1 deletion sample-new-architecture/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ Sentry.init({
// The time to wait in ms until the transaction will be finished, For testing, default is 1000 ms
idleTimeout: 5000,
routingInstrumentation: reactNavigationInstrumentation,
tracingOrigins: ['localhost', /^\//, /^https:\/\//],
enableUserInteractionTracing: true,
beforeNavigate: (context: Sentry.ReactNavigationTransactionContext) => {
// Example of not sending a transaction for the screen with the name "Manual Tracker"
Expand Down Expand Up @@ -75,6 +74,7 @@ Sentry.init({
// This will capture ALL TRACES and likely use up all your quota
enableTracing: true,
tracesSampleRate: 1.0,
tracePropagationTargets: ['localhost', /^\//, /^https:\/\//, /^http:\/\//],
attachStacktrace: true,
// Attach screenshots to events.
attachScreenshot: true,
Expand Down
23 changes: 22 additions & 1 deletion src/js/tracing/reactnativetracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ export class ReactNativeTracing implements Integration {
addGlobalEventProcessor: (callback: EventProcessor) => void,
getCurrentHub: () => Hub,
): void {
const hub = getCurrentHub();
const client = hub.getClient();
const clientOptions = client && client.getOptions();

// eslint-disable-next-line @typescript-eslint/unbound-method
const {
traceFetch,
Expand All @@ -173,7 +177,7 @@ export class ReactNativeTracing implements Integration {
tracingOrigins,
// @ts-ignore TODO
shouldCreateSpanForRequest,
tracePropagationTargets,
tracePropagationTargets: thisOptionsTracePropagationTargets,
routingInstrumentation,
enableAppStartTracking,
enableNativeFramesTracking,
Expand All @@ -182,6 +186,23 @@ export class ReactNativeTracing implements Integration {

this._getCurrentHub = getCurrentHub;

const clientOptionsTracePropagationTargets = clientOptions && clientOptions.tracePropagationTargets;
// There are three ways to configure tracePropagationTargets:
// 1. via top level client option `tracePropagationTargets`
// 2. via ReactNativeTracing option `tracePropagationTargets`
// 3. via ReactNativeTracing option `tracingOrigins` (deprecated)
//
// To avoid confusion, favour top level client option `tracePropagationTargets`, and fallback to
// ReactNativeTracing option `tracePropagationTargets` and then `tracingOrigins` (deprecated).
//
// If both 1 and either one of 2 or 3 are set (from above), we log out a warning.
const tracePropagationTargets = clientOptionsTracePropagationTargets || thisOptionsTracePropagationTargets;
if (__DEV__ && (thisOptionsTracePropagationTargets || tracingOrigins) && clientOptionsTracePropagationTargets) {
logger.warn(
'[ReactNativeTracing] The `tracePropagationTargets` option was set in the ReactNativeTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.',
);
}

if (enableAppStartTracking) {
void this._instrumentAppStart();
}
Expand Down
156 changes: 78 additions & 78 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1939,13 +1939,13 @@
invariant "^2.2.4"
nullthrows "^1.1.1"

"@sentry-internal/eslint-config-sdk@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/eslint-config-sdk/-/eslint-config-sdk-7.62.0.tgz#6cf5eee54a952ef32e29142813ff0bd1aba0ce51"
integrity sha512-/ne9AH73hlai5yJyFu2a0N/yv//dQr+ZaNH5tSbmXH4L2EqMMKnKmn49fnPjbgAW4fFGtHEYdiLCsJzz4PZ+gw==
"@sentry-internal/eslint-config-sdk@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/eslint-config-sdk/-/eslint-config-sdk-7.63.0.tgz#b8f80ccf13051f3770347a507069a01ec407c4c7"
integrity sha512-H8VfcRu/Z8omSf5LeixeUiwfEYm4SQ6UlyjRAzzITWfgExySHxbD97V58q7AhoYOxsQ18B0UyR+m9piC9xkthA==
dependencies:
"@sentry-internal/eslint-plugin-sdk" "7.62.0"
"@sentry-internal/typescript" "7.62.0"
"@sentry-internal/eslint-plugin-sdk" "7.63.0"
"@sentry-internal/typescript" "7.63.0"
"@typescript-eslint/eslint-plugin" "^5.48.0"
"@typescript-eslint/parser" "^5.48.0"
eslint-config-prettier "^6.11.0"
Expand All @@ -1955,10 +1955,10 @@
eslint-plugin-jsdoc "^30.0.3"
eslint-plugin-simple-import-sort "^5.0.3"

"@sentry-internal/eslint-plugin-sdk@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/eslint-plugin-sdk/-/eslint-plugin-sdk-7.62.0.tgz#41ea0396303514ef19c9e244e91d01da3084bbd1"
integrity sha512-FLJSWD7NZkQk74zidaP1ECtMazaSOjMgqq98b85eHoTgnemxJNCjGixYY408G2QMnAG40P1foMqdu11FbMC9aA==
"@sentry-internal/eslint-plugin-sdk@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/eslint-plugin-sdk/-/eslint-plugin-sdk-7.63.0.tgz#1ff0beb3866b124c072c50880fdabd8783b313cc"
integrity sha512-tDvNksUhvmh7bJSvocs0PNXffiM0aJ4TGlKl4jXUG2qLPbUALM2QxMhNs3CeXXf+qAvWidy0+nYz2jM0jQ6zQg==
dependencies:
requireindex "~1.1.0"

Expand All @@ -1972,37 +1972,37 @@
"@sentry/utils" "7.61.1"
tslib "^2.4.1 || ^1.9.3"

"@sentry-internal/tracing@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.62.0.tgz#f14400f20a32844f2895a8a333080d52fa32cd1d"
integrity sha512-LHT8i2c93JhQ1uBU1cqb5AIhmHPWlyovE4ZQjqEizk6Fk7jXc9L8kKhaIWELVPn8Xg6YtfGWhRBZk3ssj4JpfQ==
"@sentry-internal/tracing@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.63.0.tgz#58903b2205456034611cc5bc1b5b2479275f89c7"
integrity sha512-Fxpc53p6NGvLSURg3iRvZA0k10K9yfeVhtczvJnpX30POBuV41wxpkLHkb68fjksirjEma1K3Ut1iLOEEDpPQg==
dependencies:
"@sentry/core" "7.62.0"
"@sentry/types" "7.62.0"
"@sentry/utils" "7.62.0"
"@sentry/core" "7.63.0"
"@sentry/types" "7.63.0"
"@sentry/utils" "7.63.0"
tslib "^2.4.1 || ^1.9.3"

"@sentry-internal/typescript@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/typescript/-/typescript-7.62.0.tgz#24bb69606a444ae5b1a251e0595c70f3d5fe4d89"
integrity sha512-HbbbdlyftQ8cIh5EWlediOl2jRUirJzy/Z5QhO8heS4unA0KsND3iQj+JwAq1AWdz5BV8qHK/EUxpABMrHp8Ng==

"@sentry/browser@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.62.0.tgz#0b00a0ed8e4cd4873f7ec413b094ec6b170bb085"
integrity sha512-e52EPiRtPTZv+9iFIZT3n8qNozc8ymqT0ra7QwkwbVuF9fWSCOc1gzkTa9VKd/xwcGzOfglozl2O+Zz4GtoGUg==
dependencies:
"@sentry-internal/tracing" "7.62.0"
"@sentry/core" "7.62.0"
"@sentry/replay" "7.62.0"
"@sentry/types" "7.62.0"
"@sentry/utils" "7.62.0"
"@sentry-internal/typescript@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/typescript/-/typescript-7.63.0.tgz#534413543109a68e692f3b4ad17481817c33b934"
integrity sha512-df3TIs6ZwinG5vJB/+DU243aj18x5rN+7XcjUFcebHomC/CM0ZewsX/7tqSU6nyEApDBi/w9rYjAB3gBio5MNQ==

"@sentry/browser@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.63.0.tgz#d7eee4be7bfff015f050bca83cafb111dc13d40d"
integrity sha512-P1Iw/2281C/7CUCRsN4jgXvjMNKnrwKqxRg7JqN8eVeCDPMpOeEPHNJ6YatEXdVLTKVn0JB7L63Q1prhFr8+SQ==
dependencies:
"@sentry-internal/tracing" "7.63.0"
"@sentry/core" "7.63.0"
"@sentry/replay" "7.63.0"
"@sentry/types" "7.63.0"
"@sentry/utils" "7.63.0"
tslib "^2.4.1 || ^1.9.3"

"@sentry/[email protected].4":
version "2.20.4"
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.20.4.tgz#755719aeaa58dbd3910ee23cc020decc16f5a5bf"
integrity sha512-mycBCKQmLdaJpSKpXc3IXrQwb5HLxrdjgJgLGbb8saFHIkXl/1ePH171j+REq4dIP1uetu0bdDgEYj6AQjkleQ==
"@sentry/[email protected].5":
version "2.20.5"
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.20.5.tgz#255a5388ca24c211a0eae01dcc4ad813a7ff335a"
integrity sha512-ZvWb86eF0QXH9C5Mbi87aUmr8SH848yEpXJmlM2AoBowpE9kKDnewCAKvyXUihojUFwCSEEjoJhrRMMgmCZqXA==
dependencies:
https-proxy-agent "^5.0.0"
node-fetch "^2.6.7"
Expand Down Expand Up @@ -2032,32 +2032,32 @@
"@sentry/utils" "7.61.1"
tslib "^2.4.1 || ^1.9.3"

"@sentry/core@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.62.0.tgz#3d9571741b052b1f2fa8fb8ae0088de8e79b4f4e"
integrity sha512-l6n+c3mSlWa+FhT/KBrAU1BtbaLYCljf5MuGlH6NKRpnBcrZCbzk8ZuFcSND+gr2SqxycQkhEWX1zxVHPDdZxw==
"@sentry/core@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.63.0.tgz#8c38da6ef3a1de6e364463a09bc703b196ecbba4"
integrity sha512-13Ljiq8hv6ieCkO+Am99/PljYJO5ynKT/hRQrWgGy9IIEgUr8sV3fW+1W6K4/3MCeOJou0HsiGBjOD1mASItVg==
dependencies:
"@sentry/types" "7.62.0"
"@sentry/utils" "7.62.0"
"@sentry/types" "7.63.0"
"@sentry/utils" "7.63.0"
tslib "^2.4.1 || ^1.9.3"

"@sentry/hub@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-7.62.0.tgz#28c9d25ab9c099f74f76d194564f9564306e0761"
integrity sha512-5hpFMfvCVGT4b2AnUuk/sCGNjsggN3eCjgcp1RbZT3W5bbWe6EBbV4s3G9PBrTJ8UMSYXSbjgp94V4efOCI6Dw==
"@sentry/hub@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-7.63.0.tgz#7bf9bbb5930c96d6c91f002029b4b64e66fcd42a"
integrity sha512-IDgNcoa+YiBbPrDwrZuzSP+vN9wvlQjLEL3OVn0OFaA6Q3X/Zs40JjRz4bTdKb9SjXbyeJ2boFr+4EFvGQoJ1Q==
dependencies:
"@sentry/core" "7.62.0"
"@sentry/types" "7.62.0"
"@sentry/utils" "7.62.0"
"@sentry/core" "7.63.0"
"@sentry/types" "7.63.0"
"@sentry/utils" "7.63.0"
tslib "^2.4.1 || ^1.9.3"

"@sentry/integrations@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.62.0.tgz#fad35d8de97890b35269d132636218ae157dab22"
integrity sha512-BNlW4xczhbL+zmmc8kFZunjKBrVYZsAltQ/gMuaHw5iiEr+chVMgQDQ2A9EVB7WEtuTJQ0XmeqofH2nAk2qYHg==
"@sentry/integrations@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.63.0.tgz#bf4268b524670fdbc290dc489de0069143b499c6"
integrity sha512-+P8GNqFZNH/yS/KPbvUfUDERneoRNUrqp9ayvvp8aq4cTtrBdM72CYgI21oG6cti42SSM1VDLYZomTV3ElPzSg==
dependencies:
"@sentry/types" "7.62.0"
"@sentry/utils" "7.62.0"
"@sentry/types" "7.63.0"
"@sentry/utils" "7.63.0"
localforage "^1.8.1"
tslib "^2.4.1 || ^1.9.3"

Expand All @@ -2075,35 +2075,35 @@
lru_map "^0.3.3"
tslib "^2.4.1 || ^1.9.3"

"@sentry/react@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.62.0.tgz#8fa7246ba61f57c007893d76dcd5784b4e12d34e"
integrity sha512-jCQEs6lYGQdqj6XXWdR+i5IzJMgrSzTFI/TSMSeTdAeldmppg7uuRuJlBJGaWsxoiwed539Vn3kitRswn1ugeA==
"@sentry/react@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.63.0.tgz#6d318191e13ccf7ebba4897d7258b4ea3bcf6c51"
integrity sha512-KFRjgADVE4aMI7gJmGnoSz65ZErQlz9xRB3vETWSyNOLprWXuQLPPtcDEn39BROtsDG4pLyYFaSDiD7o0+DyjQ==
dependencies:
"@sentry/browser" "7.62.0"
"@sentry/types" "7.62.0"
"@sentry/utils" "7.62.0"
"@sentry/browser" "7.63.0"
"@sentry/types" "7.63.0"
"@sentry/utils" "7.63.0"
hoist-non-react-statics "^3.3.2"
tslib "^2.4.1 || ^1.9.3"

"@sentry/replay@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.62.0.tgz#9131c24ae2e797ae47983834ba88b3b5c7f6e566"
integrity sha512-mSbqtV6waQAvWTG07uR211jft63HduRXdHq+1xuaKulDcZ9chOkYqOCMpL0HjRIANEiZRTDDKlIo4s+3jkY5Ug==
"@sentry/replay@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.63.0.tgz#989ae32ea028a5eca323786cc07294fedb1f0d45"
integrity sha512-ikeFVojuP9oDF103blZcj0Vvb4S50dV54BESMrMW2lYBoMMjvOd7AdL+iDHjn1OL05/mv1C6Oc8MovmvdjILVA==
dependencies:
"@sentry/core" "7.62.0"
"@sentry/types" "7.62.0"
"@sentry/utils" "7.62.0"
"@sentry/core" "7.63.0"
"@sentry/types" "7.63.0"
"@sentry/utils" "7.63.0"

"@sentry/[email protected]":
version "7.61.1"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.61.1.tgz#225912689459c92e62f0b6e3ff145f6dbf72ff0e"
integrity sha512-CpPKL+OfwYOduRX9AT3p+Ie1fftgcCPd5WofTVVq7xeWRuerOOf2iJd0v+8yHQ25omgres1YOttDkCcvQRn4Jw==

"@sentry/types@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.62.0.tgz#f15729f656459ffa3a5998fafe9d17ee7fb1c9ff"
integrity sha512-oPy/fIT3o2VQWLTq01R2W/jt13APYMqZCVa0IT3lF9lgxzgfTbeZl3nX2FgCcc8ntDZC0dVw03dL+wLvjPqQpQ==
"@sentry/types@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.63.0.tgz#8032029fee6f70e04b667646626a674b03e2f79b"
integrity sha512-pZNwJVW7RqNLGuTUAhoygt0c9zmc0js10eANAz0MstygJRhQI1tqPDuiELVdujPrbeL+IFKF+7NvRDAydR2Niw==

"@sentry/typescript@^5.20.1":
version "5.20.1"
Expand All @@ -2121,12 +2121,12 @@
"@sentry/types" "7.61.1"
tslib "^2.4.1 || ^1.9.3"

"@sentry/utils@7.62.0":
version "7.62.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.62.0.tgz#915501c6056d704a9625239a1f584a7b2e4492ea"
integrity sha512-12w+Lpvn2iaocgjf6AxhtBz7XG8iFE5aMyt9BTuQp1/7sOjtEVNHlDlGrHbtPqxNCmL2SEcmNHka1panLqWHDw==
"@sentry/utils@7.63.0":
version "7.63.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.63.0.tgz#7c598553b4dbb6e3740dc96bc7f112ec32edbe69"
integrity sha512-7FQv1RYAwnuTuarruP+1+Jd6YQuN7i/Y7KltwPMVEwU7j5mzYQaexLr/Jz1XIdR2KYVdkbXQyP8jj8BmA6u9Jw==
dependencies:
"@sentry/types" "7.62.0"
"@sentry/types" "7.63.0"
tslib "^2.4.1 || ^1.9.3"

"@sentry/[email protected]":
Expand Down

0 comments on commit 949dc8b

Please sign in to comment.