instrument() function

Installs the tracing hooks into @imqueue/rpc.

The hooks land on the default client and service options, so every client and service created afterwards is traced without touching application code. This deliberately does not use dd-trace's automatic module patching: that path needs the tracer loaded before @imqueue/rpc, which cannot be guaranteed for an ESM application, whereas the default options are read when a client or service is constructed — always after this call.

Signature:

export declare function instrument(): Promise<boolean>;

Returns:

Promise<boolean>

true if this call installed the hooks, false if they were already installed

Remarks

Called for you at import time, so applications never need it. Note what the timing implies: a client or service constructed BEFORE this ran copied the un-hooked defaults and is not traced.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.