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

그래프 스냅샷 찍기

GEThttps://api.datadoghq.com/api/v1/graph/snapshothttps://api.us3.datadoghq.com/api/v1/graph/snapshothttps://api.us5.datadoghq.com/api/v1/graph/snapshothttps://api.datadoghq.eu/api/v1/graph/snapshothttps://api.ap1.datadoghq.com/api/v1/graph/snapshothttps://api.ap2.datadoghq.com/api/v1/graph/snapshothttps://api.uk1.datadoghq.com/api/v1/graph/snapshothttps://api.ddog-gov.com/api/v1/graph/snapshothttps://api.us2.ddog-gov.com/api/v1/graph/snapshot

개요

그래프 스냅샷을 찍습니다. 스냅샷은 웹 페이지에서 지정된 위젯을 렌더링하고 데이터를 사용할 수 있게 되면 캡처하여 생성된 PNG 이미지입니다. 이미지는 이후 클라우드 스토리지에 업로드됩니다.

참고: 스냅샷이 생성되면 사용할 수 있게 되기까지 약간의 지연이 발생합니다.

인수

쿼리 문자열

이름
유형
설명
metric_query
string

The metric query.

start [required]
integer

The POSIX timestamp of the start of the query in seconds.

end [required]
integer

The POSIX timestamp of the end of the query in seconds.

event_query
string

A query that adds event bands to the graph.

graph_def
string

A JSON document defining the graph. graph_def can be used instead of metric_query. The JSON document uses the grammar defined here and should be formatted to a single line then URL encoded.

title
string

A title for the graph. If no title is specified, the graph does not have a title.

height
integer

The height of the graph. If no height is specified, the graph's original height is used.

width
integer

The width of the graph. If no width is specified, the graph's original width is used.

응답

OK

Object representing a graph snapshot.

항목
유형
설명
graph_def
string

A JSON document defining the graph. graph_def can be used instead of metric_query. The JSON document uses the grammar defined here and should be formatted to a single line then URL encoded.

metric_query
string

The metric query. One of metric_query or graph_def is required.

snapshot_url
string

URL of your graph snapshot.

코드 예시

그래프 스냅샷 찍기
# Required query arguments
export metric_query="CHANGE_ME"
export start="CHANGE_ME"
export end="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 GET "https://api.${DD_SITE}/api/v1/graph/snapshot?metric_query=${metric_query}&start=${start}&end=${end}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export metric_query="CHANGE_ME"
export start="CHANGE_ME"
export end="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 GET "https://api.${DD_SITE}/api/v1/graph/snapshot?metric_query=${metric_query}&start=${start}&end=${end}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export metric_query="CHANGE_ME"
export start="CHANGE_ME"
export end="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 GET "https://api.${DD_SITE}/api/v1/graph/snapshot?metric_query=${metric_query}&start=${start}&end=${end}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export metric_query="CHANGE_ME"
export start="CHANGE_ME"
export end="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 GET "https://api.${DD_SITE}/api/v1/graph/snapshot?metric_query=${metric_query}&start=${start}&end=${end}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export metric_query="CHANGE_ME"
export start="CHANGE_ME"
export end="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 GET "https://api.${DD_SITE}/api/v1/graph/snapshot?metric_query=${metric_query}&start=${start}&end=${end}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export metric_query="CHANGE_ME"
export start="CHANGE_ME"
export end="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 GET "https://api.${DD_SITE}/api/v1/graph/snapshot?metric_query=${metric_query}&start=${start}&end=${end}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export metric_query="CHANGE_ME"
export start="CHANGE_ME"
export end="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 GET "https://api.${DD_SITE}/api/v1/graph/snapshot?metric_query=${metric_query}&start=${start}&end=${end}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export metric_query="CHANGE_ME"
export start="CHANGE_ME"
export end="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 GET "https://api.${DD_SITE}/api/v1/graph/snapshot?metric_query=${metric_query}&start=${start}&end=${end}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export metric_query="CHANGE_ME"
export start="CHANGE_ME"
export end="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 GET "https://api.${DD_SITE}/api/v1/graph/snapshot?metric_query=${metric_query}&start=${start}&end=${end}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"