How Can I Monitor CPU and Memory Usage in Real Time While Querying the REST API?

Tomav
Tera Contributor
Hi all,

I’m working on a script that performs frequent queries via the ServiceNow REST API. To avoid negatively impacting the performance of the instance, I’d like to monitor the instance’s CPU and memory usage in real time and automatically halt or throttle the queries when usage exceeds a certain threshold.

My key requirement is to access this performance data programmatically, so the script can make decisions on its own (i.e., no dashboards or manual intervention).
Specifically, I’m looking for:
* A way to query CPU and memory usage of the instance in real time (or near real time).
* An endpoint, API, or system table that exposes this data.
* Any available system metrics or logs that can be polled for resource utilization.

Is there a built-in API or system view that allows for this kind of monitoring? If not, are there any known workarounds or best practices to achieve this?
Thanks in advance for any insights!

 

0 REPLIES 0