# IMQCallHooks interface · @imqueue/opentelemetry

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

The subset of `@imqueue/rpc`'s default option singletons this instrumentation mutates. `beforeCall`/`afterCall` are used on the client; `wrapCall` (the around-hook) is used on the service so the handler runs inside the span's OpenTelemetry context.

**Signature:**

```typescript
export interface IMQCallHooks 
```

## Properties


| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [afterCall?](https://imqueue.org/api/opentelemetry/latest/opentelemetry.imqcallhooks.aftercall/) |  | Function | _(Optional)_ Runs after a client receives a response. Marks the span `ERROR` if the response carries one, then ends it. |
| [beforeCall?](https://imqueue.org/api/opentelemetry/latest/opentelemetry.imqcallhooks.beforecall/) |  | Function | _(Optional)_ Runs before a client sends a request. Starts the CLIENT span and injects its trace context into the request metadata. |
| [wrapCall?](https://imqueue.org/api/opentelemetry/latest/opentelemetry.imqcallhooks.wrapcall/) |  | Function | _(Optional)_ Wraps a service's handling of a request — an around-hook receiving a `next` callback. Used instead of a before/after pair so the handler can run INSIDE the SERVER span's context, which is what makes spans created downstream nest under it. |

