First things first: existing users will be pleased to know that upgrading is easy, so there's no need to be concerned about the upgrade process. In fact, Sensu Go 6 (released August 10, 2020) is a drop-in replacement for Sensu Go 5.
Sensu was originally designed to be a single-tenant system, relying heavily on configuration management tools to move at the speed of automation — AKA, to keep configuration up to date to accurately reflect the state of things.
Today, containers have become the dominant way we build and package software. Kubernetes is the default platform for deploying that packaged software. In the cloud-native landscape, traditional configuration management has been displaced by the container orchestration platform itself; Kubernetes is the config management tool for containers (declarative management of compute resources). Such shifts necessitate a change in how we approach monitoring and observability.
With Sensu Go, we now have a multi-tenant platform for monitoring — and it’s self-service. With better-than-ever — i.e., more powerful — APIs, a user-friendly CLI, and web tools that make it easy to manage and create monitoring resources.
In this post, I’ll talk about how we’re unlocking another level of automation with Sensu Go 6.
NOTE: Don’t be alarmed by the version number bump — upgrading is easy (and we’ll share resources to that effect, below).
A (brief) history of Sensu
In the very beginning, Sensu’s agent auto-registration, pubsub check execution orchestration, and ease of configuration via configuration management tools (like Ansible, Chef, and Puppet) set it apart from all other monitoring tools.
Sensu Go has taken automation to another level, with dynamic runtime assets and a backend configuration API, allowing Sensu to keep pace with the rise of containerization and microservice architecture. While Sensu Go’s configuration API allows users to manage most resources, it couldn’t be used to manage agent entities (e.g., labels and subscriptions). Until Sensu Go 6.
Unlocking another level of automation in Sensu Go 6
With Sensu Go 6, you can control everything through the API. You can still use configuration management tools to bootstrap agent entities, but you don’t need to! Our new agent entity management feature via the backend configuration API nearly eliminates the need for external (or out-of-band) configuration management for Sensu, empowering you to manage agent entity subscriptions and automate the discovery of system facts without updating agent local configuration files. Run a sensuctl command, click a button in the web UI, or execute a custom check plugin.
What does this mean for Sensu users?
With Sensu Go 6, we’ve changed the agent configuration contract without changing the agent configuration file itself — all existing agent configuration and existing tooling around it will continue to work, ensuring a smooth upgrade path. Previously, you’d modify an agent’s configuration on a host, restart the agent, and only then would the changes be reflected in the stored entity for that agent. With 6, that’s no longer the case; now an agent’s config file is only used to create and bootstrap the agent’s entity, and you use the Sensu Go backend API to edit and manage it going forward.
Sensu Go 6 offers several capabilities previously unavailable in earlier versions, including:
- Configuring an agent’s initial entity via the agent’s local configuration. The attributes you configure — such as subscriptions and labels — will be used to bootstrap (i.e., create if missing) the agent’s entity. The agent will automatically ensure that local system facts (i.e., platform and OS info) are present and up-to-date in the backend stored entity object.
- Adding a subscription to an agent’s entity via the backend API and the agent will begin to receive check execution requests on the new subscription.
- Removing a subscription from an agent’s entity via the backend API and the agent will automatically no longer receive check execution requests on that removed subscription.
- Adding a label to an agent’s entity via the backend API and use that label in check command substitution as part of a check execution in the agent.
- Editing an agent’s entity via the web UI, modifying subscriptions, labels, and more!
- Creating your own auto-discovery check (via a traditional check plugin) that evaluates a system and outputs system platform, or service facts. You can then use a Sensu handler to process auto-discovery check events and use the PATCH /entities API to modify the entity.
- Managing agent entities through a CI/CD process
You’ll still be able to use your configuration management tools — as a Puppet user, for example, you can have several modules configure an agent’s entity subscriptions via the backend API, eliminating the need for conf.d loading — you just don’t have to be wholly reliant on them to manage Sensu. Now, because it’s multi-tenant, you can self-service directly, via the backend API, sensuctl, or the web UI.
A caveat for config management
If you want configuration management to solely own agent entity management, existing agent entities must be deleted in order for changes to take effect. If you have Chef, for example, Chef would create the agent.yml file on a host that runs the Sensu Go agent. The agent then starts up, creating its own entity using the configuration in the agent.yml file. Chef would then modify the agent.yml file and restart the Sensu Go agent, and changes do not take effect until the existing entity is deleted (which you can do via sensuctl or the web UI).
We’re in the process of updating the Sensu config management modules (such as Puppet) to leverage the backend API for agent entity management. Once the module is upgraded, you can continue to solely use config management if that’s the path you choose.
In the next section, we'll share an overview of what you can expect in terms of upgrading from Sensu Go 5.x (or feel free to jump ahead to the upgrade guide in our documentation).
How to upgrade to Sensu Go 6
To upgrade a Sensu Go 5.x deployment to 6, upgrade the Sensu Go native system packages or Docker image and restart the Sensu services as normal. After restarting all of the Sensu Go backends, run a single command on one of them to migrate the cluster,
sensu-backend upgrade (you will need to confirm y/n). THAT’S IT! In most cases, the command will only take a few seconds to run.
Until the cluster is upgraded, the entity list may return empty and it’s likely proxy check requests will not work. However, it will continue to publish standard check requests and process events. Running the upgrade command more than once will not harm the cluster, the command will simply state that it has already been run. If you are deploying a fresh Sensu Go 6 cluster, you do not need to run the
sensu-backend upgrade command.
Check out the full upgrade guide in our documentation.
We hope these changes will make it easier than ever to monitor your ever-changing infrastructure. As always, we invite you to join our community, where you can learn from the folks building Sensu — and stay updated on the latest Sensu product releases.
NOTE: this blog post has been updated with links to the Sensu Go 6.0 release notes, documentation, and downloads.