For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).
Usage
client.v2.monitoring.metrics.apps.cpu_percentage.get(requestConfiguration?: RequestConfiguration<Cpu_percentageRequestBuilderGetQueryParameters>): Promise<undefined | Metrics2>
Description
To retrieve cpu percentage metrics for a given app, send a GET request to /v2/monitoring/metrics/apps/cpu_percentage.
Parameters
appId string required
Example: 2db3c021-15ad-4088-bfe8-99dc972b9cf6
The app UUID.
appComponent string optional
Example: sample-application
The app component name.
start string required
Example: 1620683817
UNIX timestamp to start metric window.
end string required
Example: 1620705417
UNIX timestamp to end metric window.
Request Sample
Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
createDigitalOceanClient,
DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";
const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);
const response = await client.v2.monitoring.metrics.apps.cpu_percentage.get({
queryParameters: {
appId: "2db3c021-15ad-4088-bfe8-99dc972b9cf6",
start: "1620683817",
end: "1620705417",
},
});
Response Example
Show Response Example
{
"status": "success",
"data": {
"resultType": "matrix",
"result": [
{
"metric": {
"app_component": "sample-application",
"app_component_instance": "sample-application-0",
"app_uuid": "db3c021-15ad-4088-bfe8-99dc972b9cf6"
},
"values": [
[
1634052360,
"5.016600450090265357"
],
[
1634052480,
"12.015085955677299055"
],
[
1634052600,
"8.014941163855322308"
],
[
1634052720,
"32.016214285714285712"
]
]
}
]
}
}
See /v2/monitoring/metrics/apps/cpu_percentage in the API reference for additional detail on responses, headers, parameters, and more.