Skip to content

Commit

Permalink
Merge pull request #45 from hepsiburada/fix/newrelicTransaction
Browse files Browse the repository at this point in the history
Newrelic transaction for all routes
  • Loading branch information
yasin749 authored Apr 21, 2022
2 parents ec94706 + fd496f4 commit 0d8bb20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "voltranjs",
"version": "1.0.28",
"version": "1.0.29",
"main": "src/index.js",
"author": "Hepsiburada Technology Team",
"bin": {
Expand Down
3 changes: 2 additions & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const handleProcessMessage = message => {
};

const handleUrls = async (req, res, next) => {
newrelic?.setTransactionName?.(req.path);

if (req.url === '/' && req.method === 'GET') {
res.html(Welcome());
} else if (req.url === '/metrics' && req.method === 'GET' && !enablePrometheus) {
Expand Down Expand Up @@ -96,7 +98,6 @@ const handleUrls = async (req, res, next) => {
res.json({ success: false });
}
} else {
newrelic?.setTransactionName?.(req.path);
next();
}
};
Expand Down

0 comments on commit 0d8bb20

Please sign in to comment.