Liking cljdoc? Tell your friends :D

hive-compose.promote.why

Pure: the failure bundle that answers compose why test=T (hc-10).

From the case that failed (a Report case, hc-8), its cell result, the traces carrying its test id, the container logs of the run and the stack plan, bundle folds one FailureBundle:

{:why/test-id :why/run :why/window [start-ms end-ms] :why/case {:case/id :case/name :case/status :case/message ..} :why/cell {:suite/id :project :status :exit :oom/service :oom/cap :oom/line} the :oom keys only when the runner was OOM-killed :why/failing-span {:span/id :trace/id :span/service :span/name :span/status :span/status-message :span/attrs}? :why/span-path [{:span/id :span/service :span/name :span/status :span/status-message}] root first, failing span last :why/traces [{:trace/id :trace/root-name :errors n :spans n}] :why/logs {service [line]} lines inside the window +- slack :why/plan {:run :stack :status :instances :consumers}? :why/summary "one line"}

render-markdown writes it for a human. log-window is the timestamp filter of log lines. No IO: the pipeline (hive-compose.pipeline.why) reads the files, queries the trace store and the engine.

Pure: the failure bundle that answers `compose why test=T` (hc-10).

From the case that failed (a Report case, hc-8), its cell result, the
traces carrying its test id, the container logs of the run and the stack
plan, `bundle` folds one FailureBundle:

  {:why/test-id :why/run :why/window [start-ms end-ms]
   :why/case {:case/id :case/name :case/status :case/message ..}
   :why/cell {:suite/id :project :status :exit
              :oom/service :oom/cap :oom/line}   the :oom keys only when
                                                 the runner was OOM-killed
   :why/failing-span {:span/id :trace/id :span/service :span/name
                      :span/status :span/status-message :span/attrs}?
   :why/span-path [{:span/id :span/service :span/name :span/status
                    :span/status-message}]  root first, failing span last
   :why/traces [{:trace/id :trace/root-name :errors n :spans n}]
   :why/logs {service [line]}   lines inside the window +- slack
   :why/plan {:run :stack :status :instances :consumers}?
   :why/summary "one line"}

`render-markdown` writes it for a human. `log-window` is the timestamp
filter of log lines. No IO: the pipeline (`hive-compose.pipeline.why`)
reads the files, queries the trace store and the engine.
raw docstring

bundleclj

(bundle {:keys [case test-id cell-result traces logs plan window slack-ms]})

The FailureBundle of one failed case (see the ns doc). in: :case a Report case {:case/id :case/name :case/status :case/message ..} :test-id the test id the spans carry (default the case id) :cell-result the hc-8 cell result {:run/id :suite/id :project :exit :status :started-at :finished-at ..} :traces [Trace] found for the case :logs {service text} :plan a stack-status row or StackPlan, optional :window [start-ms end-ms], default the cell's :slack-ms default default-slack-ms The failing span, when there is one, is a span of one of traces, and the span path runs from that trace's root down to it.

The FailureBundle of one failed case (see the ns doc). `in`:
  :case        a Report case {:case/id :case/name :case/status :case/message ..}
  :test-id     the test id the spans carry (default the case id)
  :cell-result the hc-8 cell result {:run/id :suite/id :project :exit :status
               :started-at :finished-at ..}
  :traces      [Trace] found for the case
  :logs        {service text}
  :plan        a stack-status row or StackPlan, optional
  :window      [start-ms end-ms], default the cell's
  :slack-ms    default `default-slack-ms`
The failing span, when there is one, is a span of one of `traces`, and the
span path runs from that trace's root down to it.
sourceraw docstring

case-windowclj

(case-window window cell-result)

[start-ms end-ms] of a case: window when given, else the cell's :started-at/:finished-at.

[start-ms end-ms] of a case: `window` when given, else the cell's
:started-at/:finished-at.
sourceraw docstring

cell-rowclj

(cell-row cell-result)

A cell result in a bundle: suite, project, status, exit and, when its runner was OOM-killed (hc-16b), the finding's service, cap and line.

A cell result in a bundle: suite, project, status, exit and, when its
runner was OOM-killed (hc-16b), the finding's service, cap and line.
sourceraw docstring

default-slack-msclj

How far before and after the case window log lines are still kept.

How far before and after the case window log lines are still kept.
sourceraw docstring

failing-spanclj

(failing-span traces)

[trace span] explaining the failure across traces: each trace's trace-failing-span, then the one with a message, the deepest, the earliest, the least trace id. Nil when none errs.

[trace span] explaining the failure across `traces`: each trace's
`trace-failing-span`, then the one with a message, the deepest, the
earliest, the least trace id. Nil when none errs.
sourceraw docstring

line-msclj

(line-ms line)

Epoch ms of the first RFC 3339 timestamp in log line line (docker's --timestamps prefix, or one the service wrote), nil when it holds none.

Epoch ms of the first RFC 3339 timestamp in log line `line` (docker's
`--timestamps` prefix, or one the service wrote), nil when it holds none.
sourceraw docstring

log-windowclj

(log-window text window)
(log-window text [start-ms end-ms] slack-ms)

The lines of log text that fall inside [start-ms end-ms] widened by slack-ms on both sides, in order. A line with no timestamp continues the timestamped line before it (a stack trace) and is kept with it; untimed lines before the first timestamp are dropped. A nil bound is open. Widening the window never drops a line it kept.

The lines of log `text` that fall inside `[start-ms end-ms]` widened by
`slack-ms` on both sides, in order. A line with no timestamp continues the
timestamped line before it (a stack trace) and is kept with it; untimed
lines before the first timestamp are dropped. A nil bound is open. Widening
the window never drops a line it kept.
sourceraw docstring

max-log-linesclj

Lines kept per service in a bundle; the last ones win (nearest the failure).

Lines kept per service in a bundle; the last ones win (nearest the failure).
sourceraw docstring

plan-summaryclj

(plan-summary plan)

A stack-status row (hc-6 stack-status) or a StackPlan, reduced to what a bundle needs: run, stack, status, instances {id {:compose-project :shared? :services}} and consumers {id {:compose-project :services}}. Nil for nil.

A stack-status row (hc-6 `stack-status`) or a StackPlan, reduced to what a
bundle needs: run, stack, status, instances {id {:compose-project :shared?
:services}} and consumers {id {:compose-project :services}}. Nil for nil.
sourceraw docstring

render-markdownclj

(render-markdown b)

FailureBundle b as Markdown: summary, case, failing span with its attributes, the span path from the root, traces, plan and logs.

FailureBundle `b` as Markdown: summary, case, failing span with its
attributes, the span path from the root, traces, plan and logs.
sourceraw docstring

span-pathclj

(span-path trace s)

[span-row] from the root of trace down to span s, root first, s last.

[span-row] from the root of `trace` down to span `s`, root first, `s` last.
sourceraw docstring

split-compose-logsclj

(split-compose-logs text)

{service text} of docker compose logs output text, each line keyed by the service its <service>-<n> | prefix names (the line kept whole). Lines with no prefix go under "".

{service text} of `docker compose logs` output `text`, each line keyed by
the service its `<service>-<n>  | ` prefix names (the line kept whole).
Lines with no prefix go under "".
sourceraw docstring

summary-lineclj

(summary-line {:why/keys [test-id case failing-span cell]})

One line: what failed, the span that explains it and, when the cell's runner was OOM-killed, its why line ('<service> OOM-killed at <cap>').

One line: what failed, the span that explains it and, when the cell's
runner was OOM-killed, its why line ('<service> OOM-killed at <cap>').
sourceraw docstring

trace-failing-spanclj

(trace-failing-span trace)

The span of trace that explains its failure: the deepest error span carrying a status message (otelhttp blanks the message of a 5xx server span, so the cause sits on a child), else the deepest error span, as trace/failing-span. Ties go to the earliest start, then the least id. Nil when no span errs below a root.

The span of `trace` that explains its failure: the deepest error span
carrying a status message (otelhttp blanks the message of a 5xx server
span, so the cause sits on a child), else the deepest error span, as
`trace/failing-span`. Ties go to the earliest start, then the least id.
Nil when no span errs below a root.
sourceraw docstring

trace-rowclj

(trace-row t)

A trace in a bundle: id, root, how many spans and errors.

A trace in a bundle: id, root, how many spans and errors.
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