middleware instrumentation is enabled.
Supported frameworks
Express
expressFastify
fastifyKoa
koaHapi
@hapi/hapiNext.js
nextHono
honoRestify
restifyConnect
connectMoleculer
moleculerConfiguration
All web framework plugins extend theHttpServer interface and share these configuration options:
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable the plugin. |
service | string | — | Override the service name. |
blocklist | string | RegExp | Function | Array | [] | Paths that should not be instrumented. |
allowlist | string | RegExp | Function | Array | /.*/ | Paths that should be instrumented. |
headers | string[] | [] | Request/response headers to capture as span tags. |
validateStatus | (code: number) => boolean | code => code < 500 | Determines if a status code should be treated as an error. |
middleware | boolean | true | Create spans for individual middleware functions. |
hooks.request | (span, req, res) => void | — | Hook called just before the request span finishes. |
queryStringObfuscation | boolean | string | RegExp | — | Obfuscate query string values in http.url. |
Per-framework examples
- Express
- Fastify
- Koa
- Hapi
- Next.js
- Hono
Span hooks
Span hooks let you add custom tags to spans created by the framework plugin without writing middleware. The hook runs just before the request span finishes, so all request and response information is available.Blocking paths (AppSec)
Useblocklist to prevent instrumentation of health check or metrics endpoints. This reduces noise in your traces:
blocklist and allowlist affect tracing only, not AppSec protection.
Moleculer
Themoleculer plugin instruments both the Moleculer service bus client and server. Configure each side independently:
