kinetex - v1.4.0
    Preparing search index...

    Interface OTelTracer

    Minimal interface for an OpenTelemetry-compatible tracer. Kinetex does NOT take a hard dependency on @opentelemetry/api. Instead, pass a tracer that implements this interface.

    Compatible with @opentelemetry/api's Tracer interface — just pass trace.getTracer("kinetex") from your OTel SDK setup.

    interface OTelTracer {
        startSpan(name: string, options?: { kind?: number }): OTelSpan;
        recordHistogram?(
            name: string,
            value: number,
            attributes?: MetricAttributes,
        ): void;
        incrementCounter?(
            name: string,
            value?: number,
            attributes?: MetricAttributes,
        ): void;
    }
    Index
    • Start a new OpenTelemetry span.

      Parameters

      • name: string

        The span name (e.g. "HTTP GET").

      • Optionaloptions: { kind?: number }

        Optional span options (e.g. kind for CLIENT/SERVER).

      Returns OTelSpan

      An OTelSpan instance for recording the span lifecycle.

    • Record a value into a histogram. Optional — omit it and only spans are produced.

      Parameters

      • name: string

        Instrument name.

      • value: number

        Recorded value. For http.client.request.duration this is in seconds, matching OpenTelemetry semantic conventions.

      • Optionalattributes: MetricAttributes

        Low-cardinality dimensions (method, status, host).

      Returns void

    • Increment a counter. Optional — omit it and only spans are produced.

      Parameters

      • name: string

        Instrument name.

      • Optionalvalue: number

        Amount to add (default 1).

      • Optionalattributes: MetricAttributes

        Low-cardinality dimensions.

      Returns void