Skip to main content

datadog

datadog

Emits DogStatsD metrics (request.counter, request.latency, ingress.size, egress.size) for each request and ships accumulated batches to a Datadog agent over UDP. Place this node in the response pipeline, after the upstream node, so latency and status are captured.

:::note Deviation from other loggers Unlike the HTTP loggers, datadog does not ship JSON logs to an HTTP endpoint. It renders each buffered entry into DogStatsD metric lines and sends them as UDP datagrams via a tokio::net::UdpSocket (not the shared outbound HTTP client). Agent settings (host, port, namespace, constant_tags) live directly in this node's config. Because featherbit's shared log entry carries no route/service identifiers, prefer_name is accepted but has no effect and no route_name/service_name tags are emitted. :::

Configurationโ€‹

KeyTypeDefaultDescription
hoststring127.0.0.1Datadog agent address.
portinteger8125DogStatsD UDP port.
namespacestringfeatherbitMetric name prefix.
constant_tagsarray[]Tags added to every metric.
include_pathboolfalseAdd a path: tag.
include_methodboolfalseAdd a method: tag.
prefer_namebooltrueAccepted for config compatibility; no effect.
batch_max_sizeinteger1000Flush when the buffer reaches this many entries.
inactive_timeoutinteger (s)5Flush after this idle period.
buffer_durationinteger (s)60Flush when the oldest buffered entry is this old.
max_retry_countinteger0Retries after a failed flush before dropping the batch.
retry_delayinteger (s)1Delay between retries.
max_pending_entriesinteger10000Queue capacity; entries are dropped with a warning when full.
- id: metrics
type: datadog
config:
host: 127.0.0.1
port: 8125
namespace: featherbit
constant_tags: [source:featherbit]
include_method: true

Behaviorโ€‹

The node is a pure passthrough: it never modifies the context and never fails, so only its success port is ever taken. push is fire-and-forget and never blocks the request path โ€” when the queue is full, entries are dropped with a tracing::warn!. Each entry yields metric lines of the form namespace.metric:value|type|#tags; the entry's metrics are coalesced into one datagram (or split when they exceed the 8192-byte DogStatsD buffer). Sending runs on a background task; a mid-batch send failure retries only the undelivered tail.