module:middleware/xray
- Description:
Tracing middleware, if matched the path and interval is set it sends AWS X-Ray traces to the configured remote or local host listening on UDP port 2000.
Traces are sent only every interval in ms as long as it is greater than 0.
Trace instance is exposed as
context.traceand implements TraceGlobal usage
Config:
middleware-xray-path = ^/app middleware-xray-interval = 60000api.app.get("/api/endpoint", middleware.xray)Explicit routing
Add explicit routes with different tracing options
api.app.get("/api/endpoint", middleware.xray.handle.bind({ path: /^\//, interval: 1000 }))
- Source:
Methods
(static) handle(context, next)
- Description:
Tracing middleware
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
context |
RequestContext | |
next |
function() |