How to Upgrade from the Legacy Metrics Agent to the Current Agent

DigitalOcean Monitoring is a free, opt-in service that gathers metrics about Droplet-level resource utilization. It provides additional Droplet graphs and supports configurable metrics alert policies with integrated email Slack notifications to help you track the operational health of your infrastructure.

On 8 April, 2019, we released a new Prometheus-based metrics agent into production. All agent installations on or after this date receive the new agent by default. On 8 July, 2019, the legacy metrics agent was deprecated and Droplets running the legacy agent no longer display extended metrics.

If you are currently running the legacy metrics agent, follow the instructions here to upgrade. If you want to install the metrics agent for the first time, refer to the agent installation instructions.

The upgrade process involves two steps:

  1. Uninstall the legacy metrics agent.

    On Debian-based operating systems (like Ubuntu), use apt-get:

    sudo apt-get purge do-agent
    

    On RHEL-based operating systems (like CentOS and Fedora), use yum:

    sudo yum remove do-agent
    
  2. Install the current metrics agent.

    You can do this by automatically running the installation script with curl ... | bash, as below, or you can download the script, inspect it, and run it manually.

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

    Confirm the metrics agent's installation:

/opt/digitalocean/bin/do-agent --version
When the agent is successfully installed, this command returns the version information of the DigitalOcean Metrics Agent, which should be 3.x or higher. If the version information displays a version number below 3.x, the agent installation may have failed.

If you receive the message `-bash: /opt/digitalocean/bin/do-agent: No such file or directory`, verify that the agent was installed in the correct directory.

You can update multiple Droplets at once with the upgrade-droplets.sh script provided in the do-agent GitHub repository. You'll need an SSH key and a DigitalOcean API token.

Alternatively, an Ansible-based batch upgrade is available on Ansible Galaxy.