Adding server name to node.js sentry.

This commit is contained in:
Samuel Clay 2021-10-26 08:42:49 -04:00
parent 81ffcc52dc
commit 403ce988e4
2 changed files with 7 additions and 2 deletions

View file

@ -3,6 +3,7 @@ Tracing = require "@sentry/tracing"
app = require('express')()
server = require('http').createServer(app)
log = require './log.js'
os = require 'os'
envresult = require('dotenv').config({path: 'node/.env'})
if envresult.error
# throw envresult.error
@ -28,6 +29,7 @@ if ENV_PROD
dsn: process.env.SENTRY_DSN,
debug: true,
tracesSampleRate: 1.0
serverName: os.hostname()
app.use Sentry.Handlers.requestHandler()

View file

@ -1,6 +1,6 @@
// Generated by CoffeeScript 2.5.1
(function() {
var ENV_DEV, ENV_DOCKER, ENV_PROD, Sentry, Tracing, app, envresult, favicons, log, original_page, original_text, server, unread_counts;
var ENV_DEV, ENV_DOCKER, ENV_PROD, Sentry, Tracing, app, envresult, favicons, log, original_page, original_text, os, server, unread_counts;
Sentry = require("@sentry/node");
@ -12,6 +12,8 @@
log = require('./log.js');
os = require('os');
envresult = require('dotenv').config({
path: 'node/.env'
});
@ -47,7 +49,8 @@
Sentry.init({
dsn: process.env.SENTRY_DSN,
debug: true,
tracesSampleRate: 1.0
tracesSampleRate: 1.0,
serverName: os.hostname()
});
app.use(Sentry.Handlers.requestHandler());
}