Skip to content

Get Time Series Trend Chart



GET /api/v1/chart_image/get

Overview

Retrieve a time series trend chart based on the specified DQL / PromQL query statement.

Query Request Parameters

Parameter Name Type Required Description
clientToken string Y Workspace clientToken
Example: wctn_xxx
Allow empty: False
qtype string Query statement type, default is dql
Allow empty: False
Optional values: ['dql', 'promql']
q string Y Query statement
Example:
Allow empty: False
startTime integer Y Start time point, timestamp in seconds
Example:
Allow empty: False
endTime integer Y End time point, timestamp in seconds
Example:
Allow empty: False
interval integer Data point interval in seconds
Example:
Allow empty: False
tz string Time zone name, default value Asia/Shanghai
Example: Asia/Shanghai
Allow empty: False

Additional Parameter Notes

Query Notes


Note: The current interface authenticates through clientToken. It only takes effect when the clientToken is valid. The request header DF-API-KEY can be omitted for this interface.

Request Example

curl 'https://openapi.guance.com/api/v1/chart_image/get?clientToken=xxxxx&qtype=dql&q=M%3A%3A%60cpu%60%3A(avg(%60usage_idle%60))%20BY%20%60host%60&interval=60&startTime=1743391592&endTime=1743392492&tz=Asia%2FShanghai' \
--data ''

Response

# Response content is image stream data 

Feedback

Is this page helpful? ×