How can I remotely view the requests per second stats of my load balancer? I have checked the Load Balancer API docs and I don’t see a way to view the requests per second stats of my load balancer like I can if I login to the WebUI. I would like to use this info to alert me or start an additional task, etc. Any ideas?
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.
Hi there,
What you could do is use the DigitalOcean API and the
/v2/load_balancers/LB_ID
endpoint to retrieve information about the load balancer itself and its health checks:https://docs.digitalocean.com/reference/api/api-reference/#operation/loadBalancers_list
The request itself will look like this:
From the response, you will get the
health_check
value which you can use to determine the heath.Hope that this helps!
Best,
Bobby
Hey @littlelightseagreensquid,
To remotely view the requests per second stats of your DigitalOcean Load Balancer, you can use the DigitalOcean Monitoring API. The Monitoring API allows you to programmatically retrieve real-time and historical data for your resources, including Load Balancers.
https://docs.digitalocean.com/products/monitoring/
To get started with the Monitoring API, you’ll need to create a personal access token from the DigitalOcean Control Panel. Once you have your access token, you can use it to make authenticated requests to the Monitoring API.
To retrieve the requests per second stats of your Load Balancer, you can use the Metrics API :
https://docs.digitalocean.com/reference/api/api-reference/#operation/monitoring_create_alertPolicy
You can check the List Alert Policies as well to check if any Policy matches what you need or Create a new alert which will be send via the API and you can act upon in