Skip to main content

Module datadog

Module datadog 

Source
Expand description

The datadog node — ships request metrics to a Datadog agent over DogStatsD (UDP) in batches.

Deviation from the other loggers: APISIX’s datadog plugin does not ship JSON access logs to an HTTP endpoint. It emits DogStatsD metrics (request.counter, request.latency, ingress.size, egress.size, …) as UDP datagrams to a local Datadog agent. This port stays faithful: the flusher is a [tokio::net::UdpSocket] rather than the shared outbound HTTP client, and each buffered log entry is rendered into DogStatsD metric lines. The APISIX plugin-metadata fields (host, port, namespace, constant_tags) are flattened into this node’s config. Because featherbit’s shared log entry carries no route/service identifiers, prefer_name is accepted for compatibility but has no effect, and no route_name/ service_name tags are emitted.

The node never mutates the request/response and never fails; place it in the response pipeline, after the upstream node.

Structs§

DatadogFlusher 🔒
Delivers batches by sending DogStatsD datagrams to the agent over UDP.
DatadogPlugin
Batches request metrics and sends them to a Datadog agent via DogStatsD.

Constants§

MAX_DATAGRAM_SIZE 🔒
DogStatsD agent’s default receive buffer; larger datagrams are truncated, so coalesced payloads are capped here (matching APISIX).

Functions§

build_metric_lines 🔒
Builds the DogStatsD metric lines for one featherbit log entry.