Hello, is there a way to get droplet metric data via the API? I’ve looked at the API docs page and have not seen such a thing.
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!
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.
Hello,
Just a quick update here. DigitalOcean now has a Monitoring API endpoint that you could use. For more information you can take a look at the official API documentation here:
https://docs.digitalocean.com/reference/api/api-reference/#tag/Monitoring
Also, keep in mind that you need to have the DigitalOcean Metrics Agent installed on your Droplet in order to get some data back.
You can install the
do-agent
as per the instructions here:https://docs.digitalocean.com/products/monitoring/how-to/install-agent/
Hope that this helps. Best, Bobby
Yes you can, take a look at DigitalOcean’s monitoring API: https://docs.digitalocean.com/reference/api/api-reference/#tag/Monitoring
Hey @RiversideRocks ,
You should be able to get json output specifically for metrics from our API. Here is the API documentation link: https://docs.digitalocean.com/reference/api/api-reference/#operation/get_droplet_cpu_metrics.
Example. If you wish to get the cpu metrics for a Droplet, this would be syntax you would want to use:
You need to replace the variables $dropletid $starttimeinepoch & $endtimeinepoch
Sample output would look like this:
I hope this helps!
Best,
Sandesh Senior Customer Success Engineer