Liking cljdoc? Tell your friends :D

hive-compose.promote.trace

Traces as values: the TraceQL that finds a test's traces, the Tempo HTTP answers read into data, and the span that explains a failure. Pure: the adapter (hive-compose.adapter.tempo) does the HTTP, this namespace only reads and writes strings and maps.

TraceSummary (an -find-traces row): {:trace/id "<32 hex>" :trace/root-service :trace/root-name :trace/start-ms :trace/duration-ms}

Trace (a -trace answer): {:trace/id "<32 hex>" :trace/spans [{:span/id "<16 hex>" :span/parent-id "<16 hex>"|nil :span/name :span/service :span/start-ms :span/duration-ms :span/status :ok|:error|:unset :span/status-message :span/attrs {"key" value}}]}

Tempo answers OTLP JSON in its protobuf mapping: ids base64 (the OTLP JSON spec says hex; both are read, told apart by their alphabet and length), int64 as strings, attribute values as {stringValue|intValue| boolValue|doubleValue|arrayValue|kvlistValue|bytesValue}, spans under resourceSpans (or the older batches) and scopeSpans (or instrumentationLibrarySpans). Span attributes and resource attributes are merged into :span/attrs, the span's own winning.

Traces as values: the TraceQL that finds a test's traces, the Tempo HTTP
answers read into data, and the span that explains a failure. Pure: the
adapter (`hive-compose.adapter.tempo`) does the HTTP, this namespace only
reads and writes strings and maps.

TraceSummary (an `-find-traces` row):
  {:trace/id "<32 hex>" :trace/root-service :trace/root-name
   :trace/start-ms :trace/duration-ms}

Trace (a `-trace` answer):
  {:trace/id "<32 hex>"
   :trace/spans [{:span/id "<16 hex>" :span/parent-id "<16 hex>"|nil
                  :span/name :span/service :span/start-ms :span/duration-ms
                  :span/status :ok|:error|:unset :span/status-message
                  :span/attrs {"key" value}}]}

Tempo answers OTLP JSON in its protobuf mapping: ids base64 (the OTLP
JSON spec says hex; both are read, told apart by their alphabet and
length), int64 as strings, attribute values as {stringValue|intValue|
boolValue|doubleValue|arrayValue|kvlistValue|bytesValue}, spans under
resourceSpans (or the older batches) and scopeSpans (or
instrumentationLibrarySpans). Span attributes and resource attributes are
merged into :span/attrs, the span's own winning.
raw docstring

ancestryclj

(ancestry index s)

[span] from span s up to its root in index, s first; nil when the parent chain loops and reaches no root.

[span] from span `s` up to its root in `index`, `s` first; nil when the
parent chain loops and reaches no root.
sourceraw docstring

any-valueclj

(any-value v)

The Clojure value of an OTLP AnyValue map: string, long, boolean, double, vector (arrayValue), map (kvlistValue) or base64 string (bytesValue). Nil when it carries none.

The Clojure value of an OTLP AnyValue map: string, long, boolean, double,
vector (arrayValue), map (kvlistValue) or base64 string (bytesValue).
Nil when it carries none.
sourceraw docstring

attributeclj

(attribute k)

The TraceQL attribute reference of key k. A key that names its scope ("span.x", "resource.x") keeps it, one starting with "." is unscoped; any other takes its scope from default-scopes, else none.

The TraceQL attribute reference of key `k`. A key that names its scope
("span.x", "resource.x") keeps it, one starting with "." is
unscoped; any other takes its scope from `default-scopes`, else none.
sourceraw docstring

attributesclj

(attributes kvs)

{key value} of an OTLP attribute list [{"key" k "value" AnyValue}].

{key value} of an OTLP attribute list [{"key" k "value" AnyValue}].
sourceraw docstring

by-idclj

(by-id trace)

{span-id span} of trace's spans.

{span-id span} of `trace`'s spans.
sourceraw docstring

default-scopesclj

The TraceQL scope an attribute is matched in when its key names none: hive.run.id travels in OTEL_RESOURCE_ATTRIBUTES, test.id in baggage copied onto spans. Any other key is matched unscoped (.key).

The TraceQL scope an attribute is matched in when its key names none:
hive.run.id travels in OTEL_RESOURCE_ATTRIBUTES, test.id in baggage
copied onto spans. Any other key is matched unscoped (`.key`).
sourceraw docstring

depthclj

(depth index s)

How many parents lie between span s and its root in index (0 for a root); nil when its parent chain loops.

How many parents lie between span `s` and its root in `index` (0 for a
root); nil when its parent chain loops.
sourceraw docstring

describe-spanclj

(describe-span s)

One line naming span s for a report: service, name, status message.

One line naming span `s` for a report: service, name, status message.
sourceraw docstring

error-spansclj

(error-spans trace)

The spans of trace whose status is :error, in trace order.

The spans of `trace` whose status is :error, in trace order.
sourceraw docstring

escapeclj

(escape s)

s as the body of a TraceQL double-quoted string: backslash and quote escaped, control characters written as escapes, so the literal ends only at its closing quote and stays on one line.

`s` as the body of a TraceQL double-quoted string: backslash and quote
escaped, control characters written as escapes, so the literal ends only
at its closing quote and stays on one line.
sourceraw docstring

failing-spanclj

(failing-span trace)

The span that explains trace's failure: the deepest error span (the error furthest from its root is closest to the cause), the earliest of equally deep ones, then the least id. Nil when no span errs. A span whose parent chain loops (no root) is never chosen.

The span that explains `trace`'s failure: the deepest error span (the
error furthest from its root is closest to the cause), the earliest of
equally deep ones, then the least id. Nil when no span errs. A span whose
parent chain loops (no root) is never chosen.
sourceraw docstring

hex-id?clj

(hex-id? s)

True when s is a trace or span id in hex: 1 to 32 hex digits.

True when `s` is a trace or span id in hex: 1 to 32 hex digits.
sourceraw docstring

normalize-idclj

(normalize-id s width)

The lower-case hex of OTLP id s of width hex digits (32 for a trace, 16 for a span): hex as is (padded), else base64 decoded. Base64 of a trace or span id always ends in = (16 and 8 bytes), never a hex digit, so the two never read alike. Nil for a blank or unreadable id, or one longer than width.

The lower-case hex of OTLP id `s` of `width` hex digits (32 for a trace,
16 for a span): hex as is (padded), else base64 decoded. Base64 of a
trace or span id always ends in `=` (16 and 8 bytes), never a hex digit,
so the two never read alike. Nil for a blank or unreadable id, or one
longer than `width`.
sourceraw docstring

root?clj

(root? index s)

True when span s has no parent among index ({span-id span}): no parent id, or a parent the trace does not hold. A root of the trace's forest.

True when span `s` has no parent among `index` ({span-id span}): no parent
id, or a parent the trace does not hold. A root of the trace's forest.
sourceraw docstring

search-paramsclj

(search-params {:keys [attrs start-ms end-ms limit]})

{param value} of Tempo's /api/search for query ({:attrs :start-ms :end-ms :limit}): q (TraceQL), start and end in epoch seconds (start rounded down, end up, so the window is never narrowed), limit.

{param value} of Tempo's /api/search for `query` ({:attrs :start-ms
:end-ms :limit}): q (TraceQL), start and end in epoch seconds (start
rounded down, end up, so the window is never narrowed), limit.
sourceraw docstring

search-resultclj

(search-result body)

[TraceSummary] of a Tempo /api/search answer (parsed JSON, string keys). No traces is [].

[TraceSummary] of a Tempo /api/search answer (parsed JSON, string keys).
No traces is [].
sourceraw docstring

statusclj

(status code)

The :ok, :error or :unset of an OTLP span status code (2/1/0 or STATUS_CODE_ERROR/STATUS_CODE_OK/STATUS_CODE_UNSET).

The :ok, :error or :unset of an OTLP span status code (2/1/0 or
STATUS_CODE_ERROR/STATUS_CODE_OK/STATUS_CODE_UNSET).
sourceraw docstring

string-literalclj

(string-literal s)

s as a TraceQL string literal, quotes included.

`s` as a TraceQL string literal, quotes included.
sourceraw docstring

trace-resultclj

(trace-result trace-id body)

The Trace trace-id of a Tempo /api/traces/<id> answer (parsed JSON), spans sorted by start then id.

The Trace `trace-id` of a Tempo /api/traces/<id> answer (parsed JSON),
spans sorted by start then id.
sourceraw docstring

traceqlclj

(traceql attrs)

The TraceQL spanset filter matching every entry of attrs ({key value}), keys sorted so equal maps give equal queries: { span.test.id = "t" && resource.hive.run.id = "r" }. Empty attrs matches every span: { }.

The TraceQL spanset filter matching every entry of `attrs` ({key value}),
keys sorted so equal maps give equal queries: `{ span.test.id = "t" &&
resource.hive.run.id = "r" }`. Empty `attrs` matches every span: `{ }`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close