kinetex - v1.0.0-rc.1
    Preparing search index...

    Interface OTelSpan

    Minimal interface for an OpenTelemetry-compatible span. Kinetex does NOT take a hard dependency on @opentelemetry/api.

    interface OTelSpan {
        spanContext(): { traceId: string; spanId: string; traceFlags: number };
        setAttribute(key: string, value: string | number | boolean): this;
        setStatus(status: { code: number; message?: string }): this;
        recordException(err: Error): this;
        end(): void;
    }
    Index

    Methods

    • Return the W3C Trace Context for this span.

      Returns { traceId: string; spanId: string; traceFlags: number }

      An object with traceId (hex string), spanId (hex string), and traceFlags (bitmask of trace options).

      • traceId: string

        Trace ID (hex string).

      • spanId: string

        Span ID (hex string).

      • traceFlags: number

        Trace flags bitmask.

    • Set a key-value attribute on the span.

      Parameters

      • key: string
      • value: string | number | boolean

      Returns this

    • Set the span status (OK / ERROR).

      Parameters

      • status: { code: number; message?: string }

      Returns this

    • Record an exception on this span.

      Parameters

      • err: Error

      Returns this