@grow-codes/zipkin - v0.1.1
    Preparing search index...

    Class ZipkinQueryClient

    Reads traces back from Zipkin (port 9411): the native v2 query API (getTraceSpans, getTraces, getTraceMany, listServices, listSpans, listRemoteServices, getDependencies, autocompleteKeys, autocompleteValues) and the SPEC §5 TraceQueryClient (getTrace, searchTraces, listOperations, waitForTrace) on top of it. Every call is a GET (retried on 5xx, 429 and network errors).

    Get one from ZipkinClient.query (shares the client's connections) or construct it from a config (owns its connections; call close).

    Hierarchy (View Summary)

    Index
    • Tag keys the server indexes for autocomplete: GET /api/v2/autocompleteKeys (the server's AUTOCOMPLETE_KEYS, [] when unset).

      Parameters

      Returns Promise<string[]>

    • Distinct values seen for an autocomplete key: GET /api/v2/autocompleteValues?key= (sorted; [] for a key that is not in AUTOCOMPLETE_KEYS).

      Parameters

      Returns Promise<string[]>

    • Releases connections when this client owns them (no-op for client.query). Idempotent.

      Returns Promise<void>

    • Several traces by id: GET /api/v2/traceMany. Ids are lower-cased and de-duplicated (a 16-character id equals its zero-padded 32-character form); an empty list returns [] without a request, a single id uses GET /api/v2/trace/{id}, more are fetched in chunks of TRACE_MANY_CHUNK. Missing traces are omitted; the result follows the request order.

      Parameters

      Returns Promise<ZipkinSpan[][]>

    • Searches traces: GET /api/v2/traces, newest first, one ZipkinSpan[] per trace. No match returns []. Invalid filters (limit <= 0, maxDurationMicros without or below minDurationMicros, non-positive endTs/lookbackMs) throw ValidationError without a request.

      Parameters

      Returns Promise<ZipkinSpan[][]>

    • One trace in the native model: GET /api/v2/trace/{traceId}. Returns null when the trace does not exist (404). The id is lower-cased; anything but 16 or 32 hex characters throws ValidationError without a request. Spans come back in storage order.

      Parameters

      Returns Promise<ZipkinSpan[] | null>

    • Remote services called by a service (remoteEndpoint.serviceName on its spans): GET /api/v2/remoteServices?serviceName= (sorted).

      Parameters

      Returns Promise<string[]>

    • Span names of a service: GET /api/v2/spans?serviceName= (sorted; unknown service → []).

      Parameters

      Returns Promise<string[]>