UNPKG

egg-apigw-tracer

Version:

适配 API 网关的 HTTP 请求示踪器,用于 Egg.js 框架

18 lines (14 loc) 309 B
'use strict' const TRACER = Symbol('context#tracer') const Tracer = require('../../lib/tracer.js') module.exports = { get tracer() { if (!this[TRACER]) { this[TRACER] = new Tracer(this) } return this[TRACER] }, get traceId() { return this.tracer.traceId }, }