Get columnar server metrics history for charts
GET
/api/environments/{envId}/metrics/history
const url = 'https://example.com/api/environments/example/metrics/history?hours=24&metric=cpu&maxPoints=120';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/environments/example/metrics/history?hours=24&metric=cpu&maxPoints=120' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”envId
required
string
Query Parameters
Section titled “Query Parameters”hours
number
metric
string
since
string format: date-time
maxPoints
number
Responses
Section titled “Responses”Default Response
Media typeapplication/json
object
servers
Array<object>
object
id
string
name
string
tags
null | string
timestamps
Array<string>
series
object
cpu
Array<Array<null | number>>
memory
Array<Array<null | number>>
memoryUsedMb
Array<Array<null | number>>
swap
Array<Array<null | number>>
swapUsedMb
Array<Array<null | number>>
disk
Array<Array<null | number>>
diskUsedGb
Array<Array<null | number>>
load1
Array<Array<null | number>>
load5
Array<Array<null | number>>
load15
Array<Array<null | number>>
openFds
Array<Array<null | number>>
maxFds
Array<Array<null | number>>
tcpEstablished
Array<Array<null | number>>
tcpListen
Array<Array<null | number>>
tcpTimeWait
Array<Array<null | number>>
tcpCloseWait
Array<Array<null | number>>
tcpTotal
Array<Array<null | number>>
mode
string
until
string
Example
{ "mode": "full"}Default Response
Media typeapplication/json
object
error
string
details
Examplegenerated
{ "error": "example", "details": "example"}Default Response
Media typeapplication/json
object
error
string
details
Examplegenerated
{ "error": "example", "details": "example"}