metric_metadata
Creates, updates, deletes, gets or lists a metric_metadata resource.
Overview
| Name | metric_metadata |
| Type | Resource |
| Id | datadog.metrics.metric_metadata |
Fields
The following fields are returned by SELECT queries:
- get_metric_metadata
| Name | Datatype | Description |
|---|---|---|
short_name | string | A more human-readable and abbreviated version of the metric name. |
description | string | Metric description. |
integration | string | Name of the integration that sent the metric if applicable. |
per_unit | string | Per unit of the metric such as second in bytes per second. (example: second) |
statsd_interval | integer (int64) | StatsD flush interval of the metric in seconds if applicable. |
type | string | Metric type such as gauge or rate. (example: count) |
unit | string | Primary unit of the metric such as byte or operation. (example: byte) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_metric_metadata | select | metric_name | Get metadata about a specific metric. | |
update_metric_metadata | replace | metric_name | Edit 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.
| Name | Datatype | Description |
|---|---|---|
metric_name | string | Name of the metric for which to edit metadata. |
site | string | The 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_metric_metadata
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
- update_metric_metadata
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;