feat: add Sentry console logging integration and user report dialog
This commit is contained in:
parent
91931c9bda
commit
24ae266041
|
|
@ -29,6 +29,9 @@ export const initializeSentryBasic = (environment: string, dsn: string, extensio
|
|||
},
|
||||
},
|
||||
},
|
||||
integrations: [
|
||||
Sentry.consoleLoggingIntegration({ levels: ['log', 'info', 'warn', 'error', 'debug', 'assert', 'trace'] }),
|
||||
],
|
||||
environment: environment || 'development',
|
||||
dsn,
|
||||
sendDefaultPii: true,
|
||||
|
|
@ -47,10 +50,36 @@ export const initializeSentryBasic = (environment: string, dsn: string, extensio
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If there's an exception and an event id, present the user report dialog.
|
||||
if (event.event_id) {
|
||||
// Only attempt to show the dialog in a browser environment.
|
||||
if (typeof window !== 'undefined' && window.document) {
|
||||
// Dynamically import the package that exports showReportDialog to avoid
|
||||
// bundler errors when this shared lib is used in non-browser builds.
|
||||
import('@sentry/react')
|
||||
.then((mod) => {
|
||||
try {
|
||||
mod.showReportDialog({ eventId: event.event_id });
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Sentry.showReportDialog failed:', err);
|
||||
}
|
||||
})
|
||||
.catch((importErr) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Failed to import @sentry/react for report dialog:', importErr);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return event; // Send the event to Sentry
|
||||
},
|
||||
});
|
||||
} catch (err) {}
|
||||
} catch (err) {
|
||||
// Log initialization errors
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Sentry.init failed:', err);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@
|
|||
"@postiz/wallets": "^0.0.1",
|
||||
"@prisma/client": "6.5.0",
|
||||
"@sentry/nestjs": "^10.25.0",
|
||||
"@sentry/react": "^10.25.0",
|
||||
"@sentry/nextjs": "^10.25.0",
|
||||
"@sentry/profiling-node": "^10.25.0",
|
||||
"@solana/wallet-adapter-react": "^0.15.35",
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ importers:
|
|||
dependencies:
|
||||
'@ag-ui/mastra':
|
||||
specifier: 0.2.0
|
||||
version: 0.2.0(@ag-ui/client@0.0.41)(@ag-ui/core@0.0.37)(@copilotkit/runtime@1.10.6(9c0ec131fe3ef529a831958f12b4bf78))(@mastra/core@0.20.2(openapi-types@12.1.3)(react@18.3.1)(zod@3.25.76))(openapi-types@12.1.3)(react@18.3.1)(zod@3.25.76)
|
||||
version: 0.2.0(@ag-ui/client@0.0.41)(@ag-ui/core@0.0.41)(@copilotkit/runtime@1.10.6(6855d89fee41a5dd20a0f9576445cd9f))(@mastra/core@0.20.2(openapi-types@12.1.3)(react@18.3.1)(zod@3.25.76))(openapi-types@12.1.3)(react@18.3.1)(zod@3.25.76)
|
||||
'@ai-sdk/openai':
|
||||
specifier: ^2.0.52
|
||||
version: 2.0.68(zod@3.25.76)
|
||||
|
|
@ -38,7 +38,7 @@ importers:
|
|||
version: 1.10.6(@types/react@18.3.1)(graphql@16.12.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
'@copilotkit/runtime':
|
||||
specifier: 1.10.6
|
||||
version: 1.10.6(9c0ec131fe3ef529a831958f12b4bf78)
|
||||
version: 1.10.6(6855d89fee41a5dd20a0f9576445cd9f)
|
||||
'@hookform/resolvers':
|
||||
specifier: ^3.3.4
|
||||
version: 3.10.0(react-hook-form@7.66.1(react@18.3.1))
|
||||
|
|
@ -123,6 +123,9 @@ importers:
|
|||
'@sentry/profiling-node':
|
||||
specifier: ^10.25.0
|
||||
version: 10.26.0
|
||||
'@sentry/react':
|
||||
specifier: ^10.25.0
|
||||
version: 10.26.0(react@18.3.1)
|
||||
'@solana/wallet-adapter-react':
|
||||
specifier: ^0.15.35
|
||||
version: 0.15.39(@solana/web3.js@1.98.4(bufferutil@4.0.9)(typescript@5.5.4)(utf-8-validate@5.0.10))(bs58@6.0.0)(fastestsmallesttextencoderdecoder@1.0.22)(react-native@0.82.1(@babel/core@7.28.5)(@types/react@18.3.1)(bufferutil@4.0.9)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(typescript@5.5.4)
|
||||
|
|
@ -6065,6 +6068,7 @@ packages:
|
|||
'@smithy/core@3.18.4':
|
||||
resolution: {integrity: sha512-o5tMqPZILBvvROfC8vC+dSVnWJl9a0u9ax1i1+Bq8515eYjUJqqk5XjjEsDLoeL5dSqGSh6WGdVx1eJ1E/Nwhw==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
deprecated: Please upgrade your lockfile to use the latest 3.x version of @smithy/core for various fixes, see https://github.com/smithy-lang/smithy-typescript/blob/main/packages/core/CHANGELOG.md
|
||||
|
||||
'@smithy/credential-provider-imds@4.2.5':
|
||||
resolution: {integrity: sha512-BZwotjoZWn9+36nimwm/OLIcVe+KYRwzMjfhd4QT7QxPm9WY0HiOV8t/Wlh+HVUif0SBVV7ksq8//hPaBC/okQ==}
|
||||
|
|
@ -8128,9 +8132,11 @@ packages:
|
|||
|
||||
'@walletconnect/sign-client@2.19.0':
|
||||
resolution: {integrity: sha512-+GkuJzPK9SPq+RZgdKHNOvgRagxh/hhYWFHOeSiGh3DyAQofWuFTq4UrN/MPjKOYswSSBKfIa+iqKYsi4t8zLQ==}
|
||||
deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
|
||||
|
||||
'@walletconnect/sign-client@2.19.1':
|
||||
resolution: {integrity: sha512-OgBHRPo423S02ceN3lAzcZ3MYb1XuLyTTkKqLmKp/icYZCyRzm3/ynqJDKndiBLJ5LTic0y07LiZilnliYqlvw==}
|
||||
deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
|
||||
|
||||
'@walletconnect/solana-adapter@0.0.8':
|
||||
resolution: {integrity: sha512-Qb7MT8SdkeBldfUCmF+rYW6vL98mxPuT1yAwww5X2vpx7xEPZvFCoAKnyT5fXu0v56rMxhW3MGejnHyyYdDY7Q==}
|
||||
|
|
@ -8149,9 +8155,11 @@ packages:
|
|||
|
||||
'@walletconnect/universal-provider@2.19.0':
|
||||
resolution: {integrity: sha512-e9JvadT5F8QwdLmd7qBrmACq04MT7LQEe1m3X2Fzvs3DWo8dzY8QbacnJy4XSv5PCdxMWnua+2EavBk8nrI9QA==}
|
||||
deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
|
||||
|
||||
'@walletconnect/universal-provider@2.19.1':
|
||||
resolution: {integrity: sha512-4rdLvJ2TGDIieNWW3sZw2MXlX65iHpTuKb5vyvUHQtjIVNLj+7X/09iUAI/poswhtspBK0ytwbH+AIT/nbGpjg==}
|
||||
deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
|
||||
|
||||
'@walletconnect/utils@2.19.0':
|
||||
resolution: {integrity: sha512-LZ0D8kevknKfrfA0Sq3Hf3PpmM8oWyNfsyWwFR51t//2LBgtN2Amz5xyoDDJcjLibIbKAxpuo/i0JYAQxz+aPA==}
|
||||
|
|
@ -16914,10 +16922,10 @@ snapshots:
|
|||
'@ag-ui/core': 0.0.41
|
||||
'@ag-ui/proto': 0.0.41
|
||||
|
||||
'@ag-ui/langgraph@0.0.18(@ag-ui/client@0.0.41)(@ag-ui/core@0.0.37)(@opentelemetry/api@1.9.0)(@opentelemetry/exporter-trace-otlp-proto@0.203.0(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@2.2.0(@opentelemetry/api@1.9.0))(openai@6.9.1(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
|
||||
'@ag-ui/langgraph@0.0.18(@ag-ui/client@0.0.41)(@ag-ui/core@0.0.41)(@opentelemetry/api@1.9.0)(@opentelemetry/exporter-trace-otlp-proto@0.203.0(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@2.2.0(@opentelemetry/api@1.9.0))(openai@6.9.1(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
|
||||
dependencies:
|
||||
'@ag-ui/client': 0.0.41
|
||||
'@ag-ui/core': 0.0.37
|
||||
'@ag-ui/core': 0.0.41
|
||||
'@langchain/core': 0.3.79(@opentelemetry/api@1.9.0)(@opentelemetry/exporter-trace-otlp-proto@0.203.0(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@2.2.0(@opentelemetry/api@1.9.0))(openai@6.9.1(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76))
|
||||
'@langchain/langgraph-sdk': 0.1.10(@langchain/core@0.3.79(@opentelemetry/api@1.9.0)(@opentelemetry/exporter-trace-otlp-proto@0.203.0(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@2.2.0(@opentelemetry/api@1.9.0))(openai@6.9.1(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76)))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
partial-json: 0.1.7
|
||||
|
|
@ -16930,12 +16938,12 @@ snapshots:
|
|||
- react
|
||||
- react-dom
|
||||
|
||||
'@ag-ui/mastra@0.2.0(@ag-ui/client@0.0.41)(@ag-ui/core@0.0.37)(@copilotkit/runtime@1.10.6(9c0ec131fe3ef529a831958f12b4bf78))(@mastra/core@0.20.2(openapi-types@12.1.3)(react@18.3.1)(zod@3.25.76))(openapi-types@12.1.3)(react@18.3.1)(zod@3.25.76)':
|
||||
'@ag-ui/mastra@0.2.0(@ag-ui/client@0.0.41)(@ag-ui/core@0.0.41)(@copilotkit/runtime@1.10.6(6855d89fee41a5dd20a0f9576445cd9f))(@mastra/core@0.20.2(openapi-types@12.1.3)(react@18.3.1)(zod@3.25.76))(openapi-types@12.1.3)(react@18.3.1)(zod@3.25.76)':
|
||||
dependencies:
|
||||
'@ag-ui/client': 0.0.41
|
||||
'@ag-ui/core': 0.0.37
|
||||
'@ag-ui/core': 0.0.41
|
||||
'@ai-sdk/ui-utils': 1.2.11(zod@3.25.76)
|
||||
'@copilotkit/runtime': 1.10.6(9c0ec131fe3ef529a831958f12b4bf78)
|
||||
'@copilotkit/runtime': 1.10.6(6855d89fee41a5dd20a0f9576445cd9f)
|
||||
'@mastra/client-js': 0.15.2(openapi-types@12.1.3)(react@18.3.1)(zod@3.25.76)
|
||||
'@mastra/core': 0.20.2(openapi-types@12.1.3)(react@18.3.1)(zod@3.25.76)
|
||||
rxjs: 7.8.1
|
||||
|
|
@ -18876,12 +18884,12 @@ snapshots:
|
|||
- encoding
|
||||
- graphql
|
||||
|
||||
'@copilotkit/runtime@1.10.6(9c0ec131fe3ef529a831958f12b4bf78)':
|
||||
'@copilotkit/runtime@1.10.6(6855d89fee41a5dd20a0f9576445cd9f)':
|
||||
dependencies:
|
||||
'@ag-ui/client': 0.0.41
|
||||
'@ag-ui/core': 0.0.37
|
||||
'@ag-ui/core': 0.0.41
|
||||
'@ag-ui/encoder': 0.0.41
|
||||
'@ag-ui/langgraph': 0.0.18(@ag-ui/client@0.0.41)(@ag-ui/core@0.0.37)(@opentelemetry/api@1.9.0)(@opentelemetry/exporter-trace-otlp-proto@0.203.0(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@2.2.0(@opentelemetry/api@1.9.0))(openai@6.9.1(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
'@ag-ui/langgraph': 0.0.18(@ag-ui/client@0.0.41)(@ag-ui/core@0.0.41)(@opentelemetry/api@1.9.0)(@opentelemetry/exporter-trace-otlp-proto@0.203.0(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@2.2.0(@opentelemetry/api@1.9.0))(openai@6.9.1(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
'@ag-ui/proto': 0.0.41
|
||||
'@anthropic-ai/sdk': 0.57.0
|
||||
'@copilotkit/shared': 1.10.6
|
||||
|
|
|
|||
Loading…
Reference in New Issue