Liking cljdoc? Tell your friends :D

d-core.tracing


*ctx*clj


append-cidclj

(append-cid cid segment)

Appends a segment, or returns the cid unchanged when the result would exceed the cap.

Appends a segment, or returns the cid unchanged when the result would exceed the cap.
raw docstring

child-ctxclj

(child-ctx ctx)

Create a child ctx under the given ctx (or a new root ctx if nil). The child appends its span to the cid, so a prefix query sees the whole request and the full id narrows to a hop.

Create a child ctx under the given ctx (or a new root ctx if nil). The child appends its
span to the cid, so a prefix query sees the whole request and the full id narrows to a hop.
raw docstring

decode-ctxclj

(decode-ctx s)

Decode ctx from a string like: t=...;s=...;p=...;c=... Returns nil when parsing fails.

Decode ctx from a string like: t=...;s=...;p=...;c=...
Returns nil when parsing fails.
raw docstring

encode-ctxclj

(encode-ctx {:keys [trace-id span-id parent-span-id cid]})

Encode ctx into a compact string suitable for headers and metadata: t=<trace-id>;s=<span-id>;p=<parent>;c=<cid>.

Encode ctx into a compact string suitable for headers and metadata:
`t=<trace-id>;s=<span-id>;p=<parent>;c=<cid>`.
raw docstring

ensure-ctxclj

(ensure-ctx ctx)

Ensure we have a base context. Creates a root ctx if nil, and gives a ctx its cid when it predates the cid field (or arrived without one).

Ensure we have a base context. Creates a root ctx if nil, and gives a ctx its cid when
it predates the cid field (or arrived without one).
raw docstring

max-cid-lengthclj

Upper bound for a correlation id. Each hop appends a segment, so a retry chain would otherwise grow without limit; at the cap the id stops growing and stays queryable.

Upper bound for a correlation id. Each hop appends a segment, so a retry chain would
otherwise grow without limit; at the cap the id stops growing and stays queryable.
raw docstring

max-cid-prefix-lengthclj

Room left for the request id and at least one hop after a business prefix.

Room left for the request id and at least one hop after a business prefix.
raw docstring

new-span-idclj

(new-span-id)

Short span id for a single hop.

Short span id for a single hop.
raw docstring

new-trace-idclj

(new-trace-id)

Short trace id for an entire request history.

Short trace id for an entire request history.
raw docstring

request-cidclj

(request-cid app use-case)

Conventional root for a request CID: <app>.<use-case>.REQ (e.g. APPX.SIGNIN.REQ).

The originator owns this value -- it names the application and the use case, which is what makes a prefix query meaningful (APPX.SIGNIN = every sign-in request of that app). Services adopt it and append; they never invent it.

Conventional root for a request CID: `<app>.<use-case>.REQ` (e.g. `APPX.SIGNIN.REQ`).

The **originator** owns this value -- it names the application and the use case, which
is what makes a prefix query meaningful (`APPX.SIGNIN` = every sign-in request of that
app). Services adopt it and append; they never invent it.
raw docstring

sanitize-cidclj

(sanitize-cid s)

A business prefix safe in a header and as a dotted path: [A-Za-z0-9._-], no leading or trailing separators, capped so there is room for a request id and a hop.

A business prefix safe in a header and as a dotted path: `[A-Za-z0-9._-]`, no leading or
trailing separators, capped so there is room for a request id and a hop.
raw docstring

with-ctxcljmacro

(with-ctx ctx & body)

Bind tracing context for the duration of body.

Bind tracing context for the duration of body.
raw 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