swagger-stats-ext
More Features
call init manually
swStats
koa middleware, not use express-to-koa
const app = app
report calls bewtween modules based on http protocol manually
add metric data for prometheus, "mcall_request_total" labeled
# HELP mcall_request_total The total number of all mcall based on http protocol requests
# TYPE mcall_request_total counter
mcall_request_total{service="user",method="GET",path="/info/get",http_status_code="400",code="0"} 1
swStats
params for reportMCall
name | optional | default | comments |
---|---|---|---|
service | N | module name | |
method | N | http method(GET/POST) | |
path | N | http path | |
http_code | N | http status code | |
code | Y | 0 | code returned by module |
more settings
const promConf = pm2: false // use pm2 for node server pathProm: '/prometheus' // add route like: "ip:port/{pathProm}",return prometheus metrics data // ...