Introduction
After the installation, turn on request tracing to see, under Requests in the dashboard, every request your service handled with its route, duration, queries and outbound calls — and to open the exact request behind any error. See Request Tracing for what the dashboard shows.Enable it
app.module.ts
forRootAsync, also pass the static flag so the interceptor can be
registered when the module is built:
What is recorded
- One server span per request, created by a global interceptor and named
after the route template from the controller and handler paths
(
GET /users/:id), never the URL. The application’s global prefix is not part of the name. An incoming W3Ctraceparentheader is continued. - PostgreSQL — the application’s
pgdriver is patched (found from the working directory; nothing is added to your dependencies), which covers Drizzle, TypeORM, Knex and plainpg. Each query becomes aclientspan named after the SQL template; parameters and rows are never recorded. - Outbound
fetch— every call becomes aclientspan namedMETHOD hostand carries atraceparentheader. Calls to the Lerix API itself are ignored.
LerixService:
The current trace
The trace id is available anywhere in the request throughcurrent(), for
example to put it in your own logs:
Sampling
Failed requests and requests that reported an error are always kept whole.
Every request’s root span is still sent, so the per-route counts and
percentiles in the dashboard cover 100% of traffic.
Errors and traces
Every error report made inside a request — the automatic filter’s reports as well as your owncaptureException / captureMessage calls — carries that
request’s trace, so the issue page shows the waterfall inline with the
failing query highlighted. An error reported outside any request (a job, a
startup check) records as before, with no trace attached.
Client addresses
Each request span carries the client’s address, resolved the way the project asks under Project settings → Tracing: in the defaultmasked mode the
SDK zeroes the last IPv4 octet or truncates IPv6 to its /64 before anything
is sent; in hashed and full modes the address is handled on the Lerix
side. The trusted-proxy depth and header decide how it is read from
X-Forwarded-For; the whole chain is never trusted.
Exporter options
Spans leave as OTLP/HTTP JSON. If the Lerix API is unreachable the batch is
counted and dropped; nothing is retried, nothing blocks a request, nothing
throws into your code. Counters are on
LerixService.tracing?.stats().