opencensus-clojure.trace

add-tag

(add-tag k v)

Adds a tag on the current span

  • :k tag name
  • :v tag value. Natively supported types are long, bool or string

add-tags

(add-tags tags)

See add-tag`.

  • :tags a hash of key-value pairs you’d pass to add-tag.

configure-tracer

(configure-tracer {:keys [probability max-annotations max-attributes max-links max-message-events]})

Configure the underlying tracer. Takes

  • :probability
  • :max-annotations
  • :max-attributes
  • :max-links
  • :max-message-events

all of which are proxied through to the TraceParams class.

make-downstream-headers

(make-downstream-headers)

Produces B3 style headers for the current span, to be passed down into further RPCs for distributed tracing.

span

macro

(span span-name code)(span span-name code remote)

Creates a traced span. Takes a name and a form to be traced, or, additionally, a remote SpanContext that is a remote parent of the one you’re starting.

It is expected that clients should mostly use the 2-arg form and the 3-ard form is called from the Ring middleware handling the deserialization of the context from B3 headers, however, if you’re not using Ring, this might be useful.