prometheus插件
egg-xpromInstall
$ npm i egg-xprom --save
Usage
// {app_root}/config/plugin.js exports.xprom = { enable: true, package: 'egg-xprom', };
Configuration
// {app_root}/config/config.default.js exports.xprom = { port:9999, // default 9999 ;Docker need EXPOSE 9999 name:'xprom-test' // default project name };
see config/config.default.js for more detail.
Other
plugin will upload curl request monitor data.
if url is http://baidu.com,monitor targetServer is baidu.com;
if url is http://message-platform:10000,monitor targetServer is message-platform;
if url is http://api.xc22hanger.ccn/device-platform/ecarx_ca22r/msisdn/2,monitor targetServer is api.xc22hanger.ccn
if you want your custom targetServer,you can add field promServerName
example:
await this.app.curl('http://baidu.com', { method: 'GET', promServerName: 'myCustomName' });
Questions & Suggestions
Please open an issue here.
License
HomePage
https://github.com/EcarxCloudPlatform/egg-xprom#readme