0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-01 02:41:39 -05:00

Enabled Sentry Debug integration for Admin when in development mode (#18780)

no issue

- This change enables the Debug integration in Sentry when the app is
running in development mode (and Sentry is configured with a valid DSN).
- Whenever an event is sent to Sentry, the event & hint are passed to
the beforeSend() function will be logged to the browser console so you
can quickly see a) when events are sent to Sentry and b) exactly what
data & tags are sent with integration
This commit is contained in:
Chris Raible 2023-10-26 20:44:39 -07:00 committed by GitHub
parent 3a88027611
commit d2ca5daf9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 2 deletions

View file

@ -5,6 +5,7 @@ import Route from '@ember/routing/route';
import ShortcutsRoute from 'ghost-admin/mixins/shortcuts-route';
import ctrlOrCmd from 'ghost-admin/utils/ctrl-or-cmd';
import windowProxy from 'ghost-admin/utils/window-proxy';
import {Debug} from '@sentry/integrations';
import {InitSentryForEmber} from '@sentry/ember';
import {importSettings} from '../components/admin-x/settings';
import {inject} from 'ghost-admin/decorators/inject';
@ -169,7 +170,7 @@ export default Route.extend(ShortcutsRoute, {
// init Sentry here rather than app.js so that we can use API-supplied
// sentry_dsn and sentry_env rather than building it into release assets
if (this.config.sentry_dsn) {
InitSentryForEmber({
const sentryConfig = {
dsn: this.config.sentry_dsn,
environment: this.config.sentry_env,
release: `ghost@${this.config.version}`,
@ -182,7 +183,11 @@ export default Route.extend(ShortcutsRoute, {
// TransitionAborted errors surface from normal application behaviour
// - https://github.com/emberjs/ember.js/issues/12505
ignoreErrors: [/^TransitionAborted$/]
});
};
if (this.config.sentry_env === 'development') {
sentryConfig.integrations = [new Debug()];
}
InitSentryForEmber(sentryConfig);
}
if (this.session.isAuthenticated) {

View file

@ -168,6 +168,7 @@
"*.js": "eslint"
},
"dependencies": {
"@sentry/integrations": "^7.75.1",
"jose": "4.15.4",
"path-browserify": "1.0.1",
"webpack": "5.89.0"

View file

@ -4869,6 +4869,14 @@
"@sentry/utils" "7.73.0"
tslib "^2.4.1 || ^1.9.3"
"@sentry/core@7.75.1":
version "7.75.1"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.75.1.tgz#f48cc424990ee4f31541e93f2c0277bfd5be9ed3"
integrity sha512-Kw4KyKBxbxbh8OKO0S11Tm0gWP+6AaXXYrsq3hp8H338l/wOmIzyckmCbUrc/XJeoRqaFLJbdcCrcUEDZUvsVQ==
dependencies:
"@sentry/types" "7.75.1"
"@sentry/utils" "7.75.1"
"@sentry/ember@7.70.0":
version "7.70.0"
resolved "https://registry.yarnpkg.com/@sentry/ember/-/ember-7.70.0.tgz#8f0d6c197384e1932278f76313175a84447eea3c"
@ -4883,6 +4891,16 @@
ember-cli-htmlbars "^6.1.1"
ember-cli-typescript "^5.1.1"
"@sentry/integrations@^7.75.1":
version "7.75.1"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.75.1.tgz#bfe83ce25606a5b47cb585dd51feef81fc86e00d"
integrity sha512-qSCyTNX3DiL1aYRmdq10LRhPLfh1KJYKhbmGszC1PII4mt9FbLVmC8fSXiDbhgiuSUKKrDE+J2lC//w688lvHw==
dependencies:
"@sentry/core" "7.75.1"
"@sentry/types" "7.75.1"
"@sentry/utils" "7.75.1"
localforage "^1.8.1"
"@sentry/node@7.70.0":
version "7.70.0"
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.70.0.tgz#3d62ee1d7c762a3d15ab1967ab8e6acc805a241a"
@ -4948,6 +4966,11 @@
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.73.0.tgz#6d811bbe413d319df0a592a672d6d72a94a8e716"
integrity sha512-/v8++bly8jW7r4cP2wswYiiVpn7eLLcqwnfPUMeCQze4zj3F3nTRIKc9BGHzU0V+fhHa3RwRC2ksqTGq1oJMDg==
"@sentry/types@7.75.1":
version "7.75.1"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.75.1.tgz#48b11336a0e70433d41bbe41c617dd339d4992ea"
integrity sha512-km+ygqgMDaFfTrbQwdhrptFqx0Oq15jZABqIoIpbaOCkCAMm+tyCqrFS8dTfaq5wpCktqWOy2qU/DOpppO99Cg==
"@sentry/utils@7.70.0":
version "7.70.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.70.0.tgz#825387ceb10cbb1e145357394b697a1a6d60eb74"
@ -4964,6 +4987,13 @@
"@sentry/types" "7.73.0"
tslib "^2.4.1 || ^1.9.3"
"@sentry/utils@7.75.1":
version "7.75.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.75.1.tgz#169040ba13ff4d4ecccb7b7aa23f84724d108b97"
integrity sha512-QzW2eRjY20epD//9/tQ0FTNwdAL6XZi+LyJNUQIeK3NMnc5NgHrgpxId87gmFq8cNx47utH1Blub8RuMbKqiwQ==
dependencies:
"@sentry/types" "7.75.1"
"@sidvind/better-ajv-errors@^2.0.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@sidvind/better-ajv-errors/-/better-ajv-errors-2.1.0.tgz#54f4216d2200d60e90ec25c6a27c1ea3afdc6cdf"
@ -19727,6 +19757,11 @@ image-size@^0.8.1:
dependencies:
queue "6.0.1"
immediate@~3.0.5:
version "3.0.6"
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==
import-fresh@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546"
@ -21752,6 +21787,13 @@ lib0@0.2.87, lib0@^0.2.74, lib0@^0.2.85:
dependencies:
isomorphic.js "^0.2.4"
lie@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e"
integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==
dependencies:
immediate "~3.0.5"
liftoff@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-3.1.0.tgz#c9ba6081f908670607ee79062d700df062c52ed3"
@ -21922,6 +21964,13 @@ local-pkg@^0.4.3:
resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963"
integrity sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==
localforage@^1.8.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4"
integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==
dependencies:
lie "3.1.1"
locate-character@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/locate-character/-/locate-character-2.0.5.tgz#f2d2614d49820ecb3c92d80d193b8db755f74c0f"