قالب وردپرس درنا توس
Home / Tips and Tricks / How to monitor your DigitalOcean drops – CloudSavvy IT

How to monitor your DigitalOcean drops – CloudSavvy IT



DigitalOcean logo

Monitoring your cloud resources helps you stay ahead of demanding workloads. DigitalOcean droplets benefit from versatile built-in reporting options that give you insight into your usage.

Graphical representation of droplet statistics

The easiest way to track your drops is with the graphs in the Cloud Control Panel. Log in to your DigitalOcean account and click on one of your droplets. You will arrive at the Graphs screen.

The graphs give you an at-a-glance overview of your droplet’s CPU, RAM, and disk and network usage. Using the drop-down lists at the top right, you can adjust the displayed time range and set an automatic refresh interval. Data is available from the last hour to the last 14 days.

How are statistics collected?

The statistics are collected from your droplet using DigitalOcean’s open source do-agent usefulness. This is supported on Ubuntu, CentOS, Debian and Fedora. Other distributions (as well as older versions of the above) can do-agent, and instead display a limited set of basic graphs.

You can install manually do-agent if your droplet is running a supported distribution, but you don’t see the full number of charts. This could be because you upgraded your droplet from an older version, or maybe you originally created it without the metrics agent installed.

Connect to your droplet via SSH and run the following installation script:

curl -sSL https://repos.insights.digitalocean.com/install.sh | sudo bash

The data should appear in your Cloud Control Panel within minutes.

do-agent periodically collects data from the /proc virtual file system. The metrics are then uploaded via gRPC to the DigitalOcean ingest endpoint. The agent verifies itself as belonging to your droplet so that the data ends up in your DigitalOcean account.

None of the information provided by do-agent is security sensitive. The tool only sends data and does not receive it. Although it communicates over ports 80 and 443, you can safely run a web server with it installed.

The graphics from DigitalOcean give you an overview of your drop at a glance. You need to connect via SSH and use Linux tools to dig deeper into spikes in activity.

You can use top to quickly see the processes running on your drop. The table is automatically updated. It is sorted by CPU usage by default. Press to switch to sort by memory usage Shift+M. You can switch between memory units (bytes / MB / GB) by pressing the e key. The units of the statistics at the top of the screen are toggled with Shift+E.

Another useful control command is uptime. This shows you how long your drop has been running, how many user connections have been made in that time, and the average load over the past one, five, and fifteen minutes.

The load average is a measure of the number of running and waiting processes during a certain period. It indicates the availability of your system to handle new processes. An average load average suggests that your droplet is generally idle, which you can verify by looking at DigitalOcean’s CPU chart. The maximum average load value is equal to the number of cores available to your server (eg 4.0 on a drop with 4 vCPUs).

Disk usage information can be obtained from iotop. This shows you real-time disk read and write statistics. It contains a list of the processes that use your disk. The IO column indicates the percentage of time that each process has been waiting for disk I / O.

Create automated alert policy

You can choose to receive alerts when metrics exceed a certain threshold. Alerts can be sent via email or Slack.

Click on the “Monitoring” link in the sidebar of the Control Panel. You will see a list of the warnings in your account. Click the blue “Create Alert Policy” button to add a new policy.

Use the drop-down lists to configure your new alert. The available statistics are tailored to the data collected by do-agent. You can choose between five, ten, 30 and 60 minute reporting thresholds. The example below would send you a warning if the CPU usage exceeded 70% for more than five minutes. The aggregated reporting prevents transient peaks and troughs from triggering a whole host of warnings.

Then choose the drops you want to apply your policy to. You can add individual droplets, a tag name (for Kubernetes nodes) or the special selector ‘All drops’.

Configure the alert mechanism under ‘Send alerts via’. This is pre-populated with the email address associated with your DigitalOcean account. You can add additional recipients as needed, which is useful if you prefer a colleague or contractor to handle incidents.

You can choose to receive alerts in Slack. Click on the “Connect Slack” button and follow the instructions to log in to your Slack account. Give DigitalOcean access to your Slack workspace. You can then choose whether alerts are posted to a channel or a user’s direct messages.

To activate your alert, give it a name and press the “Create Alert Policy” button. You will need to repeat the process and add another warning if you want to track more statistics. There is currently no support for adding multiple metrics to a single alert policy.

Limitations of DigitalOcean monitoring

DigitalOcean’s monitoring options give you a high-level overview of your drop’s performance. The data is accurate and current, but only shows you what’s happening, not why.

Configuring a DigitalOcean alert policy ensures that you are notified of problematic events when they occur. Nevertheless, the system cannot be used as your sole monitoring solution. You need to make sure you are prepared, with tools and workflows that can uncover the root cause of abnormal activity.

DigitalOcean’s monitoring focuses on the system health of your drop. In an ideal scenario, it should be rare for an alert to trigger. Your application-level monitoring system should start reporting increased error rates or throughput bottlenecks before they affect the wider system. In many teams, however, the incident response still starts from the top down, in which case DigitalOcean’s charts and alerts are an immediate tool to inform firefighters.

Conclusion

DigitalOcean monitoring options allow you to visualize resource usage and stay ahead of changing requirements. In addition to droplets, the control panel also provides activity graphs from managed databases, Kubernetes clusters, and load balancers. Select one of these sources on the respective Control Panel page to review the activity in real time. In addition to droplet calculation statistics, these statistics give you insight into the pressures facing your workloads.


Source link