Sanity Library Reference Docs
    Preparing search index...

    Telemetry for one MCP session. Returned by createMcpSessionTelemetry.

    interface McpSessionTelemetry {
        bind: (resource: WorkflowResource) => void;
        end: () => void;
        flush: () => Promise<void>;
        logger: TelemetryLogger<unknown>;
    }
    Index

    Properties

    Properties

    bind: (resource: WorkflowResource) => void

    Attach the session to the project that owns resource. Call it on every tool call: the first dataset resource wins, and everything else is ignored.

    end: () => void

    Stop the batching timer. Call it once, after the final McpSessionTelemetry.flush.

    flush: () => Promise<void>

    Send buffered events. Await it before the session ends, or the last batch is lost.

    logger: TelemetryLogger<unknown>

    Pass to createWorkflowEngine and registerWorkflowTools as telemetry. Until McpSessionTelemetry.bind runs, log() is dropped and trace() throws.