For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/api/latest/metrics/edit-metric-metadata.md. A documentation index is available at /llms.txt.
Language
Datadog site

Edit metric metadata

PUThttps://api.datadoghq.com/api/v1/metrics/{metric_name}https://api.us3.datadoghq.com/api/v1/metrics/{metric_name}https://api.us5.datadoghq.com/api/v1/metrics/{metric_name}https://api.datadoghq.eu/api/v1/metrics/{metric_name}https://api.ap1.datadoghq.com/api/v1/metrics/{metric_name}https://api.ap2.datadoghq.com/api/v1/metrics/{metric_name}https://api.uk1.datadoghq.com/api/v1/metrics/{metric_name}https://api.ddog-gov.com/api/v1/metrics/{metric_name}https://api.us2.ddog-gov.com/api/v1/metrics/{metric_name}

Overview

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

This endpoint requires the metrics_metadata_write permission.

Arguments

Path Parameters

Name
Type
Description
metric_name [required]
string

Name of the metric for which to edit metadata.

Request

Body Data (required)

New metadata.

Field
Type
Description
description
string

Metric description.

per_unit
string

Per unit of the metric such as second in bytes per second.

short_name
string

A more human-readable and abbreviated version of the metric name.

statsd_interval
int64

StatsD flush interval of the metric in seconds if applicable.

type
string

Metric type such as gauge or rate.

unit
string

Primary unit of the metric such as byte or operation.

Response

OK

Object with all metric related metadata.

Field
Type
Description
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.

short_name
string

A more human-readable and abbreviated version of the metric name.

statsd_interval
int64

StatsD flush interval of the metric in seconds if applicable.

type
string

Metric type such as gauge or rate.

unit
string

Primary unit of the metric such as byte or operation.

Code Example

# Path parameters
export metric_name="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/metrics/${metric_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Number of requests received.",
  "per_unit": "second",
  "type": "count",
  "unit": "byte"
}
EOF
# Path parameters
export metric_name="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/metrics/${metric_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Number of requests received.",
  "per_unit": "second",
  "type": "count",
  "unit": "byte"
}
EOF
# Path parameters
export metric_name="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/metrics/${metric_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Number of requests received.",
  "per_unit": "second",
  "type": "count",
  "unit": "byte"
}
EOF
# Path parameters
export metric_name="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/metrics/${metric_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Number of requests received.",
  "per_unit": "second",
  "type": "count",
  "unit": "byte"
}
EOF
# Path parameters
export metric_name="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/metrics/${metric_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Number of requests received.",
  "per_unit": "second",
  "type": "count",
  "unit": "byte"
}
EOF
# Path parameters
export metric_name="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/metrics/${metric_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Number of requests received.",
  "per_unit": "second",
  "type": "count",
  "unit": "byte"
}
EOF
# Path parameters
export metric_name="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/metrics/${metric_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Number of requests received.",
  "per_unit": "second",
  "type": "count",
  "unit": "byte"
}
EOF
# Path parameters
export metric_name="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/metrics/${metric_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Number of requests received.",
  "per_unit": "second",
  "type": "count",
  "unit": "byte"
}
EOF
# Path parameters
export metric_name="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v1/metrics/${metric_name}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "description": "Number of requests received.",
  "per_unit": "second",
  "type": "count",
  "unit": "byte"
}
EOF