IMQCallHooks interface

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:

export interface IMQCallHooks 

Properties

Property

Modifiers

Type

Description

afterCall?

Function

(Optional) Runs after a client receives a response. Marks the span ERROR if the response carries one, then ends it.

beforeCall?

Function

(Optional) Runs before a client sends a request. Starts the CLIENT span and injects its trace context into the request metadata.

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.

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