npm / @nestjs/observe
@nestjs/observe
What changed in @nestjs/observe 0.1 to 12, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
8 breaking17 security1 deprecations27 new APIs and options5 performance52 behavior and defaults1 tooling75 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@nestjs/observe 125 changes
Deprecations 1
The timeout option of built-in database, microservice, and gRPC indicators is deprecated; use .withTimeout() on the returned attempt instead.
New APIs and options 4
Creates the observability module and instrumentation provider used to configure the SDK.
The application option connects Nest's request lifecycle to the SDK's instrumentation.
Adds an official SDK for opt-in, Nest-native observability that reports requests, jobs, errors, and traces in terms of Nest components.
Configures the observability module with a service identifier.
@nestjs/observe 0.3158 changes
Breaking changes 8
Caught and answered database errors remain on the query span and lift to the HTTP request only when it ends in a 5xx.
The command stops with an error for a key pair outside the expected format or when the project's .env is tracked by git.
Response hooks end the trace of the request or message they receive regardless of the async context in which they run.
Work left running by an operation stops carrying its trace id 10 seconds after the operation ends, including in request IDs, logs, packets and jobs.
A message trace is dropped rather than held when its client disconnects before the handler settles.
CORS preflights are skipped unless http.tracePreflights is on.
Recorded inline numbers now appear as underscores, so existing groupings for affected queries shift once.
When sourceContext is enabled, an error whose message is reassigned after construction no longer gets code frames.
Security 14
Credentials are masked more thoroughly in recorded URLs, headers, log lines, error messages and code frames; free text uses the same sensitive-key names as attributes.
The link command opens only http(s) link pages and writes only inside the project directory.
The JWT redaction rule is now linear and also applies to error messages and request bodies captured with http.capture.body.
Outbound calls made with fetch are recorded as spans, with sensitive query parameters masked.
Captures request inputs only when a request fails or exceeds slowerThanMs; by default, it records a short safe-header allow-list and no body, and redacts everything recorded.
Outbound calls made with https are recorded as spans, with sensitive query parameters masked.
Outbound calls made with node:http are recorded as spans, with sensitive query parameters masked.
Credential key names are matched by suffix and masked in URLs, log attributes, and captured headers and bodies.
Stack frames are read only from lines following the error's own message, preventing a message containing a forged frame-shaped line from selecting an application source file.
Code-frame lines are redacted before they are sent.
Frame parsing uses a linear parser and caps line length and frame count to prevent event-loop blocking on crafted lines.
Symlinks are resolved before the containment check, preventing a symlink under the app root from directing the reader outside it.
Outbound calls made with undici are recorded as spans, with sensitive query parameters masked.
More URL parameters are masked, including keys ending in token, secret, signature, and similar suffixes; this can include pagination parameters such as pageToken.
New APIs and options 22
Every job run gets a trace of its own.
Traces can be exported as OpenTelemetry spans over OTLP.
When opted in, carries W3C traceparent and follows an OpenTelemetry SDK.
Adds a terminal command to link a project.
Custom request operation ids are supported.
An enabled option can switch the agent off.
Database queries for MSSQL (SQL Server) can be instrumented.
The collector is told which ingest modes the agent can read.
An objective decorator lets developers declare SLOs in code.
Configure matching requests by status code or a per-operation function to omit their span trees while still reporting the request and its error.
Adds the jobs.ignore option to skip tracing job runs.
A new ws option, getUserId, is available.
Setting body: true adds the request body to captures, capped at 2 KB and configurable up to 16 KB.
Setting capture: false turns request capture off.
Sets the slowness threshold for capturing request inputs; ordinary traffic is never recorded.
A new ws option, ignore, is available.
Legacy Bull is now supported alongside BullMQ as an optional peer.
Query and outbound-HTTP spans can be disabled with outgoing: false.
The database side of outgoing spans can be disabled independently with outgoing: { database: false }.
The HTTP side of outgoing spans can be disabled independently with outgoing: { http: false }.
A new ws option, setAttributes, is available.
A new ws option, tags, is available.
Performance 4
The agent's per-span cost is reduced, and its overhead is published.
Parsing forwarded log lines now takes linear time regardless of input, avoiding event-loop delays from long runs of whitespace.
Nest's Reflector is no longer instrumented, avoiding spans from repeated metadata lookups that added no insight.
The source-map cache is now bounded.
Behavior and default changes 48
An aborted request's trace is dropped as soon as the response closes on every adapter.
At most 1,000 custom metrics are reported; summaries without labels are capped at 1,000, and non-finite values or unkeyable label values are ignored.
Errors raised while parsing, validating or coercing request input are recorded by error class and code.
The processing start hook runs done synchronously.
A string entry matches the request path with or without a query string.
Microservice messages are named by the route they reached.
The agent shares Nest request, processing and dispatch hook slots with application hooks instead of replacing them; BullMQ processor-decorator overrides are kept.
Collector and OTLP replies are read up to 64 KiB.
The OTLP timeout covers the whole export.
An operation records at most 10,000 spans; later calls run untraced and are counted in an observe.unrecordedSpans tag.
Spans nest at most 256 levels deep.
The forwarder sends at most 50 entries per write, cuts lines at 8 kB and redacts the lines of a multi-line message together.
The first 20 captured errors in a trace retain details; later errors mark their span as failed. Error messages and stacks are limited to 4 kB and 8 kB.
Calling captureError outside a traced context warns once instead of throwing.
Stops tracing the internals of Nest's ConfigService.
Stops tracing the internals of Nest's validation pipes.
OpenTelemetry interop remains enabled through collector outages.
OpenTelemetry traces are carried into jobs and microservice messages, allowing trace context to follow work across these boundaries.
Outbound model-provider calls now report model and token usage.
The MongoDB driver's client and database handles are no longer instrumented.
The agent's version is now sent.
Any attribute key is accepted by default.
Store types are now interfaces.
The type is now optional because the environment fills it.
Linking now installs and wires the SDK in apps that do not use it yet.
While an account's overage is paused, only server errors are sent.
Rejected credentials are no longer retried on every flush.
Forwarded log metadata is constrained to collector limits: context is redacted and capped at 255 characters, trace ids are validated, and levels are mapped to Nest's.
JSON logs from winston, pino and similar loggers map info, warning and trace to Nest levels; other levels are kept as attributes.level.
The collector connection stays open between flushes.
Long class names are cut to fit the collector.
Stalls are recorded alongside a runtime sample in the event loop delay.
Event loop delay, utilisation, and GC kinds are reported per window.
Long method names are cut to fit the collector.
The service version is inferred from the deploy environment.
Jobs added with QueuePro.add carry the trace id of the request that enqueued them, so they show up as one trace.
Jobs added with QueuePro.addBulk carry the trace id of the request that enqueued them, so they show up as one trace.
This package is now an optional peer dependency for BullMQ Pro tracing.
Jobs run by BullMQ Pro WorkerPro are now traced.
A BullMQ job enqueued while handling a request carries that request's trace id; repeatable jobs start their own trace.
Inline GraphQL number literals are blanked in recorded documents, so queries differing only in those numbers group as one shape.
Queries through mongodb are recorded as spans under the provider method, with verb-and-table names and statements stripped of literals; bound parameters are never read.
Queries through mysql2 are recorded as spans under the provider method, with verb-and-table names and statements stripped of literals; bound parameters are never read.
@nestjs/websockets is an optional peer.
Queries through pg are recorded as spans under the provider method, with verb-and-table names and statements stripped of literals; bound parameters are never read.
Custom redaction keys now also apply to URL query strings.
Each message handled by a decorated method is reported as an operation named GatewayClass:pattern on both ws and socket.io adapters.
The current trace id is forwarded to outbound services and adopted from microservice packet metadata; a header set by the application is not overwritten, and packet values are validated like HTTP headers.
Tooling 1
The CLI tells coding agents where the app's production data is.
Fixes and other changes 61
Callback-style Bull processors settle through done.
Processors keep their arity so a processor that takes an abort signal can be cancelled.
Replies to ClientProxy and ClientGrpc calls arrive in the caller's context.
A batch too large to send whole is sent without its largest entries rather than dropped.
mysql2 callbacks run in their caller's context.
pg callbacks run in their caller's context.
SQL statements are read more accurately for MySQL, Postgres and MSSQL before they are recorded.
A traced method's promise is returned exactly as the method returned it, unless the method is async.
Queued undici requests run in their caller's context.
Handlers behind interceptors are traced again inside their message's context, allowing TracerService to work there.
Reads the code frames of an error whose name contains its message.
Opens a series when a labelled gauge is set to a value.
Keeps a metric working when it is fetched again with an initial value.
Places exported jobs and messages under the span that sent them.
Interop works from start-up, and jobs run under bullmq-otel's span.
ioredis clients' spans are labeled after redis and cluster.
The ONLY keyword is ignored when extracting table names.
A traced preflight that recorded no spans is now reported.
Trace messages name the trace ID rather than the registry key.
Releases after 0.3.20 are licensed for the hosted service only.
RPC and HTTP executions that share a trace ID are isolated.
Guards deferred trace completion callbacks.
Ignore regex matching is now deterministic.
Guards option callbacks that run before the handler, preventing premature callback execution from causing problems.
The variables production needs are now named.
Finished spans are shipped when a span outlives its trace.
The response hook calls done so Fastify runs later hooks.
A span that outlives its trace now triggers a warning rather than an error.
The collector says once that it accepted the first batch.
Driver copies nested in Prisma's pg adapter and other dependents are patched.
A paced Free day is distinguished from a spent allowance.
When the collector rejects a batch for an invalid or oversized value, the agent removes just that value or entry and resends the rest instead of dropping the batch.
The JWT rule no longer matches a token directly preceded by a hyphen; the token= and Bearer rules are unchanged.
maxTracesPerBatch is capped at 5000, the collector's maximum accepted batch size.
The notice now states what data is still kept, and a new notice covers trimmed traces on paid plans.
A trace id is read from a log line only if it matches
[A-Za-z0-9._:-]{1,128}; otherwise the line uses the trace id of its request.Forwarded VERBOSE lines now carry their level and context.
Buffered telemetry is flushed before the worker shuts down.
Trace arrays are preserved during degraded ingestion.
Instances without a constructor continue to work.
Instrumented methods return the original promise.
Async hooks symbols are ignored when distinguishing a plain promise, improving promise detection.
Plain promises are chained so a dropped rejection still surfaces.
The URL fallback operation ID now uses its route path.
Placeholder keys now link to the demo instead of returning a 401.
Long custom metric descriptions are cut to fit the collector.
Custom metric label combinations rejected by the collector are refused.
Long custom metric labels are cut to fit the collector.
Long custom metric names are cut to fit the collector.
Applications on Nest versions before 11.1.4 can start with HTTP untraced.
The wire contract declares metric readings as they are sent.
Non-finite metric values are ignored instead of being recorded or causing an error.
A long service id is cut to the length accepted by the collector.
Long span names are cut to fit the collector.
Constructors held in provider fields are left untraced.
Named service versions are cut to the length accepted by the collector.
Wrapped @nestjs/bullmq processors now receive the lock token and abort signal passed by BullMQ after the job.
On the specified RabbitMQ, TCP, NATS, Redis and MQTT versions, handler rejections reach Nest's error logging instead of going unhandled.
Failing Kafka handlers now retain their partition and retry according to kafkajs retry options, matching behavior without the agent.
Fixed the logger patcher.
Fixed the stdout forwarder.
@nestjs/observe 0.27 changes
Security 2
Caller-chosen inputs are bounded.
Error payloads are redacted.
Performance 1
Collapses n+1 and parallel executions of the same spans.
Behavior and default changes 1
Worker failures are classified by where they are thrown.
Fixes and other changes 3
The flush interval floor is honored when arming the timer.
Stops respawning the worker on shutdown.
Stops sending spans that the collector has said it is discarding.
@nestjs/observe 0.116 changes
Security 1
Custom-transport operation ids are hardened.
New APIs and options 1
Adds rate limiting.
Behavior and default changes 3
Adds an ingest refusal message for better user experience.
Trace IDs use UUID v7.
The schedule package is now instrumented.
Fixes and other changes 11
Wrappers keep the original method arity.
Adds support for NestJS v12, allowing developers to use @nestjs/observe with that NestJS version.
Fixed a breakage involving internal slots.
The package now attempts to sanitize broken entries.
Fixed an issue involving skipping the instrumentation hook.
Fixed an issue involving private fields.
Fixed broken spans.
Manual spans now have the completed-caller tolerance that auto spans have.
Optional peers are loaded only when present, including @nestjs/microservices and @nestjs/bullmq.
A span starting under an already completed caller no longer crashes.
Fixes CommonJS compatibility.