Datadog metrics Submit

Datadog metrics Submit

Certified

Submit a custom metric point to Datadog

Sends a gauge, a count or a rate to the Datadog metrics intake. Needs the API key only.

Two ways to describe the data. Give metric and value for one point or give series to send several series in one call, in the shape of the Datadog POST /api/v2/series body. A point without timestamp gets the time the task runs. Giving both or neither, is an error.

Datadog accepts a point up to 1 hour in the future and up to 1 hour in the past and answers before the point is processed: a point it rejects later does not make the task fail.

yaml
type: io.kestra.plugin.datadog.metrics.Submit

Report the number of rows a pipeline loaded

yaml
id: datadog_row_count
namespace: company.observability

tasks:
  - id: report_rows
    type: io.kestra.plugin.datadog.metrics.Submit
    apiKey: "{{ secret('DATADOG_API_KEY') }}"
    metric: kestra.orders.rows_loaded
    value: 1250
    metricType: GAUGE
    tags:
      - "env:prod"
      - "flow:{{ flow.id }}"

Send two series in one call

yaml
id: datadog_two_series
namespace: company.observability

tasks:
  - id: report
    type: io.kestra.plugin.datadog.metrics.Submit
    apiKey: "{{ secret('DATADOG_API_KEY') }}"
    series:
      - metric: kestra.orders.rows_loaded
        type: 3
        points:
          - value: 1250
        tags: ["env:prod"]
      - metric: kestra.orders.rows_rejected
        type: 3
        points:
          - value: 3
        tags: ["env:prod"]
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-datadog --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

Properties

Datadog API key

The organization API key. Use a Kestra secret, e.g. {{ secret('DATADOG_API_KEY') }}.

API base URL

Replaces https://api.<site> when set, for a proxy, a private link or a test server. Leave it empty for the public API. logs.Send does not use it: it calls the log intake, which has its own address (intakeUrl).

Datadog application key

An application key. Datadog asks for it on every call that reads data or manages monitors and downtimes, so the tasks that only send data (events.Create, metrics.Submit, logs.Send) work without it. Create it with the scopes the task needs. Use a Kestra secret, e.g. {{ secret('DATADOG_APP_KEY') }}.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Host

The host the series is reported for. Sent as a resource of type host.

Interval

The length in seconds of the period a COUNT or RATE value covers.

Metric name

The name of the metric, such as kestra.orders.rows_loaded. Use with value.

Possible Values
COUNTRATEGAUGE

Metric type

GAUGE (default), COUNT or RATE. With RATE, set interval to the length of the period the value covers.

SubTypeobject

Series

A list of series in the shape of the Datadog POST /api/v2/series body (metric, type, points, tags, resources, unit, interval). type is a number there: 1 count, 2 rate, 3 gauge. A point timestamp is a number of seconds or an ISO-8601 instant. Use instead of metric and value: metricType, tags, host, unit, interval and timestamp then go on each entry.

Datadog site

The Datadog site of the organization, the domain you see in the Datadog URL: datadoghq.com (US1, the default), us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com or ddog-gov.com. A key only works on the site of the organization that created it.

SubTypestring

Tags

Tags to attach to the series, such as env: prod.

Time of the point

When the value was measured, an ISO-8601 instant. The time the task runs when it is not set.

Unit

The unit of the metric, such as row.

Metric value

The value of the point. Use with metric.

Points sent

The number of points in the request.

Series sent

The number of series in the request.