MCP Server Framework - v1.0.0
    Preparing search index...

    Interface ConnectionTelemetry

    Telemetry operations used by ConnectionStateManager.

    Abstracts tracing and metrics to avoid a direct dependency from connection/ → server/telemetry/. Callers inject the real implementation; the default is a no-op.

    interface ConnectionTelemetry {
        addSpanAttributes(
            attrs: Record<string, string | number | boolean | undefined>,
        ): void;
        addSpanEvent(
            name: string,
            attrs?: Record<string, string | number | boolean | undefined>,
        ): void;
        recordConnectionStateChange(previousState: string, newState: string): void;
        withSpan<T>(
            name: string,
            fn: (span: TelemetrySpan) => Promise<T>,
        ): Promise<T>;
    }
    Index

    Methods

    • Add attributes to the current active span.

      Parameters

      • attrs: Record<string, string | number | boolean | undefined>

      Returns void

    • Add a named event to the current active span.

      Parameters

      • name: string
      • Optionalattrs: Record<string, string | number | boolean | undefined>

      Returns void

    • Record a connection state transition in metrics.

      Parameters

      • previousState: string
      • newState: string

      Returns void