Skip to main content

metric_metadata

Creates, updates, deletes, gets or lists a metric_metadata resource.

Overview

Namemetric_metadata
TypeResource
Iddatadog.metrics.metric_metadata

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
short_namestringA more human-readable and abbreviated version of the metric name.
descriptionstringMetric description.
integrationstringName of the integration that sent the metric if applicable.
per_unitstringPer unit of the metric such as second in bytes per second. (example: second)
statsd_intervalinteger (int64)StatsD flush interval of the metric in seconds if applicable.
typestringMetric type such as gauge or rate. (example: count)
unitstringPrimary unit of the metric such as byte or operation. (example: byte)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_metric_metadataselectmetric_nameGet metadata about a specific metric.
update_metric_metadatareplacemetric_nameEdit metadata of a specific metric. Find out more about [supported types](https:​//docs.datadoghq.com/developers/metrics).

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
metric_namestringName of the metric for which to edit metadata.
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.

SELECT examples

Get metadata about a specific metric.

SELECT
short_name,
description,
integration,
per_unit,
statsd_interval,
type,
unit
FROM datadog.metrics.metric_metadata
WHERE metric_name = '{{ metric_name }}' -- required
;

REPLACE examples

Edit metadata of a specific metric. Find out more about supported types.

REPLACE datadog.metrics.metric_metadata
SET
description = '{{ description }}',
per_unit = '{{ per_unit }}',
short_name = '{{ short_name }}',
statsd_interval = {{ statsd_interval }},
type = '{{ type }}',
unit = '{{ unit }}'
WHERE
metric_name = '{{ metric_name }}' --required
RETURNING
short_name,
description,
integration,
per_unit,
statsd_interval,
type,
unit;