Question

Is it possible to get metrics data via API in every 15 seconds as it is in Administration Panel

I am a newbie in Digital Ocean world and yesterday I discovered how easy I can get monitoring data for my droplets.

I noticed that in Administration Panel I can check graphs data for selected periods of time:

  • last 1 hour: data interval is set to 15 seconds,
  • last 6 hours: data interval is set to 20 seconds,
  • last 24h: data interval is set to 2 minutes,
  • etc.

In Digital Ocean’s API I am able to get metric data with 2 minutes interval, which is quite good, but I would like to know if it is possible to get data every 15/20 seconds?

In our company we would like to build a web application, which will consume data from metrics’ API and show info about CPU/memory usage for about 40 droplets on one page.

I checked if Digital Ocean Agent can be configured in that way, but I couldn’t find any config options for that service.

Any help/insight into this topic will be very appreciated.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
March 23, 2023

Hi there,

I think that this approach might not be very suitable. The DigitalOcean API has a rate limit of 5,000 requests per hour:

https://docs.digitalocean.com/reference/api/api-reference/#section/Introduction/Rate-Limit

If you have 40 Droplets and want to query the API every 15 seconds you will very quickly hit the rate limit.

I think that a better approach would be to use a tool like Prometheus and Grafana to collect your metrics in a time series databases and have full control over what metrics are collected and how often you query it.

Hope that this helps!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.

© 2023 DigitalOcean, LLC.