1
0
mirror of https://github.com/nttgin/BGPalerter.git synced 2024-05-19 06:50:08 +00:00

sentry moved as module

This commit is contained in:
Massimo Candela
2020-01-18 19:48:33 +01:00
parent b34b3895f4
commit 883b05a5a8
5 changed files with 204 additions and 3 deletions

View File

@@ -190,7 +190,10 @@ checkForUpdatesAtBoot: true
# url: url_to_poll # url: url_to_poll
# intervalSeconds: 300 # intervalSeconds: 300
# method: get # method: get
#
# - file: sentryModule
# params:
# dsn: https://<key>@sentry.io/<project>
############################ ############################

View File

@@ -18,6 +18,10 @@ processMonitors:
url: url_to_poll url: url_to_poll
intervalSeconds: 300 intervalSeconds: 300
method: get method: get
- file: sentryModule
params:
dsn: https://<key>@sentry.io/<project>
``` ```
@@ -98,8 +102,25 @@ Parameters for this module are:
|method| The method used for the HTTP request. It can be `get` or `post`. | |method| The method used for the HTTP request. It can be `get` or `post`. |
## sentryModule
The sentryModule is a component that allows the monitoring of the BGPalerter process for runtime exceptions.
Useful especially for testing new experimental modules.
To enable this feature, create a new project on your Sentry server and grab the generated DSN.
In `config.yml` the sentryModule is declared as:
```yaml
processMonitors:
- file: sentryModule
params:
dsn: https://<key>@sentry.io/<project>
```
Parameters for this module are:
|Parameter| Description|
|---|---|
|dsn| The DSN where the logs will be sent. |

130
package-lock.json generated
View File

@@ -1981,6 +1981,92 @@
"fastq": "^1.6.0" "fastq": "^1.6.0"
} }
}, },
"@sentry/apm": {
"version": "5.11.1",
"resolved": "https://registry.npmjs.org/@sentry/apm/-/apm-5.11.1.tgz",
"integrity": "sha512-4iZH11p/7w9IMLT9hqNY1+EqLESltiIoF6/YsbpK93sXWGEs8VQ83IuvGuKWxajvHgDmj4ND0TxIliTsYqTqFw==",
"requires": {
"@sentry/browser": "5.11.1",
"@sentry/hub": "5.11.1",
"@sentry/minimal": "5.11.1",
"@sentry/types": "5.11.0",
"@sentry/utils": "5.11.1",
"tslib": "^1.9.3"
}
},
"@sentry/browser": {
"version": "5.11.1",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.11.1.tgz",
"integrity": "sha512-oqOX/otmuP92DEGRyZeBuQokXdeT9HQRxH73oqIURXXNLMP3PWJALSb4HtT4AftEt/2ROGobZLuA4TaID6My/Q==",
"requires": {
"@sentry/core": "5.11.1",
"@sentry/types": "5.11.0",
"@sentry/utils": "5.11.1",
"tslib": "^1.9.3"
}
},
"@sentry/core": {
"version": "5.11.1",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.11.1.tgz",
"integrity": "sha512-BpvPosVNT20Xso4gAV54Lu3KqDmD20vO63HYwbNdST5LUi8oYV4JhvOkoBraPEM2cbBwQvwVcFdeEYKk4tin9A==",
"requires": {
"@sentry/hub": "5.11.1",
"@sentry/minimal": "5.11.1",
"@sentry/types": "5.11.0",
"@sentry/utils": "5.11.1",
"tslib": "^1.9.3"
}
},
"@sentry/hub": {
"version": "5.11.1",
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.11.1.tgz",
"integrity": "sha512-ucKprYCbGGLLjVz4hWUqHN9KH0WKUkGf5ZYfD8LUhksuobRkYVyig0ZGbshECZxW5jcDTzip4Q9Qimq/PkkXBg==",
"requires": {
"@sentry/types": "5.11.0",
"@sentry/utils": "5.11.1",
"tslib": "^1.9.3"
}
},
"@sentry/minimal": {
"version": "5.11.1",
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.11.1.tgz",
"integrity": "sha512-HK8zs7Pgdq7DsbZQTThrhQPrJsVWzz7MaluAbQA0rTIAJ3TvHKQpsVRu17xDpjZXypqWcKCRsthDrC4LxDM1Bg==",
"requires": {
"@sentry/hub": "5.11.1",
"@sentry/types": "5.11.0",
"tslib": "^1.9.3"
}
},
"@sentry/node": {
"version": "5.11.1",
"resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.11.1.tgz",
"integrity": "sha512-FbJs0blJ36gEzE0rc2yBfA/KE+kXOLl8MUfFTcyJCBdCGF8XMETDCmgINnJ4TyBUJviwKoPw2TCk9TL2pa/A1w==",
"requires": {
"@sentry/apm": "5.11.1",
"@sentry/core": "5.11.1",
"@sentry/hub": "5.11.1",
"@sentry/types": "5.11.0",
"@sentry/utils": "5.11.1",
"cookie": "^0.3.1",
"https-proxy-agent": "^4.0.0",
"lru_map": "^0.3.3",
"tslib": "^1.9.3"
}
},
"@sentry/types": {
"version": "5.11.0",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.11.0.tgz",
"integrity": "sha512-1Uhycpmeo1ZK2GLvrtwZhTwIodJHcyIS6bn+t4IMkN9MFoo6ktbAfhvexBDW/IDtdLlCGJbfm8nIZerxy0QUpg=="
},
"@sentry/utils": {
"version": "5.11.1",
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.11.1.tgz",
"integrity": "sha512-O0Zl4R2JJh8cTkQ8ZL2cDqGCmQdpA5VeXpuBbEl1v78LQPkBDISi35wH4mKmLwMsLBtTVpx2UeUHBj0KO5aLlA==",
"requires": {
"@sentry/types": "5.11.0",
"tslib": "^1.9.3"
}
},
"@types/color-name": { "@types/color-name": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
@@ -2017,6 +2103,11 @@
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"dev": true "dev": true
}, },
"agent-base": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz",
"integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g=="
},
"ajv": { "ajv": {
"version": "6.10.2", "version": "6.10.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
@@ -3069,6 +3160,11 @@
} }
} }
}, },
"cookie": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
},
"copy-descriptor": { "copy-descriptor": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
@@ -4724,6 +4820,30 @@
"sshpk": "^1.7.0" "sshpk": "^1.7.0"
} }
}, },
"https-proxy-agent": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz",
"integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==",
"requires": {
"agent-base": "5",
"debug": "4"
},
"dependencies": {
"debug": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"requires": {
"ms": "^2.1.1"
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
}
}
},
"ignore": { "ignore": {
"version": "5.1.4", "version": "5.1.4",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz",
@@ -5321,6 +5441,11 @@
"yallist": "^3.0.2" "yallist": "^3.0.2"
} }
}, },
"lru_map": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz",
"integrity": "sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0="
},
"make-dir": { "make-dir": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
@@ -7702,6 +7827,11 @@
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz",
"integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=" "integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk="
}, },
"tslib": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
},
"tunnel-agent": { "tunnel-agent": {
"version": "0.6.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",

View File

@@ -30,6 +30,7 @@
"read-last-lines": "^1.7.2" "read-last-lines": "^1.7.2"
}, },
"dependencies": { "dependencies": {
"@sentry/node": "^5.11.1",
"axios": "^0.19.1", "axios": "^0.19.1",
"batch-promises": "^0.0.3", "batch-promises": "^0.0.3",
"brembo": "^2.0.3", "brembo": "^2.0.3",
@@ -44,8 +45,7 @@
"rpki-validator": "^1.0.9", "rpki-validator": "^1.0.9",
"syslog-client": "^1.1.1", "syslog-client": "^1.1.1",
"ws": "^7.2.1", "ws": "^7.2.1",
"yargs": "^15.1.0", "yargs": "^15.1.0"
"@sentry/node": "^5.10.2"
}, },
"pkg": { "pkg": {
"scripts": [ "scripts": [

View File

@@ -0,0 +1,47 @@
/*
* BSD 3-Clause License
*
* Copyright (c) 2019, NTT Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import * as Sentry from '@sentry/node';
export default class SentryModule {
constructor(connectors, params){
if (params.dsn){
Sentry.init({ dsn: params.dsn });
}
};
}