Skip to content

Commit

Permalink
add sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonejt committed Apr 21, 2024
1 parent 25d5ddd commit b6f2061
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/deliver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@ jobs:
git_remote_url: ${{ secrets.GIT_REMOTE_URL }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
branch: 'main'
git_push_flags: --force
git_push_flags: --force

- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: dragonejt
SENTRY_PROJECT: sibyl-discord
with:
environment: production
95 changes: 95 additions & 0 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "sibyl-discord.js",
"scripts": {
"start": "node sibyl-discord.js",
"build": "npx tsc --build",
"build": "npx tsc --build && npx @sentry/wizard@latest -i sourcemaps",
"dev": "node --loader ts-node/esm sibyl-discord.ts",
"test": "jest --passWithNoTests",
"lint": "npx eslint --fix ."
Expand All @@ -22,6 +22,8 @@
},
"homepage": "https://github.com/dragonejt/sibyl-discord#readme",
"dependencies": {
"@sentry/node": "^7.111.0",
"@sentry/profiling-node": "^7.111.0",
"discord.js": "*",
"jest": "*"
},
Expand Down
14 changes: 14 additions & 0 deletions sibyl-discord.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { SibylDiscordClient } from "./clients/discord.js";
import { REST, Routes, GatewayIntentBits, Events } from "discord.js";
import { init } from "@sentry/node";
import { nodeProfilingIntegration } from "@sentry/profiling-node";

import sibyl from "./commands/sibyl.js";
import dominator from "./commands/dominator.js";
Expand All @@ -14,6 +16,18 @@ import guildCreate from "./events/guildCreate.js";
import guildMemberRemove from "./events/guildMemberRemove.js";
import { guildMemberAdd } from "./events/guildMemberAdd.js";

init({
dsn: "https://7e2c73f3dcf02548b7262758195e3454@o4507124907638784.ingest.us.sentry.io/4507125166702592",
integrations: [
nodeProfilingIntegration(),
],
// Performance Monitoring
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Set sampling rate for profiling - this is relative to tracesSampleRate
profilesSampleRate: 1.0,
enableTracing: true
});

const client = new SibylDiscordClient({
intents: [
GatewayIntentBits.Guilds,
Expand Down

0 comments on commit b6f2061

Please sign in to comment.