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.
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.(client opts)Build a StatsDClient. Options:
:host agent host override (otherwise uses the SDK default) :port agent port override (otherwise uses the SDK default) :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 :address-lookup, :telemetry-address-lookup zero-argument functions returning a SocketAddress :telemetry-flush-interval-ms, :aggregation-flush-interval-ms :aggregation-shards, :thread-factory :error-handler function that the client calls 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 override (otherwise uses the SDK default)
:port agent port override (otherwise uses the SDK default)
: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
:address-lookup, :telemetry-address-lookup zero-argument functions
returning a SocketAddress
:telemetry-flush-interval-ms, :aggregation-flush-interval-ms
:aggregation-shards, :thread-factory
:error-handler function that the client calls with asynchronous send
exceptions
:cardinality default tag cardinality (:default, :none, :low,
:orchestrator, or :high)
The returned client is Closeable.(close client)Close the client by invoking its .close() operation.
The bundled Java client implements close() by delegating to stop();
stop! remains available when the explicit stop operation is desired.
Close the client by invoking its `.close()` operation. The bundled Java client implements `close()` by delegating to `stop()`; `stop!` remains available when the explicit stop operation is desired.
(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.
(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.
(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.
(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.
(event client title text)(event client
title
text
{:keys [tags alert-type hostname aggregation-key source-type date
priority cardinality]})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 :priority :normal | :low :cardinality tag cardinality
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 :priority :normal | :low :cardinality tag cardinality
(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.
(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.
(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.
(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.
(service-check client name status)(service-check client
name
status
{:keys [tags message hostname timestamp cardinality
check-run-id]})Send a service check. status is :ok | :warning | :critical | :unknown. Options: :tags, :message, :hostname, :timestamp, :cardinality, :check-run-id.
Send a service check. status is :ok | :warning | :critical | :unknown. Options: :tags, :message, :hostname, :timestamp, :cardinality, :check-run-id.
(set-metric client metric value)(set-metric client metric value tags)(set-metric client metric value tags {:keys [cardinality]})Record a member of a set (counts unique occurrences). A trailing options map supports :cardinality.
Record a member of a set (counts unique occurrences). A trailing options map supports :cardinality.
(stop! client)Stop the client by invoking its explicit .stop() operation.
In the bundled Java client, this stops telemetry and metric processing and
sending; its close() operation delegates to the same stop operation.
Stop the client by invoking its explicit `.stop()` operation. In the bundled Java client, this stops telemetry and metric processing and sending; its `close()` operation delegates to the same stop operation.
(telemetry-metric client metric value)Send a telemetry metric. Telemetry must be enabled on the client for this call to have an effect.
Send a telemetry metric. Telemetry must be enabled on the client for this call to have an effect.
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |