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

메트릭 메타데이터 수정하기

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}

개요

특정 메트릭의 메타데이터를 편집합니다. 지원되는 유형에 대해 자세히 알아보세요.

This endpoint requires the metrics_metadata_write permission.

인수

경로 파라미터

이름
유형
설명
metric_name [required]
string

Name of the metric for which to edit metadata.

요청

Body Data (required)

새로운 메타데이터입니다.

항목
유형
설명
description
string

모든 메트릭 관련 메타데이터가 포함된 객체입니다.

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.

응답

OK

Object with all metric related metadata.

항목
유형
설명
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.

코드 예시

메트릭 메타데이터 수정하기
# 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