Skip to content

Commit

Permalink
chore(datadog): add datadog
Browse files Browse the repository at this point in the history
  • Loading branch information
emile-bex committed Feb 2, 2024
1 parent 2c23d48 commit ebfa4de
Show file tree
Hide file tree
Showing 4 changed files with 330 additions and 11 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"circular-dependency-plugin": "^5.2.2",
"cookies-next": "^2.1.1",
"cors": "^2.8.5",
"dd-trace": "^3.3.1",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"express-sslify": "^1.2.0",
Expand Down
2 changes: 2 additions & 0 deletions server-next.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import './tracer';

const next = require('next');
const cors = require('cors');
const express = require('express');
Expand Down
11 changes: 11 additions & 0 deletions tracer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import tracer from 'dd-trace';

const ENV = `${process.env.NODE_ENV}`;

if (ENV === 'production') {
tracer.init({
version: process.env.HEROKU_RELEASE_VERSION,
});
}

export { tracer };
Loading

0 comments on commit ebfa4de

Please sign in to comment.