Skip to content

Commit

Permalink
feat: add honeybadger for APM
Browse files Browse the repository at this point in the history
  • Loading branch information
raghav-rama committed Dec 6, 2024
1 parent be01ce8 commit 837c00f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ PORT=
# Anchor
ANCHOR_PROVIDER_URL=
ANCHOR_WALLET_PATH=

# Honeybadger
HONEYBADGER_API_KEY=
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class Config {
ADMIN_KEYPAIR = Keypair.fromSecretKey(
new Uint8Array(JSON.parse(process.env.ADMIN_KEYPAIR!)),
);
HONEYBADGER_API_KEY = process.env.HONEYBADGER_API_KEY;

// Program IDs
LEVERAGE_FUN_PROGRAM_ID = new PublicKey(
'LfunVKmPLfejpbCXPnrLbjZr693RrgKHdQub2ge1ZC9',
);
Expand Down
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ import express from 'express';
import cors from 'cors';
import Config from './config.js';
import router from './routes/mintOptions.route.js';
import Honeybadger from '@honeybadger-io/js';

const app = express();

Honeybadger.configure({
apiKey: Config.HONEYBADGER_API_KEY,
environment: 'production',
});

app.use(
cors({
origin: '*',
Expand All @@ -14,6 +20,7 @@ app.use(
}),
);
app.use(express.json());
app.use(Honeybadger.errorHandler);

try {
await mongoose.connect(`${Config.MONGO_URI}`);
Expand Down

0 comments on commit 837c00f

Please sign in to comment.