Core - v1.0.0
    Preparing search index...

    Interface TelemetrySink<TRuntime>

    A sink for measurements — durations, counts, statuses — meant to be aggregated rather than read back individually.

    Deliberately distinct from logging. A telemetry backend samples at volume, which is right for rates and percentiles and wrong for anything that must be read back verbatim; a log line is the opposite. Keeping them as two capabilities is what stops one being quietly used for the other's job.

    Every write is best-effort and returns a boolean instead of throwing: telemetry must never be able to fail the request it is describing.

    Bayu Dwiyan Satria

    1.0.0

    1.0.0

    interface TelemetrySink<TRuntime = unknown> {
        event(
            runtime: TRuntime,
            name: string,
            dimensions?: string[],
            measures?: number[],
        ): boolean;
        isAvailable(runtime: TRuntime): boolean;
        request(runtime: TRuntime, metric: RequestMetric): boolean;
    }

    Type Parameters

    • TRuntime = unknown

      The runtime handle the sink is resolved from.

    Hierarchy (View Summary)

    Implemented by

    Index
    • Records a domain metric.

      Parameters

      • runtime: TRuntime

        The runtime handle.

      • name: string

        The metric name — the key it is grouped by.

      • Optionaldimensions: string[]

        String dimensions to filter and group by.

      • Optionalmeasures: number[]

        Numeric measurements to aggregate.

      Returns boolean

      true when the data point was accepted.

    • Reports whether the capability is actually usable on this runtime.

      Parameters

      Returns boolean

      true when calls will reach a real backing resource.

      A capability backed by an optional resource answers false when that resource was never provisioned. Implementations must document what each method does in that state — degrade or throw — and must not vary it, since a caller choosing between two implementations is relying on the answer meaning the same thing in both.