# Datadog Configuration

The `datadog` plugin sends APISIX and API7 Gateway request metrics to Datadog through DogStatsD for monitoring traffic, latency, status, and payload size.<!-- --> <!-- -->Configuration covers plugin parameters and plugin metadata.

## Parameters[​](#parameters "Direct link to Parameters")

See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.

* prefer\_name

  boolean

  default: `true`

  ***

  If true, use the route or service name in metric tags when one is configured; otherwise, use its ID.

* include\_path

  boolean

  default: `false`

  ***

  If true, include the matched route path in metric tags. Introduced in API7 Enterprise 3.9.0 and 3.10.0, and APISIX 3.14.0.

* include\_method

  boolean

  default: `false`

  ***

  If true, include the HTTP method in metric tags. Introduced in API7 Enterprise 3.9.0 and 3.10.0, and APISIX 3.14.0.

* constant\_tags

  array\[string]

  ***

  Static key-value tags that are attached to all metrics. These tags can be used to add metadata such as team ownership or environment, enabling easier filtering, aggregation, and alerting across related endpoints. Available in APISIX from version 3.14.0 and API7 Enterprise from version 3.9.0.

* name

  string

  default: `datadog`

  ***

  Unique identifier of the plugin for the batch processor. If you use [Prometheus](https://docs.api7.ai/hub/prometheus.md) to monitor APISIX metrics, the name is exported in `apisix_batch_process_entries`.

* batch\_max\_size

  integer

  default: `1000`

  valid value:

  greater than 0

  ***

  The maximum number of metric entries in a batch. Once reached, the batch is sent to the DogStatsD Agent. Setting this parameter to 1 processes every entry immediately.

* inactive\_timeout

  integer

  default: `5`

  valid value:

  greater than 0

  ***

  The maximum time in seconds to wait for new metric entries before sending the batch to the DogStatsD Agent. The value should be smaller than `buffer_duration`.

* buffer\_duration

  integer

  default: `60`

  valid value:

  greater than 0

  ***

  The maximum time in seconds from the earliest entry allowed before sending the batch to the logging service.

* retry\_delay

  integer

  default: `1`

  valid value:

  greater than or equal to 0

  ***

  The interval in seconds before retrying a failed batch delivery to the DogStatsD Agent.

* max\_retry\_count

  integer

  default: `0`

  valid value:

  greater than or equal to 0

  ***

  The maximum number of unsuccessful retries allowed before dropping the log entries.

## Plugin Metadata[​](#plugin-metadata "Direct link to Plugin Metadata")

* host

  string

  default: `127.0.0.1`

  ***

  DogStatsD server hostname or IP address reachable from the gateway.

* port

  integer

  default: `8125`

  ***

  DogStatsD server port.

* namespace

  string

  default: `apisix`

  ***

  Prefix for all metrics. For example, if the namespace is configured as `apisix`, you should see the `request.counter` metric exported as `apisix.request.counter` to Datadog.

* constant\_tags

  array\[string]

  default: `[source:apisix]`

  ***

  Metric [tags](https://docs.datadoghq.com/getting_started/tagging).

* max\_pending\_entries

  integer

  default: `8192`

  valid value:

  greater than or equal to 1

  ***

  Maximum number of entries waiting in the batch processor. New entries are discarded when the backlog reaches the limit.

  Introduced in API7 Enterprise 3.9.19 on the 3.9 line and 3.10.6 on the 3.10 line, and in APISIX 3.18.0.

  See [Batch Processor](https://docs.api7.ai/apisix/reference/batch-processor.md#configure-the-pending-entry-limit) for sizing and verification guidance.
