Beignet API reference
    Preparing search index...

    Interface ServerInstrumentationOptions<Ctx>

    Options for the server-owned request instrumentation pipeline.

    The server resolves request IDs and W3C trace context before user hooks and context creation run, writes them to response headers, and records request and error events into the resolved provider instrumentation port (ports.instrumentation, then ports.devtools) after responses are sent.

    Pass instrumentation: false to createServer(...) to disable headers and event recording entirely.

    interface ServerInstrumentationOptions<Ctx = unknown> {
        ignorePaths?: readonly string[];
        redact?: (
            event: ProviderInstrumentationEvent,
        ) => ProviderInstrumentationEvent;
        requestIdHeader?: string | false;
        shouldCapture?: (
            args: {
                contract: HttpContractConfig;
                ctx?: Ctx;
                error?: unknown;
                req: HttpRequestLike;
                response: HttpResponseLike;
            },
        ) => boolean;
        traceContextHeader?: string
        | false;
    }

    Type Parameters

    • Ctx = unknown
    Index
    ignorePaths?: readonly string[]

    Request path prefixes that should not enter ambient correlation or record events. Response headers are still written.

    Defaults to the devtools dashboard prefix so its polling traffic does not fill the event timeline.

    ["/api/devtools"]
    

    Apply a custom redactor to events produced by the server. Sink-level redaction (such as the devtools redactor) still runs when events are stored.

    requestIdHeader?: string | false

    Request/response header used for the request correlation ID.

    Pass false to avoid reading or writing a request ID header.

    "x-request-id"
    
    shouldCapture?: (
        args: {
            contract: HttpContractConfig;
            ctx?: Ctx;
            error?: unknown;
            req: HttpRequestLike;
            response: HttpResponseLike;
        },
    ) => boolean

    Decide whether to capture a completed request event.

    traceContextHeader?: string | false

    W3C trace context header used to correlate events with distributed traces.

    Pass false to avoid reading or writing a trace context header.

    "traceparent"