Skip to content

Commit

Permalink
Add Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
misenhower committed Aug 3, 2023
1 parent 654afae commit 9894ec3
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ NINTENDO_TOKEN=
# User agent string
USER_AGENT=

# Sentry
SENTRY_DSN=

# S3 parameters
AWS_S3_ENDPOINT=
AWS_S3_BUCKET=
Expand Down
9 changes: 9 additions & 0 deletions app/common/sentry.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Sentry from '@sentry/node';

export function sentryInit() {
if (!process.env.SENTRY_DSN) {
return;
}

Sentry.init({ dsn: process.env.SENTRY_DSN });
}
2 changes: 2 additions & 0 deletions app/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import ImageWriter from './social/clients/ImageWriter.mjs';
import BlueskyClient from './social/clients/BlueskyClient.mjs';
import ThreadsClient from './social/clients/ThreadsClient.mjs';
import { archiveData } from './data/DataArchiver.mjs';
import { sentryInit } from './common/sentry.mjs';

consoleStamp(console);
dotenv.config();
sentryInit();

const actions = {
cron,
Expand Down
141 changes: 141 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@headlessui/vue": "^1.7.3",
"@heroicons/vue": "^2.0.12",
"@intlify/vite-plugin-vue-i18n": "^6.0.3",
"@sentry/node": "^7.61.0",
"console-stamp": "^3.0.6",
"cron": "^2.1.0",
"dotenv": "^16.0.2",
Expand Down Expand Up @@ -53,4 +54,4 @@
"tailwindcss": "^3.1.8",
"vite": "^3.1.3"
}
}
}

0 comments on commit 9894ec3

Please sign in to comment.