Liking cljdoc? Tell your friends :D

zipkin-clj.core

Before tracing you should set a sender fn passing it to set-sender!. The default sender does nothing.

IMPORTANT: Start time is captured in microseconds as System/currentTimeMillis * 1000. Duration time is measured in microseconds as a difference between System/nanoTime devided by 1000.

Before tracing you should set a sender fn passing it to set-sender!.
The default sender does nothing.

IMPORTANT:
Start time is captured in microseconds as System/currentTimeMillis * 1000.
Duration time is measured in microseconds as a difference between
System/nanoTime devided by 1000.
raw docstring

*current-span*clj

source

annotateclj

(annotate span & annotations)

Adds annotations with the current timestamp to span. annotations is a sequence of strings.

Returns the updated span.

Adds `annotations` with the current timestamp to `span`.
`annotations` is a sequence of strings.

Returns the updated span.
sourceraw docstring

annotate!clj

(annotate! & annotations)

Adds annotations with the current timestamp to the current span. If there is no current span, does nothing. Returns the updated span.

See annotate.

Adds `annotations` with the current timestamp to the current `span`.
If there is no current span, does nothing.
Returns the updated span.

See `annotate`.
sourceraw docstring

child-spanclj

(child-span opts)

Creates a span with the current timestamp and the current span as the parent. Returns the created span.

See span for the list of options.

Creates a span with the current timestamp and the current span
as the parent.
Returns the created span.

See `span` for the list of options.
sourceraw docstring

child-trace!cljmacro

(child-trace! opts & body)

Executes body setting the current span to a newly created span with the current span as its parent. If there is no current span, creates a root span. Passes the created span (possibly updated during the body execution) to send-span! before returning. Returns the body execution result.

See span for the list of options.

Note: recur cannot cross child-trace! boundaries.

Executes `body` setting the current span to a newly created span with
the current span as its parent. If there is no current span, creates
a root span. Passes the created span (possibly updated during the body
execution) to `send-span!` before returning.
Returns the body execution result.

See `span` for the list of options.

Note: `recur` cannot cross `child-trace!` boundaries.
sourceraw docstring

configure!clj

(configure! & {:keys [sender storage endpoint] :as opts})

Allows setting all tracing parameters at once. opts is a map with the following keys:

  • :sender - a sender function,
  • :storage - a zipkin-clj.core/ISpanStorage implementation,
  • :endpoint - an endpoint description map

Returned value is not specified.

See set-sender!, set-storage!, set-endpoint!.

Allows setting all tracing parameters at once.
`opts` is a map with the following keys:

- `:sender` - a sender function,
- `:storage` - a `zipkin-clj.core/ISpanStorage` implementation,
- `:endpoint` - an endpoint description map

Returned value is not specified.

See `set-sender!`, `set-storage!`, `set-endpoint!`.
sourceraw docstring

current-spanclj

(current-span)

Returns the current span or nil if none.

Returns the current span or `nil` if none.
sourceraw docstring

externalizeclj

(externalize span)

Prepares span for serialization before sending to Zipkin.

Prepares `span` for serialization before sending to Zipkin.
sourceraw docstring

finish-spanclj

(finish-span span)

Adds duration to the span calculating it as a difference between the current time and the start time. Does nothing if span has no start time. Returns the updated span.

Adds duration to the span calculating it as a difference between
the current time and the start time. Does nothing if span has no
start time.
Returns the updated span.
sourceraw docstring

ISpanStoragecljprotocol

get-spanclj

(get-span this)

Returns the current span or nil if absent.

Returns the current span or nil if absent.

pop-span!clj

(pop-span! this)

Sets the current span to the previous value (as it was before push-span!) Returns the current span.

Sets the current span to the previous value (as it was before push-span!)
Returns the current span.

push-span!clj

(push-span! this span)

Sets span as the current. Returns the updated span.

Sets span as the current. Returns the updated span.

update-span!clj

(update-span! this f)

Sets the current span to (f current-span). If there is no current span does nothing. Returns the updated value. All changes made by f must be commutative.

Sets the current span to (f current-span). If there is no current span
does nothing. Returns the updated value.
All changes made by f must be commutative.
source

send-span!clj

(send-span! span)

If sampling decision for span evaluates to true, passes externalized span to the sender. Returned value is not specified.

See set-sender!.

If sampling decision for `span` evaluates to true, passes
externalized span to the sender.
Returned value is not specified.

See `set-sender!`.
sourceraw docstring

set-endpoint!clj

(set-endpoint! endpoint)

Sets the enpoint description which is included into spans sent by the process.

endpoint is a map of keyword to any value the sender function is able to serialize.

The following keywords are recognized:

  • :service-name - the name fo the service/application. Is sent as the "serviceName" field of the endpoint description. If both :service-name and :serviceName keywords are present, the former overwrites the latter.

There is no default value. Should be set before creating the first span.

Sets the enpoint description which is included into spans sent
by the process.

`endpoint` is a map of keyword to any value the sender function
is able to serialize.

The following keywords are recognized:

- `:service-name` - the name fo the service/application. Is sent
  as the "serviceName" field of the endpoint description. If
  both `:service-name` and `:serviceName` keywords are present,
  the former overwrites the latter.

There is no default value. Should be set before creating the first
span.
sourceraw docstring

set-sender!clj

(set-sender! sender)

Sets the function to use for sampling. sender is a function taking a list of spans as an argument. Returns sender.

The default sender does nothing.

Sets the function to use for sampling.
`sender` is a function taking a list of spans as an argument.
Returns `sender`.

The default sender does nothing.
sourceraw docstring

set-storage!clj

(set-storage! storage)

Sets the storage used when updating the current span. storage is an object implementing zipkin-clj.core/ISpanStorage. Returns storage.

The default storage uses thread-local bindings to store the stack of spans.

Sets the storage used when updating the current span.
`storage` is an object implementing `zipkin-clj.core/ISpanStorage`.
Returns `storage`.

The default storage uses thread-local bindings to store the stack of
spans.
sourceraw docstring

spanclj

(span {span-name :span
       :keys [trace-id sample? debug? endpoint parent annotations tags id
              timestamp]
       :as _opts})

Creates a span.

The options:

  • :span - the span name
  • :trace-id - a string representation of the trace id. The parent's trace id is used if :parent is provided. Generated if absent.
  • :id - a string representation of the span id. Generated if absent.
  • :annotations - a sequence of annotation strings (the current timestamp is used).
  • :tags - a map of the span tags (string/keyword -> scalar).
  • :timestamp - the span start timestamp in microseconds.
  • :parent - the parent span.
  • :endpoint - the endpoint description. Overwrite the value set by set-endpoint!.
  • :sample? - the sampling decision. If true, the span is sampled (passed to the sender function).
  • :debug? - if true, the span is sampled no matter what sampling decision is.

Returns the created span.

Creates a span.

The options:

- `:span` - the span name
- `:trace-id` - a string representation of the trace id. The parent's
  trace id is used if `:parent` is provided. Generated if absent.
- `:id` - a string representation of the span id. Generated if absent.
- `:annotations` - a sequence of annotation strings (the current
  timestamp is used).
- `:tags` - a map of the span tags (string/keyword -> scalar).
- `:timestamp` - the span start timestamp in microseconds.
- `:parent` - the parent span.
- `:endpoint` - the endpoint description. Overwrite the value set by
  `set-endpoint!`.
- `:sample?` - the sampling decision. If true, the span is sampled
  (passed to the sender function).
- `:debug?` - if true, the span is sampled no matter what sampling
  decision is.

Returns the created span.
sourceraw docstring

start-spanclj

(start-span opts)

Creates a span with the current timestamp. Returns the created span.

See span for the list of options.

Creates a span with the current timestamp.
Returns the created span.

See `span` for the list of options.
sourceraw docstring

tagclj

(tag span tags)

Adds tags to span. tags is a map of keyword/string to a scalar value.

Returns the updated span.

Adds `tags` to `span`.
`tags` is a map of keyword/string to a scalar value.

Returns the updated span.
sourceraw docstring

tag!clj

(tag! tags)

Adds tags to the current span. If there is no current span, does nothing. Returns the updated span or nil if none.

See tag.

Adds `tags` to the current span. If there is no current span, does
nothing.
Returns the updated span or `nil` if none.

See `tag`.
sourceraw docstring

trace!cljmacro

(trace! opts & body)

Executes body setting the current span to a newly created root span. Passes the created span (possibly updated during the body execution) to send-span! before returning. Returns the body execution result.

See span for the list of options.

Note: recur cannot cross trace! boundaries.

Executes `body` setting the current span to a newly created root span.
Passes the created span (possibly updated during the body execution)
to `send-span!` before returning.
Returns the body execution result.

See `span` for the list of options.

Note: `recur` cannot cross `trace!` boundaries.
sourceraw docstring

trace!*clj

(trace!* opts f)
source

trace-context!cljmacro

(trace-context! span & body)

Executes body setting the current span to span. Passes the created span (possibly updated during the body execution) to send-span! before returning. Returns the body execution result.

Note: recur cannot cross trace-context! boundaries.

Executes `body` setting the current span to `span`.
Passes the created span (possibly updated during the body execution)
to `send-span!` before returning.
Returns the body execution result.

Note: `recur` cannot cross `trace-context!` boundaries.
sourceraw docstring

trace-context!*clj

(trace-context!* span f)
source

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

× close