Liking cljdoc? Tell your friends :D

ken.context

Functions for collecting context from various sources and merging into a collected context map.

Some example sources of context data:

  • environmental data about stack/sys/env/host names
  • request call graph context from prodigal
  • tracing span information
Functions for collecting context from various sources and merging into a
collected context map.

Some example sources of context data:
- environmental data about stack/sys/env/host names
- request call graph context from prodigal
- tracing span information
raw docstring

ken.core

Core user API namespace for ken instrumentation.

There are really three significant phases where data is collected to form an event or 'span':

  1. At the beginning of a span, to initialize the event data:
    • base: label, time, level
    • callsite: ns, line
    • trace: trace-id, parent-id, span-id
    • sampling: sample-rate, keep?
  2. During a span:
    • using annotate, error, and time
  3. At the end of a span:
    • context collection
    • thread name
    • duration

An observe call performs the first and third phases back-to-back and immediately sends an event, while watch will wrap a body of code, providing time to enrich it with extra data in phase two.

Core user API namespace for ken instrumentation.

There are really three significant phases where data is collected to form an
event or 'span':
1. At the _beginning_ of a span, to initialize the event data:
   - base: label, time, level
   - callsite: ns, line
   - trace: trace-id, parent-id, span-id
   - sampling: sample-rate, keep?
2. _During_ a span:
   - using annotate, error, and time
3. At the _end_ of a span:
   - context collection
   - thread name
   - duration

An `observe` call performs the first and third phases back-to-back and
immediately sends an event, while `watch` will wrap a body of code, providing
time to enrich it with extra data in phase two.
raw docstring

ken.event

Base event attributes and functions.

Base event attributes and functions.
raw docstring

ken.tap

Observability instrumentation using a global 'tap' which can have events reported to it from any location in the code. This draws inspiration from Clojure's tap>, but is more directly targeted at instrumentation.

Observability instrumentation using a global 'tap' which can have events
reported to it from any location in the code. This draws inspiration from
Clojure's `tap>`, but is more directly targeted at instrumentation.
raw docstring

ken.trace

Tracing support for instrumenting code.

Trace data is structured as events with a few special properties:

  • ::trace/trace-id The parent identifier for the overall trace of all linked events.
  • ::trace/span-id A unique identifier for this event.
  • ::trace/parent-id The span which is the parent of this one.
  • ::trace/keep? A boolean to represent a sampling decision for events sent to ken on whether to keep or drop the spans of a trace.
    • The absence of this key means the observed event will be kept and forwarded along. This is the default state.
    • false means to discard a span. This decision will be propagated to child spans, but can be overridden later by a child span that decides to force keep.
    • true means to forcibly keep a span and all of its child spans, ignoring all other sampling decisions in the subtree.

Additionally, trace events must have:

  • ::event/time This indicates the instant the span started.
  • ::event/duration The duration (in milliseconds) the span covers.
Tracing support for instrumenting code.

Trace data is structured as events with a few special properties:
- `::trace/trace-id`
  The parent identifier for the overall trace of all linked events.
- `::trace/span-id`
  A unique identifier for this event.
- `::trace/parent-id`
  The span which is the parent of this one.
- `::trace/keep?`
  A boolean to represent a sampling decision for events sent to ken on whether to keep or drop the spans of a trace.
  - The absence of this key means the observed event will be kept and forwarded along. This is the default state.
  - `false` means to discard a span. This decision will be propagated to child spans, but can be overridden later by a child span that decides to force keep.
  - `true` means to forcibly keep a span and all of its child spans, ignoring all other sampling decisions in the subtree.

Additionally, trace events must have:
- `::event/time`
  This indicates the instant the span started.
- `::event/duration`
  The duration (in milliseconds) the span covers.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close