The dynamic nature of today's enterprise networks and the paradigm shift to cloud infrastructure have necessitated significant changes in the monitoring of systems and networks. To cater to these changes, many tools, and platforms are available today.
One such tool is Sensu, an open-source monitoring solution for applications and infrastructure. In this article, we'll talk in-depth about Sensu, its features, benefits, and how you can use it for monitoring your servers, applications, and other services.
What is Sensu?
Sensu is a monitoring solution that comes with a modular architecture, so you can install this tool on a single server or across multiple servers. It specializes in monitoring the cloud infrastructure and provides context on the existing gaps in observability. In particular, Sensu delivers such contextual information by eliminating the underlying data silos and bringing all the available data on the same plane for improved analysis. Such streamlined data helps with automated diagnosis and seal-healing as well.
Next, let's take a look at Sensu's features.
Features of Sensu
Sensu comes with a comprehensive set of features geared for top-notch observability across cloud environments. It is designed for the new-age infrastructure and the complex business goals that they contribute to.
Here's a look at the salient features of Sensu.
Observability Pipeline
The biggest highlight of Sensu is its observability pipeline that can collect, filter, store, process, analyze, and transform data across different endpoints and applications on your cloud. This flexible and automated tool provides the insights and visibility you need into your cloud infrastructure. In particular, this observability pipeline helps DevOps and SRE teams to glean the necessary information to improve the overall processes within the organization.
Monitors Workflows
Sensu monitors workflows and not the functions in isolation. The advantage of this approach is that you have the flexibility to define custom workflows that suit individual problems. For example, you can choose a particular interface and data format for addressing a problem, and you can create and configure a workflow accordingly. Such automated workflows ensure that you get those monitoring insights that are most relevant to your business goals.
Generates Alerts
You can configure Sensu to generate and send alerts through emails, Slack messages, and SMS. With Sensu, you can even create tickets for incident management on Jira, PagerDuty, and ServiceNow for better tracking of progress. The best part is that all these are customizable, so you can have varying alert configurations for different events. Likewise, you can have custom routing of messages for every event.
Such customization ensures that you precisely get what you want for the best outcomes.
Automates Endpoint Management
Sensu's agents constantly scour your network to identify any new VMs, containers and their services, and public cloud instances. These endpoints are immediately registered and mapped with your existing infrastructure, and alerts are sent as per the configuration. This automated endpoint management makes it easy to auto-scale when needed. Plus, you get visibility in real-time on all that's happening in your network.
Plugins and Integrations
Sensu comes with all the plugins and templates you need to start monitoring out-of-the-box. In this sense, no additional coding is needed, and you can start using the existing workflows to get the insights you need. The vast number of preconfigured templates offer the flexibility of customizing workflows with just a few clicks. Moreover, the templates can also be edited to meet your requirements and shared with the team for wide visibility.
Centralized Interface
Complex networks and infrastructure require a simple, intuitive, and centralized interface for viewing and monitoring all the functions you want. Sensu offers an observability control plane, similar to Kubernetes. With this plane, you can automate and repeat even the most complex workflows. The obvious advantage is you save time and effort and, at the same time, gain the necessary insights for improving the efficiency of your cloud infrastructure.
Self-healing
Self-healing is a hotly debated concept and one that extensively uses ML and AI to identify issues and fix problems automatically. Sensu is one of the few platforms today that provide native support for self-healing. With Sensu, all that you have to do is trigger a sequence of steps via custom scripts when any predetermined problems are detected.
Wide-range of Information
Sensu can collect a wide range of information including basic system metrics such as CPU, memory, etc. Plus, you can also configure custom metrics related to applications and services. Besides collection, you can even integrate these metrics with databases for storage, analysis, and unified visibility.
Using Sensu, you can collect data from not just systems and metrics, but also cloud platforms like AWS and Kubernetes. You can collect from web platforms like Apache and monitoring tools like Nagios.
Integrations
Integrations are key to ensuring a smooth flow of data through your infrastructure. The good news with Sensu is that it integrates well with the most popular tools such as Splunk, PagerDuty, ServiceNow, Docker, Google Cloud, Redis, MongoDB, and more.
Highly Secure
Sensu comes with many built-in security features that protect your sensitive data while providing the visibility you need into your infrastructure. Its role-based access control streamlines access to critical resources and prevents unauthorized people from accessing them. Also, it uses the principle of least privilege for the workflows.
For convenience, Sensu integrates with any organization's SSO, so the right teams and employees can access monitoring data easily. Furthermore, Sensu automates identity authentication in the cloud using a mutual-TLS certificate. Plus, its integrations with tools such as HashiCorp Vault, Red Hat Certificate System, and more add to its security capabilities.
Scalable
Any tool that monitors cloud resources must be easy to scale, to keep pace with your changing business requirements, and Sensu fits right into this description. It monitors thousands of nodes and processes more than 100 million events from a single cluster. Furthermore, it can handle 10K connected devices and more than 40,000 agents per cluster. Other features such as multi-tenancy support, multi-cluster visibility, and a limitless database add to Sensu's scalability.
In all, Sensu's features make it ideal for monitoring your cloud environments to understand their performance and the existing gaps, so you can take the steps needed to fill the gaps and boost productivity and efficiency.
Moving on, let's take a brief look at how Sensu works.
Working of Sensu
The heart of Sensu is its agent, a lightweight process that runs on any component that you want to monitor. From a programming standpoint, every Sensu agent is identified as an entity.
The entire process starts from the Sensu backend, an integrated structure that looks into your subscriptions and accordingly, creates a schedule for the agents to run checks on different components. The backend specifies what metrics each agent must collect and at what frequency, and the agents simply execute these commands. The metrics collected by the agents are sent to generic containers called events. Every event comes with a timestamp and a check result, which could be a status, a metric, or both.
Next, the agent sends these events to the backend for further filtering and processing. The result is a set of contextual information and insights that enable you to take specific actions.
Now that you have a good understanding of how Sensu works, let's jump into a detailed explanation of each component to better understand how they all fit into Sensu's pipeline.
Components of the Sensu Pipeline
Let's now understand in detail the role and capabilities of individual components, so you can better understand how they come together to provide the observability data you need. It can also help you to plan better for gathering and analyzing metrics.
Backend
Sensu's backend is a complex and integrated structure comprising four modules – schedule, filter, transform, and process. It is responsible for triggering the start of the process and for delivering the final output. It assigns subscriptions to agents and analyzes the data sent back by agents through events.
Subscriptions
Subscriptions refer to the publish/subscribe model that Sensu's backend uses to trigger the agent. The advantage of this publish/subscribe model is that it is highly flexible, as the exact details related to components and metrics can change over time.
Subscriptions are further divided into two sub-components, namely, entities and checks. Entities are the endpoints, while checks are the specific attribute that must be monitored. For example, server1 is an entity while CPU is a check. As you may have guessed, one entity can be mapped to many checks, but each combination is treated as a single subscription. Going back to our previous example, server1 can be mapped to CPU, memory, and disk usage, for a total of three unique subscriptions. Similarly, server2 can be mapped to memory and disk utilization for two more unique subscriptions.
Agent
Every Sensu agent is a lightweight process that runs on the endpoints you want to monitor. Also, each agent is registered in the backend as an entity. Agents run on Linux, macOS, and Windows.
An agent simply follows the instructions provided by the backend and collects the metrics based on the assigned subscription. Next, it sends these metrics to events, that in turn, send them to the backend again for further processing.
The agents communicate with the backend through the WebSocket protocol and receive and transmit data in JSON format.
Events
The last component that we'll talk about is the event. As explained earlier, this is a generic container that stores data from agents and transmits it to the backend for filtering and processing. These events can contain any kind of data such as status, metrics, logs, and more.
Events can be broadly categorized into status-only, metrics-only, and status and metrics events. The status-only events are created when a Sensu server processes a check result. In this context, the check is a Sensu agent that creates events automatically to monitor the availability of devices and services.
Metrics-only events, on the other hand, are created through the StatsD Listener, a daemon used to gather and send custom metrics. Using StatsD Listener, you can measure anything you want from any endpoint. A key difference between status-only and metrics-only events is the additional processing that happens in the Events container. To elaborate, Events will execute any configured hooks associated with the check before sending it to the backend. However, in the case of metrics-only events, there are no additional steps, and the information is sent directly to the backend pipeline.
Finally, status and metric events are when a check is configured to collect a custom metric. In such a case, the results of the check and metric are stored in the container, and the check result goes through additional processing.
In all, all the components in Sensu are well-defined and have specific responsibilities in the larger system.
Next, let's briefly look at how you can install and use Sensu.
Using Sensu
In this section, let's talk about how you can install Sensu and start using it to gather and process information. Before that, make sure to download the commercial license.
Install the Backend
As a first step, install the Sensu Backend. It's available only for Ubuntu, Docker, and RHEL or CentOS.
Here's a sample code for installing on Docker.
docker run -v /var/lib/sensu:/var/lib/sensu \
-d –name sensu-backend \
-p 3000:3000 -p 8080:8080 -p 8081:8081 \
-e SENSU_BACKEND_CLUSTER_ADMIN_USERNAME=<username> \
-e SENSU_BACKEND_CLUSTER_ADMIN_PASSWORD=<password> \
sensu/sensu:latest \
sensu-backend start –state-dir /var/lib/sensu/sensu-backend –log-level debug
If you're using Docker, the installation is done with the above code. Simply open the web UI with the URL http://localhost:3000, enter your credentials, and explore the UI.
You can find extensive code for installing on other platforms in the user manual. Note that other platforms require more steps, all of which are detailed in the manual.
Install the Agents
Next, install the agents. Here's the code for configuring and initializing the agents on Docker.
docker run -v /var/lib/sensu:/var/lib/sensu -d \
–name sensu-agent sensu/sensu:latest \
sensu-agent start –backend-url ws://sensu.yourdomain.com:8081 –log-level debug –subscriptions system –api-host 0.0.0.0 –cache-dir /var/lib/sensu
Test
After installing the backend and agent, test if they are working. One way to do it is to create and send a sample event to Sensu core/v2/events API. Check your web UI for the corresponding notifications based on what you want your test event to do.
With this, you're all set to start using Sensu to gather and process statuses and metrics in your cloud environment.
Finally, let's look into Sensu's pricing to help you decide if it fits into your overall budget.
Sensu's Pricing
Sensu offers two unique products – Sensu Go and Sensu Plus.
Sensu Go is the standalone analytics product that we have discussed predominantly in this article. This was the only Sensu product that was available before Sumo Logic took over Sensu.
Sensu Plus, on the other hand, is an integrated solution where users have access to Sumo Logic's intelligence platform and continuous monitoring suite. This product is ideal for anyone looking for an end-to-end monitoring and analytics solution.
Let's look at the pricing for both products.
Sensu Go
Sensu Go is free for the first 100 nodes, thereby making it an ideal option for startups and small and medium businesses that are exploring the idea of analytics for the first time. It works well for individuals too. Here is the pricing tier of Sensu Go.
- Free
- Pro – $3/node/month, billed annually. This plan can monitor a minimum of 100 nodes and a maximum of 3000 nodes, making it a good choice for SMBs and enterprise product teams.
- Enterprise – $5/node/month, billed annually. Well-suited for large teams managing critical applications and services.
Sensu Plus
Like Go, Sensu Plus is also free for the first 100 nodes. The cost of the other two plans are:
- Pro – $5/node/month, billed annually.
- Enterprise – $8/node/month, billed annually.
The overall pricing structure is simple and affordable for organizations of all sizes. Even individuals can use the free plan for their projects. Note that all the paid plans come with a 14-day free trial to help you evaluate if Sensu is the right fit for your needs.
Before we end, let's quickly recollect all that we have learned about Sensu.
Quick Recap
To conclude, monitoring is an essential part of every organization as it provides insights into the health and performance of endpoints and the infrastructure as a whole. Sensu is a comprehensive tool that can collate metrics from different sources and transform them into actionable insights that you can use for strategy and decision-making. In this article, we talked in depth about the features of Sense, how it works, and the components that make it function. We also briefly talked about the steps for using Sensu and ended with a look into its pricing.
We hope this guide provides all the information you need to get started with Sensu. For more in-depth guides on different tools, browse through www.ittsystems.com.