Stone.js API
    Preparing search index...

    The telemetry collector.

    Creates spans/counters/gauges and hands the resulting TelemetryRecords to a pluggable exporter. Platform-agnostic: it knows nothing about HTTP/CLI/etc.; callers attach whatever attributes make sense. When disabled, every operation is a cheap no-op.

    Implements

    Index
    • Emits a counter increment.

      Parameters

      • name: string

        Counter name.

      • value: number = 1

        Increment (default 1).

      • attributes: Record<string, unknown> = {}

        Attributes.

      Returns void

    • Flushes the underlying exporter.

      Returns Promise<void>

    • Emits a gauge value.

      Parameters

      • name: string

        Gauge name.

      • value: number

        Value.

      • attributes: Record<string, unknown> = {}

        Attributes.

      Returns void

    • Returns boolean

      Whether telemetry is active.

    • Starts a span. When disabled, returns a no-op span so call sites stay branch-free.

      Parameters

      • name: string

        Span name.

      • attributes: Record<string, unknown> = {}

        Initial attributes.

      Returns TelemetrySpan

      The span.