添加sentry监控报错

This commit is contained in:
yezian 2024-03-23 12:46:42 +08:00
parent 30414ab99d
commit 703f5abb94
5 changed files with 221 additions and 5 deletions

12
App.jsx
View File

@ -46,6 +46,7 @@ import baseRequest from "./utils/baseRequest";
import { generateSignature } from "./utils/crypto";
import * as Clipboard from "expo-clipboard";
import PrivatyModal from "./components/PrivatyModal";
import * as Sentry from "@sentry/react-native";
const RootStack = createNativeStackNavigator();
@ -53,7 +54,12 @@ export const AuthContext = createContext("");
SplashScreen.preventAutoHideAsync();
export default function App() {
Sentry.init({
dsn: "https://decf8ef204a5d5144c27608bf86851ce@o4506958331904000.ingest.us.sentry.io/4506958351630336",
debug: false, // If `true`, Sentry will try to print out useful debugging information if something goes wrong with sending the event. Set it to `false` in production
});
const App = () => {
//app
const MyTheme = {
...DefaultTheme,
@ -633,4 +639,6 @@ export default function App() {
</AuthContext.Provider>
</TailwindProvider>
);
}
};
export default Sentry.wrap(App);

View File

@ -56,6 +56,13 @@
"savePhotosPermission": "允许铁粉空间保存图片到相册",
"isAccessMediaLocationEnabled": true
}
],
[
"@sentry/react-native/expo",
{
"organization": "chengdu-xinyidaole-technology",
"project": "tiefen_space_app"
}
]
],
"extra": {

7
metro.config.js Normal file
View File

@ -0,0 +1,7 @@
// This replaces `const { getDefaultConfig } = require('expo/metro-config');`
const { getSentryExpoConfig } = require("@sentry/react-native/metro");
// This replaces `const config = getDefaultConfig(__dirname);`
const config = getSentryExpoConfig(__dirname);
module.exports = config;

View File

@ -28,6 +28,7 @@
"@react-navigation/native-stack": "^6.9.13",
"@rneui/base": "^4.0.0-rc.8",
"@rneui/themed": "^4.0.0-rc.8",
"@sentry/react-native": "5.19.1",
"@shopify/flash-list": "1.6.3",
"dayjs": "^1.11.9",
"expo": "^50.0.14",

199
yarn.lock
View File

@ -2222,6 +2222,175 @@
component-type "^1.2.1"
join-component "^1.1.0"
"@sentry-internal/feedback@7.100.1":
version "7.100.1"
resolved "https://registry.npmmirror.com/@sentry-internal/feedback/-/feedback-7.100.1.tgz#99585ba6f71eca3e7afe918273dd55b12f3aac8a"
integrity sha512-yqcRVnjf+qS+tC4NxOKLJOaSJ+csHmh/dHUzvCTkf5rLsplwXYRnny2r0tqGTQ4tuXMxwgSMKPYwicg81P+xuw==
dependencies:
"@sentry/core" "7.100.1"
"@sentry/types" "7.100.1"
"@sentry/utils" "7.100.1"
"@sentry-internal/replay-canvas@7.100.1":
version "7.100.1"
resolved "https://registry.npmmirror.com/@sentry-internal/replay-canvas/-/replay-canvas-7.100.1.tgz#d37228575931b869d2ad415af46b342d83dd0fd7"
integrity sha512-TnqxqJGhbFhhYRhTG2WLFer+lVieV7mNGeIxFBiw1L4kuj8KGl+C0sknssKyZSRVJFSahhHIosHJGRMkkD//7g==
dependencies:
"@sentry/core" "7.100.1"
"@sentry/replay" "7.100.1"
"@sentry/types" "7.100.1"
"@sentry/utils" "7.100.1"
"@sentry-internal/tracing@7.100.1":
version "7.100.1"
resolved "https://registry.npmmirror.com/@sentry-internal/tracing/-/tracing-7.100.1.tgz#4329492e50c390567197a4acbf7e3672b1db7820"
integrity sha512-+u9RRf5eL3StiyiRyAHZmdkAR7GTSGx4Mt4Lmi5NEtCcWlTGZ1QgW2r8ZbhouVmTiJkjhQgYCyej3cojtazeJg==
dependencies:
"@sentry/core" "7.100.1"
"@sentry/types" "7.100.1"
"@sentry/utils" "7.100.1"
"@sentry/browser@7.100.1":
version "7.100.1"
resolved "https://registry.npmmirror.com/@sentry/browser/-/browser-7.100.1.tgz#146ffca94cc187ecbf49915ef3100f6037316110"
integrity sha512-IxHQ08ixf0bmaWpe4yt1J4UUsOpg02fxax9z3tOQYXw5MSzz5pDXn8M8DFUVJB3wWuyXhHXTub9yD3VIP9fnoA==
dependencies:
"@sentry-internal/feedback" "7.100.1"
"@sentry-internal/replay-canvas" "7.100.1"
"@sentry-internal/tracing" "7.100.1"
"@sentry/core" "7.100.1"
"@sentry/replay" "7.100.1"
"@sentry/types" "7.100.1"
"@sentry/utils" "7.100.1"
"@sentry/cli-darwin@2.25.2":
version "2.25.2"
resolved "https://registry.npmmirror.com/@sentry/cli-darwin/-/cli-darwin-2.25.2.tgz#9fd935aa0381acbf2e22aef23eddc90d6efc1d97"
integrity sha512-o1d5NnVUrc1dxDm56k7Co8tSTcOuxbApdxweVXXsiq20HblZCyIi7WxxRkAg4RfKx594sKGiw9uCVvECi+9UpA==
"@sentry/cli-linux-arm64@2.25.2":
version "2.25.2"
resolved "https://registry.npmmirror.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.25.2.tgz#4a442d55f4e0a849b6faebd151d0d2277abf5de9"
integrity sha512-lm5jaigV6xu9Gwo0wNk+bX6yVkl5k3gNXcSXcKCISFo+Teb7Zhf9IyXANPm4VY2DdiZAjPJt8gS1bu+Mn7irtQ==
"@sentry/cli-linux-arm@2.25.2":
version "2.25.2"
resolved "https://registry.npmmirror.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.25.2.tgz#053430a6508450b382fc980195cbd5cc0fe90d86"
integrity sha512-n398jd87Ymejt5k/6RjCEjXAvntOWuqhBDANxzhgr5/9FzbODJ844g1mOpcxiIlduzKSzWlPbTEKQulMp2Mt4w==
"@sentry/cli-linux-i686@2.25.2":
version "2.25.2"
resolved "https://registry.npmmirror.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.25.2.tgz#ce72717f48890984a805c82d116a9da115fc53a1"
integrity sha512-/YYx2gfqO5mkxyBgFcnDbZzkZ2+2xNarwrqWcqq3Qw0XlO9DWAQB2G+twV1RW/UfSU6fFIWErn94efh2EWmyzQ==
"@sentry/cli-linux-x64@2.25.2":
version "2.25.2"
resolved "https://registry.npmmirror.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.25.2.tgz#fb178ac3540f64595a17dd95b4b2071f18aa098a"
integrity sha512-rRafqy84R5mYA4JEfNsUeN10af5euJnK7fgqYM0mJIaplHC2YEXT9aUYWoryWPZiYqmdNUhsA6lX7iynSW9pZw==
"@sentry/cli-win32-i686@2.25.2":
version "2.25.2"
resolved "https://registry.npmmirror.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.25.2.tgz#e0d73977771a578439207ea7863cde422a6cfee2"
integrity sha512-plT/gi41F+67g9AwrEm4avRXnjCtHCcnRnJ6zPu/iINGap8mvYQJSU/qM0oGwV6hRGg3JJN66XIvJPIuIs8P8w==
"@sentry/cli-win32-x64@2.25.2":
version "2.25.2"
resolved "https://registry.npmmirror.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.25.2.tgz#f21f71e7c2c60f99dd62c3360e4b0cda4f27d877"
integrity sha512-Mb6mAyPi9gIfpzF5MTk0JXgFP9nxka3Fb7JYn6AY4RW++sOjapkTrcXL2Gp3ZfQkWj5rFTgln4+eNmZPsD2gzA==
"@sentry/cli@2.25.2":
version "2.25.2"
resolved "https://registry.npmmirror.com/@sentry/cli/-/cli-2.25.2.tgz#7e8eec38c19ee27cb3f5c5a7ba3e80ad587c6517"
integrity sha512-lgt1QPaCfs/QZNXwyw3gvuBR2/CLwFSdU/oT7Bpxwizz8XVXhlKS98zJF1UVCy7SecsDSoOI0Z+B+X658cpquQ==
dependencies:
https-proxy-agent "^5.0.0"
node-fetch "^2.6.7"
progress "^2.0.3"
proxy-from-env "^1.1.0"
which "^2.0.2"
optionalDependencies:
"@sentry/cli-darwin" "2.25.2"
"@sentry/cli-linux-arm" "2.25.2"
"@sentry/cli-linux-arm64" "2.25.2"
"@sentry/cli-linux-i686" "2.25.2"
"@sentry/cli-linux-x64" "2.25.2"
"@sentry/cli-win32-i686" "2.25.2"
"@sentry/cli-win32-x64" "2.25.2"
"@sentry/core@7.100.1":
version "7.100.1"
resolved "https://registry.npmmirror.com/@sentry/core/-/core-7.100.1.tgz#7b8e101a931af8e8b3b2449534749f882772df4f"
integrity sha512-f+ItUge/o9AjlveQq0ZUbQauKlPH1FIJbC1TRaYLJ4KNfOdrsh8yZ29RmWv0cFJ/e+FGTr603gWpRPObF5rM8Q==
dependencies:
"@sentry/types" "7.100.1"
"@sentry/utils" "7.100.1"
"@sentry/hub@7.100.1":
version "7.100.1"
resolved "https://registry.npmmirror.com/@sentry/hub/-/hub-7.100.1.tgz#aacc7608c5b6c056f1ca83ae877de6a9c122d403"
integrity sha512-zdt7f1k+5JE5FAunzBZUEFbvK5YP/LekLMeogTonaRObB07J6fJ9FD4mtNk7pV0utrTDwR+n942qmp+LbWauWA==
dependencies:
"@sentry/core" "7.100.1"
"@sentry/types" "7.100.1"
"@sentry/utils" "7.100.1"
"@sentry/integrations@7.100.1":
version "7.100.1"
resolved "https://registry.npmmirror.com/@sentry/integrations/-/integrations-7.100.1.tgz#f0361a437877a33af389424313b58d5a57d7ad27"
integrity sha512-RUyZHcsN3Plc8G4hJN3BCMdbwS8ljUY3E3iLjzucA4HroBsGk5AMc6n7Pp/QqFIRgxrPjKEgA52Wgy5Nq6dSvw==
dependencies:
"@sentry/core" "7.100.1"
"@sentry/types" "7.100.1"
"@sentry/utils" "7.100.1"
localforage "^1.8.1"
"@sentry/react-native@5.19.1":
version "5.19.1"
resolved "https://registry.npmmirror.com/@sentry/react-native/-/react-native-5.19.1.tgz#31635328fd6578daaf815be4fe3a9bf5bbaff7b4"
integrity sha512-i2vfbvTkohsXvvMMCozeVOrwS07zVtvwYsvooEZOvQIgq/c41QQ4LmbZK7efLrfUsxkk3MsISwMVma+MncqTHA==
dependencies:
"@sentry/browser" "7.100.1"
"@sentry/cli" "2.25.2"
"@sentry/core" "7.100.1"
"@sentry/hub" "7.100.1"
"@sentry/integrations" "7.100.1"
"@sentry/react" "7.100.1"
"@sentry/types" "7.100.1"
"@sentry/utils" "7.100.1"
"@sentry/react@7.100.1":
version "7.100.1"
resolved "https://registry.npmmirror.com/@sentry/react/-/react-7.100.1.tgz#a8621f2124848b6a7bb1fc6279167f5e3cbc44f1"
integrity sha512-EdrBtrXVLK2LSx4Rvz/nQP7HZUZQmr+t3GHV8436RAhF6vs5mntACVMBoQJRWiUvtZ1iRo3rIsIdah7DLiFPgQ==
dependencies:
"@sentry/browser" "7.100.1"
"@sentry/core" "7.100.1"
"@sentry/types" "7.100.1"
"@sentry/utils" "7.100.1"
hoist-non-react-statics "^3.3.2"
"@sentry/replay@7.100.1":
version "7.100.1"
resolved "https://registry.npmmirror.com/@sentry/replay/-/replay-7.100.1.tgz#d9af5f8e92ce0f93cef89f5aef74d91a8d12c3eb"
integrity sha512-B1NFjzGEFaqejxBRdUyEzH8ChXc2kfiqlA/W/Lg0aoWIl2/7nuMk+l4ld9gW5F5bIAXDTVd5vYltb1lWEbpr7w==
dependencies:
"@sentry-internal/tracing" "7.100.1"
"@sentry/core" "7.100.1"
"@sentry/types" "7.100.1"
"@sentry/utils" "7.100.1"
"@sentry/types@7.100.1":
version "7.100.1"
resolved "https://registry.npmmirror.com/@sentry/types/-/types-7.100.1.tgz#1349b77269cecf4e80c087842575bd1a001e9995"
integrity sha512-fLM+LedHuKzOd8IhXBqaQuym+AA519MGjeczBa5kGakes/BbAsUMwsNfjsKQedp7Kh44RgYF99jwoRPK2oDrXw==
"@sentry/utils@7.100.1":
version "7.100.1"
resolved "https://registry.npmmirror.com/@sentry/utils/-/utils-7.100.1.tgz#6e26f3b06b1e485a2180f464ab3374ecb8d5e407"
integrity sha512-Ve6dXr1o6xiBe3VCoJgiutmBKrugryI65EZAbYto5XI+t+PjiLLf9wXtEMF24ZrwImo4Lv3E9Uqza+fWkEbw6A==
dependencies:
"@sentry/types" "7.100.1"
"@shopify/flash-list@1.6.3":
version "1.6.3"
resolved "https://registry.npmmirror.com/@shopify/flash-list/-/flash-list-1.6.3.tgz#463dc1703815bf916f8173afc22c852bf26337ad"
@ -4357,7 +4526,7 @@ http-errors@2.0.0:
statuses "2.0.1"
toidentifier "1.0.1"
https-proxy-agent@^5.0.1:
https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1:
version "5.0.1"
resolved "https://registry.npmmirror.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6"
integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==
@ -4392,6 +4561,11 @@ image-size@^1.0.2:
dependencies:
queue "6.0.2"
immediate@~3.0.5:
version "3.0.6"
resolved "https://registry.npmmirror.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==
import-fresh@^2.0.0:
version "2.0.0"
resolved "https://registry.npmmirror.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546"
@ -4863,6 +5037,13 @@ leven@^3.1.0:
resolved "https://registry.npmmirror.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2"
integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==
lie@3.1.1:
version "3.1.1"
resolved "https://registry.npmmirror.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e"
integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==
dependencies:
immediate "~3.0.5"
lighthouse-logger@^1.0.0:
version "1.4.2"
resolved "https://registry.npmmirror.com/lighthouse-logger/-/lighthouse-logger-1.4.2.tgz#aef90f9e97cd81db367c7634292ee22079280aaa"
@ -4937,6 +5118,13 @@ lines-and-columns@^1.1.6:
resolved "https://registry.npmmirror.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
localforage@^1.8.1:
version "1.10.0"
resolved "https://registry.npmmirror.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4"
integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==
dependencies:
lie "3.1.1"
locate-path@^3.0.0:
version "3.0.0"
resolved "https://registry.npmmirror.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
@ -6010,7 +6198,7 @@ process-nextick-args@~2.0.0:
resolved "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
progress@2.0.3:
progress@2.0.3, progress@^2.0.3:
version "2.0.3"
resolved "https://registry.npmmirror.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
@ -6060,6 +6248,11 @@ prop-types@15.8.1, prop-types@^15.5.10, prop-types@^15.7.x, prop-types@^15.8.1:
object-assign "^4.1.1"
react-is "^16.13.1"
proxy-from-env@^1.1.0:
version "1.1.0"
resolved "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
pump@^3.0.0:
version "3.0.0"
resolved "https://registry.npmmirror.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
@ -7571,7 +7764,7 @@ which@^1.2.9:
dependencies:
isexe "^2.0.0"
which@^2.0.1:
which@^2.0.1, which@^2.0.2:
version "2.0.2"
resolved "https://registry.npmmirror.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==