Merge pull request #17181 from tamj0rd2/feature/remove-opbeat
refactor(server): Remove opbeat from dev tools
This commit is contained in:
207
package-lock.json
generated
207
package-lock.json
generated
@ -244,11 +244,6 @@
|
||||
"integrity": "sha1-q11PuIP1loFtNRX495HAr0ht1ic=",
|
||||
"dev": true
|
||||
},
|
||||
"after-all-results": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/after-all-results/-/after-all-results-2.0.0.tgz",
|
||||
"integrity": "sha1-asL8ICtQD4jaj09VMM+hAPTGotA="
|
||||
},
|
||||
"agentkeepalive": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-2.2.0.tgz",
|
||||
@ -680,14 +675,6 @@
|
||||
"lodash": "4.17.4"
|
||||
}
|
||||
},
|
||||
"async-cache": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/async-cache/-/async-cache-1.1.0.tgz",
|
||||
"integrity": "sha1-SppaidBl7F2OUlS9nulrp2xTK1o=",
|
||||
"requires": {
|
||||
"lru-cache": "4.1.1"
|
||||
}
|
||||
},
|
||||
"async-each": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz",
|
||||
@ -3826,11 +3813,6 @@
|
||||
"date-now": "0.1.4"
|
||||
}
|
||||
},
|
||||
"console-log-level": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/console-log-level/-/console-log-level-1.4.0.tgz",
|
||||
"integrity": "sha1-QDWBi+6jflhQoMA8jUUMpfLNEhc="
|
||||
},
|
||||
"constantinople": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/constantinople/-/constantinople-3.0.2.tgz",
|
||||
@ -5206,11 +5188,6 @@
|
||||
"prr": "0.0.0"
|
||||
}
|
||||
},
|
||||
"error-callsites": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/error-callsites/-/error-callsites-1.0.1.tgz",
|
||||
"integrity": "sha1-QoYWmt+PwSSC9VYRFyTFrthzppI="
|
||||
},
|
||||
"error-ex": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz",
|
||||
@ -6109,11 +6086,6 @@
|
||||
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
|
||||
"dev": true
|
||||
},
|
||||
"fast-safe-stringify": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-1.2.0.tgz",
|
||||
"integrity": "sha1-69QmZv0Y/k8rpPDSlQZfP4XK3pY="
|
||||
},
|
||||
"fbjs": {
|
||||
"version": "0.8.16",
|
||||
"resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz",
|
||||
@ -8573,11 +8545,6 @@
|
||||
"minimalistic-assert": "1.0.0"
|
||||
}
|
||||
},
|
||||
"hashlru": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/hashlru/-/hashlru-2.2.0.tgz",
|
||||
"integrity": "sha1-eTpYlD+QKupXgXfXsDNfE/JpS3E="
|
||||
},
|
||||
"hawk": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz",
|
||||
@ -8816,11 +8783,6 @@
|
||||
"integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=",
|
||||
"dev": true
|
||||
},
|
||||
"https-pem": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/https-pem/-/https-pem-1.0.4.tgz",
|
||||
"integrity": "sha1-802YaRbQUVY6f8a6lt2xwoY03Bg="
|
||||
},
|
||||
"husky": {
|
||||
"version": "0.14.3",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-0.14.3.tgz",
|
||||
@ -8918,11 +8880,6 @@
|
||||
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
|
||||
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
|
||||
},
|
||||
"in-publish": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz",
|
||||
"integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E="
|
||||
},
|
||||
"indent-string": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz",
|
||||
@ -9277,14 +9234,6 @@
|
||||
"is-path-inside": "1.0.0"
|
||||
}
|
||||
},
|
||||
"is-integer": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/is-integer/-/is-integer-1.0.7.tgz",
|
||||
"integrity": "sha1-a96Bqs3feLZZtmKdYpytxRqIbVw=",
|
||||
"requires": {
|
||||
"is-finite": "1.0.2"
|
||||
}
|
||||
},
|
||||
"is-my-json-valid": {
|
||||
"version": "2.16.1",
|
||||
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz",
|
||||
@ -9297,20 +9246,6 @@
|
||||
"xtend": "4.0.1"
|
||||
}
|
||||
},
|
||||
"is-native": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-native/-/is-native-1.0.1.tgz",
|
||||
"integrity": "sha1-zRjMFi6EUNaDtbq+eayZwUVElnU=",
|
||||
"requires": {
|
||||
"is-nil": "1.0.1",
|
||||
"to-source-code": "1.0.2"
|
||||
}
|
||||
},
|
||||
"is-nil": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-nil/-/is-nil-1.0.1.tgz",
|
||||
"integrity": "sha1-LauingtYUGOHXntTnQcfWxWTeWk="
|
||||
},
|
||||
"is-npm": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz",
|
||||
@ -9461,11 +9396,6 @@
|
||||
"resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz",
|
||||
"integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ="
|
||||
},
|
||||
"is-secret": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-secret/-/is-secret-1.1.1.tgz",
|
||||
"integrity": "sha1-KYig6bOU41YM1IBAbWHKz9dPH/k="
|
||||
},
|
||||
"is-stream": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
@ -10675,16 +10605,6 @@
|
||||
"resolved": "https://registry.npmjs.org/load-script/-/load-script-1.0.0.tgz",
|
||||
"integrity": "sha1-BJGTngvuVkPuSUp+PaPSuscMbKQ="
|
||||
},
|
||||
"load-source-map": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/load-source-map/-/load-source-map-1.0.0.tgz",
|
||||
"integrity": "sha1-MY9JkFzopwnft8w/FvPv47zx3QU=",
|
||||
"requires": {
|
||||
"in-publish": "2.0.0",
|
||||
"semver": "5.4.1",
|
||||
"source-map": "0.5.7"
|
||||
}
|
||||
},
|
||||
"loader-runner": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz",
|
||||
@ -12431,11 +12351,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"module-details-from-path": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz",
|
||||
"integrity": "sha1-EUyUlnPiqKNenTV4hSeqN7Z52is="
|
||||
},
|
||||
"module-not-found-error": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz",
|
||||
@ -13334,11 +13249,6 @@
|
||||
"abbrev": "1.1.1"
|
||||
}
|
||||
},
|
||||
"normalize-bool": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/normalize-bool/-/normalize-bool-1.0.0.tgz",
|
||||
"integrity": "sha1-RqVx7ZPqWrM3IfrM/FpZuGiQ2Fg="
|
||||
},
|
||||
"normalize-package-data": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
|
||||
@ -13642,61 +13552,6 @@
|
||||
"resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
|
||||
"integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k="
|
||||
},
|
||||
"opbeat": {
|
||||
"version": "4.16.0",
|
||||
"resolved": "https://registry.npmjs.org/opbeat/-/opbeat-4.16.0.tgz",
|
||||
"integrity": "sha512-To2UxUptAZdnHsdjFV7hqVNSAxDobY30XiK9nMQAdb7Fuee24u3ALSunT7WXBL+5Huuf5kWiTRjhgi+mUUzFzw==",
|
||||
"requires": {
|
||||
"after-all-results": "2.0.0",
|
||||
"console-log-level": "1.4.0",
|
||||
"cookie": "0.3.1",
|
||||
"core-util-is": "1.0.2",
|
||||
"debug": "3.1.0",
|
||||
"end-of-stream": "1.4.0",
|
||||
"fast-safe-stringify": "1.2.0",
|
||||
"hashlru": "2.2.0",
|
||||
"https-pem": "1.0.4",
|
||||
"is-native": "1.0.1",
|
||||
"normalize-bool": "1.0.0",
|
||||
"object-assign": "4.1.1",
|
||||
"opbeat-http-client": "1.2.2",
|
||||
"opbeat-release-tracker": "1.1.1",
|
||||
"redact-secrets": "1.0.0",
|
||||
"require-in-the-middle": "2.1.2",
|
||||
"semver": "5.4.1",
|
||||
"sql-summary": "1.0.0",
|
||||
"stackman": "2.0.1",
|
||||
"unicode-byte-truncate": "1.0.0",
|
||||
"uuid": "3.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
||||
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
|
||||
"requires": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"opbeat-http-client": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/opbeat-http-client/-/opbeat-http-client-1.2.2.tgz",
|
||||
"integrity": "sha1-itOZlp1QglTazi0IU5gTaBF9oz8=",
|
||||
"requires": {
|
||||
"fast-safe-stringify": "1.2.0"
|
||||
}
|
||||
},
|
||||
"opbeat-release-tracker": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/opbeat-release-tracker/-/opbeat-release-tracker-1.1.1.tgz",
|
||||
"integrity": "sha1-L2V2clC5Va6YjtyodazYNhIOfgo=",
|
||||
"requires": {
|
||||
"after-all-results": "2.0.0",
|
||||
"opbeat-http-client": "1.2.2"
|
||||
}
|
||||
},
|
||||
"open": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/open/-/open-0.0.5.tgz",
|
||||
@ -14199,7 +14054,8 @@
|
||||
"path-parse": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
|
||||
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME="
|
||||
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=",
|
||||
"dev": true
|
||||
},
|
||||
"path-platform": {
|
||||
"version": "0.11.15",
|
||||
@ -15793,15 +15649,6 @@
|
||||
"resolve": "1.5.0"
|
||||
}
|
||||
},
|
||||
"redact-secrets": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/redact-secrets/-/redact-secrets-1.0.0.tgz",
|
||||
"integrity": "sha1-YPHbVpJP6QogO6jMs5KDzbsNkHw=",
|
||||
"requires": {
|
||||
"is-secret": "1.1.1",
|
||||
"traverse": "0.6.6"
|
||||
}
|
||||
},
|
||||
"redent": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz",
|
||||
@ -16147,15 +15994,6 @@
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
|
||||
},
|
||||
"require-in-the-middle": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-2.1.2.tgz",
|
||||
"integrity": "sha1-vduJMW1FvNsI4sYYa9Lm6Bmo7q4=",
|
||||
"requires": {
|
||||
"module-details-from-path": "1.0.3",
|
||||
"resolve": "1.5.0"
|
||||
}
|
||||
},
|
||||
"require-main-filename": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
|
||||
@ -16203,6 +16041,7 @@
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz",
|
||||
"integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"path-parse": "1.0.5"
|
||||
}
|
||||
@ -17698,11 +17537,6 @@
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
|
||||
},
|
||||
"sql-summary": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/sql-summary/-/sql-summary-1.0.0.tgz",
|
||||
"integrity": "sha1-OeOlHY2F5Gc5g2/H1n0GVLFzo58="
|
||||
},
|
||||
"srcset": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/srcset/-/srcset-1.0.0.tgz",
|
||||
@ -17756,19 +17590,6 @@
|
||||
"resolved": "https://registry.npmjs.org/stable/-/stable-0.1.6.tgz",
|
||||
"integrity": "sha1-kQ9dKu17Ugxud3SZwfMuE5/eyxA="
|
||||
},
|
||||
"stackman": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/stackman/-/stackman-2.0.1.tgz",
|
||||
"integrity": "sha1-ztMJxmLpubZn79cYOxrjDFF8uqM=",
|
||||
"requires": {
|
||||
"after-all-results": "2.0.0",
|
||||
"async-cache": "1.1.0",
|
||||
"debug": "2.6.9",
|
||||
"error-callsites": "1.0.1",
|
||||
"load-source-map": "1.0.0",
|
||||
"path-is-absolute": "1.0.1"
|
||||
}
|
||||
},
|
||||
"static-extend": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
|
||||
@ -18961,14 +18782,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"to-source-code": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/to-source-code/-/to-source-code-1.0.2.tgz",
|
||||
"integrity": "sha1-3RNr2x4dvYC76s8IiZJnjpBwv+o=",
|
||||
"requires": {
|
||||
"is-nil": "1.0.1"
|
||||
}
|
||||
},
|
||||
"to-utf8": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-utf8/-/to-utf8-0.0.1.tgz",
|
||||
@ -19317,20 +19130,6 @@
|
||||
"util-deprecate": "1.0.2"
|
||||
}
|
||||
},
|
||||
"unicode-byte-truncate": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unicode-byte-truncate/-/unicode-byte-truncate-1.0.0.tgz",
|
||||
"integrity": "sha1-qm8PNHUZP+IMMgrJIT425i6HZKc=",
|
||||
"requires": {
|
||||
"is-integer": "1.0.7",
|
||||
"unicode-substring": "0.1.0"
|
||||
}
|
||||
},
|
||||
"unicode-substring": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/unicode-substring/-/unicode-substring-0.1.0.tgz",
|
||||
"integrity": "sha1-YSDOPDkDhdvND2DDK5BlxBgdSzY="
|
||||
},
|
||||
"union-value": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz",
|
||||
|
@ -103,7 +103,6 @@
|
||||
"nodemailer-ses-transport": "^1.3.0",
|
||||
"normalize-url": "^1.3.1",
|
||||
"normalizr": "2.2.1",
|
||||
"opbeat": "^4.14.0",
|
||||
"passport": "^0.4.0",
|
||||
"passport-auth0": "^0.6.1",
|
||||
"passport-facebook": "^2.0.0",
|
||||
|
@ -1,4 +1,3 @@
|
||||
import opbeat from 'opbeat';
|
||||
import debug from 'debug';
|
||||
|
||||
import {
|
||||
@ -8,7 +7,6 @@ import {
|
||||
|
||||
const log = debug('fcc:middlewares:error-reporter');
|
||||
|
||||
const isOpbeatDisabled = !opbeat.appId;
|
||||
export default function errrorReporter() {
|
||||
if (process.env.NODE_ENV !== 'production' && process.env.ERROR_REPORTER) {
|
||||
return (err, req, res, next) => {
|
||||
@ -20,19 +18,5 @@ export default function errrorReporter() {
|
||||
next(err);
|
||||
};
|
||||
}
|
||||
return (err, req, res, next) => {
|
||||
// handled errors do not need to be reported
|
||||
// the report a message and redirect the user
|
||||
if (
|
||||
isOpbeatDisabled ||
|
||||
isHandledError(err) ||
|
||||
// errors with status codes shouldn't be reported
|
||||
// as they are usually user messages
|
||||
err.statusCode ||
|
||||
err.status
|
||||
) {
|
||||
return next(err);
|
||||
}
|
||||
return opbeat.captureError(err, { request: req }, () => next(err));
|
||||
};
|
||||
return (err, req, res, next) => next(err);
|
||||
}
|
||||
|
@ -1,15 +1,6 @@
|
||||
require('dotenv').load();
|
||||
require('./utils/webpack-code-split-polyfill');
|
||||
|
||||
if (process.env.OPBEAT_ID) {
|
||||
console.log('loading opbeat');
|
||||
require('opbeat').start({
|
||||
appId: process.env.OPBEAT_ID,
|
||||
organizationId: process.env.OPBEAT_ORG_ID,
|
||||
secretToken: process.env.OPBEAT_SECRET
|
||||
});
|
||||
}
|
||||
|
||||
const _ = require('lodash');
|
||||
const Rx = require('rx');
|
||||
const loopback = require('loopback');
|
||||
|
Reference in New Issue
Block a user