# instrument() function · @imqueue/datadog

Source: https://imqueue.org/api/datadog/latest/datadog.instrument/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/datadog 3.2.0 — generated reference, not hand-written

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:**

```typescript
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.

