Get columnar service metrics history for charts
GET
/api/environments/{envId}/services/metrics/history
const url = 'https://example.com/api/environments/example/services/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/services/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
services
Array<object>
object
id
string
deploymentId
string
name
string
serverName
string
serverId
string
timestamps
Array<string>
series
object
cpu
Array<Array<null | number>>
memory
Array<Array<null | number>>
memoryLimit
Array<Array<null | number>>
networkRx
Array<Array<null | number>>
networkTx
Array<Array<null | number>>
restartCount
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"}