Droplet Tagging: Organize Your Infrastructure

David E. Worth

Posted: October 25, 20164 min read
<- Back to Blog Home

Share

Try DigitalOcean for free

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

At DigitalOcean, we are on a mission to make managing production applications simple. Today, we are officially announcing the addition of Droplet tags to make it even easier to work with large-scale production applications.

Last fall, we quietly launched tagging and management of resources via our public API. Since then, over 94,000 Droplets have been tagged including use cases like:

  • Blue/green deployments
  • Ownership assertions, e.g. Droplets tagged webserver:dave or team:metrics
  • Environment assertions, e.g. env:production or env:dev
  • Application assertions, e.g. MySQL, MongoDB, web
  • Even deployment platforms, like Kubernetes!

As developers ourselves, we know how important it is to stay organized when working on and managing applications. Tags are a simple and powerful way to do this.

How Do You Use Tags?

When we released tagging via the API, we received a lot of fantastic feedback. It was exciting to see our community embrace a feature to this extent, and it proved that we needed to add tags to our Cloud control panel too.

We’ve added tags to all Droplet-related views, like the main Droplets page, in order to make managing your Droplets and tags simpler from wherever you are - Cloud control panel, Metadata Service, and API.

control panel

We also created a new tag-only view, which allows you to see all Droplets with a given tag. Here, you can see how our team groups our production Droplets by tag:

control panel filtered by tag

For more detail on how to use tags via the control panel, check out our tagging tutorial on our Community Site.

What Can You Use Tags For?

Managing Resource Ownership

A simple tag like `team:data` or `team:widget` makes it easy to know exactly who is responsible for a given set of Droplets. For example, different teams in a company may share a single DigitalOcean Team, and can use tags to track their resource usage separately. Engineers on an on-call rotation, an ops-team, a finance team, or anyone simply debugging a problem can benefit from these kinds of tags as well.

Monitoring and Automation

Knowing the importance of a given Droplet to the healthy operation of a product is an essential part of ensuring the reliability of your system, and tagging your Droplets with `env:production` or `env:dev` can help facilitate this.

For example, if your alerting infrastructure is tag-aware, rules can be made less sensitive to increased load or memory usage on a staging or development server than on production servers. If your infrastructure management system is sufficiently mature, you may be able to self-heal by scaling your application servers automatically.

Similarly, with Prometheus’ file-based service discovery and regular calls to the DigitalOcean API (e.g., by a cronjob), you can dynamically configure metrics based on tags. You can fine tune parameters like scrape interval, evaluation interval, and any external labels you want to apply — which may be tags themselves.

Logging and Data Retention Policies

Logging and metric data is invaluable, especially during outages, but storing that data can be costly on high-traffic systems. Tagging resources and including those tags in your structured logs can be used to dictate log retention policies. This can help optimize disk usage to ensure critical infrastructure has the most log retention while test servers get little or none. Systems such as RSyslog can apply rules based on JSON-structured logs in CEE format.

Deployments and Infrastructure Management

A common strategy for testing and rolling out deployments is to use blue/green deployments. Implementing a blue/green deployment becomes easy with tags; simply use two tags, `blue` and `green`, to track which Droplets are in which set, then use the API to trigger the promotion (by switching the traffic direction later, e.g. by updating a Reserved IP, load balancer configuration, or DNS record).

Infrastructure management is an art in and of itself. Recently, our own Tommy Murphy contributed support for DigitalOcean’s tags to HashiCorp’s Terraform infrastructure automation platform. This has been used to build lightweight firewall management tooling (GitHub) to ensure that hosts with a given tag can pass traffic but will drop traffic from any other host.

What’s Coming Up Next?

Being able to tag your Droplets is only the beginning. We know that Block Storage, Reserved IPs, DNS records, and other resources are all critical parts of your production infrastructure too. In order to make your deployment, monitoring, and development infrastructure simpler to manage, we’re working on letting you manage entire groups of resources via tags over the coming months.

Conclusion

Thank you to everyone who has used tags and provided feedback. We hope these improvements help make it a little easier for you to build and ship great things. Please keep the feedback coming. How do you use tagging to manage your infrastructure? We would love to hear from you!

by David E. Worth

Share

Try DigitalOcean for free

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

Related Articles

Announcing 1-Click Models powered by Hugging Face on DigitalOcean
Product updates

Announcing 1-Click Models powered by Hugging Face on DigitalOcean

DigitalOcean Spaces Object Storage Now in Toronto
Product updates

DigitalOcean Spaces Object Storage Now in Toronto

DigitalOcean GPU Droplets, scalable computing power on demand
Product updates

DigitalOcean GPU Droplets, scalable computing power on demand