For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/es/api/latest/metrics/edit-metric-metadata.md. A documentation index is available at /llms.txt.
Language
Datadog site

Editar los metadatos de una métrica

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}

Descripción general

Edita los metadatos de una métrica específica. Más información sobre tipos admitidos.

This endpoint requires the metrics_metadata_write permission.

Argumentos

Parámetros de ruta

Nombre
Type
Descripción
metric_name [required]
string

Name of the metric for which to edit metadata.

Solicitud

Body Data (required)

Nuevos metadatos.

Campo
Type
Descripción
description
string

Objeto con todos los metadatos relacionados con métricas.

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.

Respuesta

OK

Object with all metric related metadata.

Campo
Type
Descripción
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.

Ejemplo de código

Editar los metadatos de una métrica
# 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