Liking cljdoc? Tell your friends :D

dogstatsd.core

Idiomatic Clojure wrapper over the official Datadog java-dogstatsd-client.

Build a client with client, then send metrics (increment, decrement, count, count-at, gauge, gauge-at, histogram, distribution, timing, set-metric), events, and service-checks. The client is java.io.Closeable, so use it with with-open or call close.

Tags may be a map ({:env "prod"} -> env:prod) or a seq of strings (["env:prod"]). Metric names may be keywords or strings.

Idiomatic Clojure wrapper over the official Datadog java-dogstatsd-client.

Build a client with `client`, then send metrics (`increment`, `decrement`,
`count`, `count-at`, `gauge`, `gauge-at`, `histogram`, `distribution`,
`timing`, `set-metric`), `event`s, and `service-check`s. The client is
`java.io.Closeable`, so use it with `with-open` or call `close`.

Tags may be a map (`{:env "prod"}` -> `env:prod`) or a seq of strings
(`["env:prod"]`). Metric names may be keywords or strings.
raw docstring

clientclj

(client opts)

Build a StatsDClient. Options:

:host agent host (default "localhost") :port agent port (default 8125) :prefix prefix prepended to every metric name :constant-tags tags added to every metric (map or seq of strings) :aggregation? client-side aggregation (default: the client's default, true) :address transport URL (udp://, unix://, unixstream://) :socket-path Unix domain socket path (datagram transport) :named-pipe Windows named pipe path :telemetry? client telemetry enabled? :origin-detection? client origin detection enabled? :entity-id, :container-id origin identifiers :queue-size, :buffer-pool-size, :socket-buffer-size, :max-packet-size :processor-workers, :sender-workers, :blocking? :timeout-ms, :connection-timeout-ms :telemetry-host, :telemetry-port, :telemetry-address :telemetry-flush-interval-ms, :aggregation-flush-interval-ms :aggregation-shards, :thread-factory :error-handler function called with asynchronous send exceptions :cardinality default tag cardinality (:default, :none, :low, :orchestrator, or :high)

The returned client is Closeable.

Build a StatsDClient. Options:

  :host           agent host (default "localhost")
  :port           agent port (default 8125)
  :prefix         prefix prepended to every metric name
  :constant-tags  tags added to every metric (map or seq of strings)
  :aggregation?   client-side aggregation (default: the client's default, true)
  :address        transport URL (udp://, unix://, unixstream://)
  :socket-path    Unix domain socket path (datagram transport)
  :named-pipe     Windows named pipe path
  :telemetry?     client telemetry enabled?
  :origin-detection?  client origin detection enabled?
  :entity-id, :container-id  origin identifiers
  :queue-size, :buffer-pool-size, :socket-buffer-size, :max-packet-size
  :processor-workers, :sender-workers, :blocking?
  :timeout-ms, :connection-timeout-ms
  :telemetry-host, :telemetry-port, :telemetry-address
  :telemetry-flush-interval-ms, :aggregation-flush-interval-ms
  :aggregation-shards, :thread-factory
  :error-handler  function called with asynchronous send exceptions
  :cardinality    default tag cardinality (:default, :none, :low,
                  :orchestrator, or :high)

The returned client is Closeable.
sourceraw docstring

closeclj

(close client)

Close the client, flushing any buffered metrics.

Close the client, flushing any buffered metrics.
sourceraw docstring

countclj

(count client metric delta)
(count client metric delta tags)
(count client metric delta tags {:keys [sample-rate cardinality]})

Adjust a counter by delta. A trailing options map supports :sample-rate and :cardinality.

Adjust a counter by delta. A trailing options map supports :sample-rate and
:cardinality.
sourceraw docstring

count-atclj

(count-at client metric delta timestamp)
(count-at client metric delta timestamp tags)
(count-at client metric delta timestamp tags {:keys [cardinality]})

Record a counter value with a timestamp in seconds since the Unix epoch. A trailing options map supports :cardinality.

Record a counter value with a timestamp in seconds since the Unix epoch.
A trailing options map supports :cardinality.
sourceraw docstring

decrementclj

(decrement client metric)
(decrement client metric tags)
(decrement client metric tags {:keys [sample-rate cardinality]})

Decrement a counter by 1. A trailing options map supports :sample-rate and :cardinality.

Decrement a counter by 1. A trailing options map supports :sample-rate and
:cardinality.
sourceraw docstring

distributionclj

(distribution client metric value)
(distribution client metric value tags)
(distribution client metric value tags {:keys [sample-rate cardinality]})

Record a value in a global distribution. A trailing options map supports :sample-rate and :cardinality.

Record a value in a global distribution. A trailing options map supports
:sample-rate and :cardinality.
sourceraw docstring

eventclj

(event client title text)
(event client
       title
       text
       {:keys [tags alert-type hostname aggregation-key source-type date]})

Send an event. Options:

:tags map or seq of strings :alert-type :error | :warning | :info | :success :hostname source hostname :aggregation-key key to group related events :source-type source type name :date event timestamp in millis since epoch

Send an event. Options:

:tags            map or seq of strings
:alert-type      :error | :warning | :info | :success
:hostname        source hostname
:aggregation-key key to group related events
:source-type     source type name
:date            event timestamp in millis since epoch
sourceraw docstring

gaugeclj

(gauge client metric value)
(gauge client metric value tags)
(gauge client metric value tags {:keys [sample-rate cardinality]})

Record the latest value of a gauge. A trailing options map supports :sample-rate and :cardinality.

Record the latest value of a gauge. A trailing options map supports
:sample-rate and :cardinality.
sourceraw docstring

gauge-atclj

(gauge-at client metric value timestamp)
(gauge-at client metric value timestamp tags)
(gauge-at client metric value timestamp tags {:keys [cardinality]})

Record a gauge value with a timestamp in seconds since the Unix epoch. A trailing options map supports :cardinality.

Record a gauge value with a timestamp in seconds since the Unix epoch.
A trailing options map supports :cardinality.
sourceraw docstring

histogramclj

(histogram client metric value)
(histogram client metric value tags)
(histogram client metric value tags {:keys [sample-rate cardinality]})

Record a value in a histogram (server-side statistical distribution). A trailing options map supports :sample-rate and :cardinality.

Record a value in a histogram (server-side statistical distribution).
A trailing options map supports :sample-rate and :cardinality.
sourceraw docstring

incrementclj

(increment client metric)
(increment client metric tags)
(increment client metric tags {:keys [sample-rate cardinality]})

Increment a counter by 1. A trailing options map supports :sample-rate and :cardinality.

Increment a counter by 1. A trailing options map supports :sample-rate and
:cardinality.
sourceraw docstring

service-checkclj

(service-check client name status)
(service-check client name status {:keys [tags message hostname]})

Send a service check. status is :ok | :warning | :critical | :unknown. Options: :tags, :message, :hostname.

Send a service check. status is :ok | :warning | :critical | :unknown.
Options: :tags, :message, :hostname.
sourceraw docstring

set-metricclj

(set-metric client metric value)
(set-metric client metric value tags)

Record a member of a set (counts unique occurrences).

Record a member of a set (counts unique occurrences).
sourceraw docstring

timingclj

(timing client metric millis)
(timing client metric millis tags)
(timing client metric millis tags {:keys [sample-rate cardinality]})

Record an execution time in milliseconds. A trailing options map supports :sample-rate and :cardinality.

Record an execution time in milliseconds. A trailing options map supports
:sample-rate and :cardinality.
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