Skip to content

Commit

Permalink
fix: dd-trace not handling api requests
Browse files Browse the repository at this point in the history
  • Loading branch information
skinmaker1345 committed Mar 3, 2024
1 parent 81e1998 commit b2440e2
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 116 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
6 changes: 0 additions & 6 deletions dd-trace-init.js

This file was deleted.

11 changes: 11 additions & 0 deletions instrumentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
const { tracer } = await import('dd-trace')
const packageJson = await import('package.json')
tracer.init({
service: 'koreanbots',
version: packageJson.version,
env: process.env.DD_ENV,
})
}
}
33 changes: 18 additions & 15 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const { withSentryConfig } = require('@sentry/nextjs')
const withPWA = require('next-pwa')({
disable: process.env.NODE_ENV !== 'production',
register: false
register: false,
})
const VERSION = require('./package.json').version

Expand All @@ -18,32 +18,35 @@ const NextConfig = {
},
env: {
NEXT_PUBLIC_RELEASE_VERSION: VERSION,
SENTRY_SKIP_AUTO_RELEASE: true
SENTRY_SKIP_AUTO_RELEASE: 'true',
},
experimental: {
scrollRestoration: true
experimental: {
instrumentationHook: true,
scrollRestoration: true,
},
swcMinify: true,
redirects: async () => {
return [
{
source: '/developers',
destination: '/developers/applications',
permanent: true
permanent: true,
},
{
source: '/developers/docs',
destination: '/developers/docs/시작하기',
permanent: true
}
permanent: true,
},
]
},
sentry: process.env.CI ? {
disableServerWebpackPlugin: true,
disableClientWebpackPlugin: true,
hideSourceMaps: true,
} : {
hideSourceMaps: true,
},
sentry: process.env.CI
? {
disableServerWebpackPlugin: true,
disableClientWebpackPlugin: true,
hideSourceMaps: true,
}
: {
hideSourceMaps: true,
},
}
module.exports = withSentryConfig(withPWA(NextConfig))
module.exports = withSentryConfig(withPWA(NextConfig))
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "koreanbots",
"version": "2.6.9",
"version": "2.6.10",
"private": true,
"scripts": {
"dev": "next dev",
"pre-build": "git init && git submodule init && git submodule update --remote",
"build": "npm run pre-build && next build",
"start": "(sleep 2; wget http://localhost:3000/api/v2/management/load -O /dev/null) & NODE_OPTIONS='--require ./dd-trace-init.js' next start",
"start": "(sleep 2; wget http://localhost:3000/api/v2/management/load -O /dev/null) & next start",
"lint": "eslint --ext ts,tsx .",
"prettier": "prettier --write **/*",
"lint:fix": "eslint --ext ts,tsx . --fix",
Expand All @@ -28,7 +28,7 @@
"csrf": "3.1.0",
"dataloader": "2.2.2",
"dayjs": "^1.11.9",
"dd-trace": "^4.6.0",
"dd-trace": "^5.5.0",
"difflib": "0.2.4",
"discord.js": "^14.12.1",
"emoji-mart": "3.0.1",
Expand Down
Loading

0 comments on commit b2440e2

Please sign in to comment.