@tuia/koa-cat
v0.0.4
Published
koa-cat
Downloads
1
Readme
koa-cat
Nodejs项目接入Cat监控
Installation
yarn add @tuia/koa-cat
Documentation
Middleware
使用中间件,捕获所有请求的数据
const koa = require('koa');
const koaCat = require('@tuia/koa-cat');
const pkg = require('./package.json');
const app = new koa();
const cat = koaCat({
appkey: pkg.name
});
app.use(cat.middleware());
API
使用API,可灵活自由埋点
const koa = require('koa');
const koaCat = require('@tuia/koa-cat');
const pkg = require('./package.json');
const app = new koa();
const cat = koaCat({
appkey: pkg.name
});
const a = cat.threadCat.newTransaction('Context', 'A');
setTimeout(function() {
a.complete();
}, 1000)