Table of Contents
When you are designing and building applications, you should consider how to monitor them once they become live. You do not want to be blindsided by errors and degrading performances as you operate them. When your applications fail to provide optimal performance, it can broadly impact your business. Engineers will often be distracted to investigate and fix the issues. Customers will complain. It can eventually hit your bottom line. To prevent these, an efficient and easy way to monitor your applications has always been a demand from businesses. In this article, we will learn about StatsD and compare the open-source StatsD and hosted StatsD.
Before we begin, check MetricFire. MetricFire offers comprehensive monitoring solutions with Hosted Grafana and Hosted Graphite. You can get an in-depth insight into your application resources with minimal configuration. If you want to learn more about it, please book a demo with us, or sign on to the free trial today.
What is StatsD?
StatsD was created by Etsy - an American e-commerce company. StatsD is a simple background process to aggregate and summarize application monitoring data. While developing an application, developers can start using it by importing open-source client libraries. The libraries then talk with the StatsD daemon. Using its extremely simple protocol, you can let StatsD generate and aggregate metrics and transmit them to almost any monitoring application.
StatsD stands out among other similar daemon applications with the following strengths.
- Ease of use: StatsD is very easy to implement in your application. The protocol it uses is text-based and simple to understand and write and read. The initial Etsy server code was only 127 lines long.
- Decoupling: the daemon process runs outside your app and UDP, or User Datagram Protocole, is based on a fire-and-forget protocol. There is no dependency between StatsD and your application. This means StatsD will not impact your app and it does not have to be written in the same language or even on the same server.
- Small footprint: StatsD clients are extremely light. It does not carry a state and adds only a tiny overhead. StatsD is also capable of sampling your calls to reduce network usage.
- Ubiquity: it supports major programming languages - Ruby, Python, Java, Erlang, Node, Scala, Go, Haskell, and every other. Many software engineers developed alternative servers to meet special requirements or increase throughput. Thanks to its popularity, there are a lot of community supports, materials, and use cases.
How StatsD works
One of the benefits of using StatsD is the ease of implementation. You can download the library and start using it in your application code. StatsD supports almost all major languages so you can use a corresponding library. StatsD lets you collect different types of metrics. Currently, the types that you can capture include:
- Timing Summary Statistics
You can start tracking these values by adding a decorator to relevant methods or you can write just a line of code to gauge monitoring value. The StatsD client library then calls the StatsD server over a UDP datagram. UDP is an independent protocol since it is not obliged to send back any acknowledgment to the caller. Thanks to this, the library does not need to block when sending data as it would with TCP or HTTP-based protocols.
The client also does not require buffering any data between each call, which makes usage simpler. There is an option that allows sampling of the events to be sent to the StatsD server if your application has to perform very high throughput operations. The StatsD daemon will then receive the UDP traffic from all application libraries and aggregate the data over time and flush it at a specific interval that you set.
For instance, you can set an interval of 5 seconds to aggregate an individual function call timings. You can create a group of summary metrics such as its minimum, maximum, median, 90th, and 95th percentile over that 5s time gap.
The protocol between the StatsD daemon and the backend will differ depending on the backend used (most are based on HTTP). The monitoring backend will convert your metrics from a stream of numbers into meaningful charts and alert you if needed. Good examples of backends include monitoring tools like Graphite.
What is Graphite?
Graphite is an open-source monitoring software that is designed to perform reliably on affordable hardware or cloud infrastructure. People use Graphite to track the performance of their resources such as websites, applications, network servers, and more. It is known to provide a scalable solution for real-time graphing. You can write an application that digests numeric time-series data and sends it to Graphite’s processing backend which stores the data in its database. Then, you can visualize the data on Graphite’s web interfaces.
MetricFire offers hosted Graphite. Hosted Graphite is maintained, updated, and hosted for ultimate ease of use. This means setup is convenient and quick, while it also addresses the scalability and team sharing issues found with open-source Graphite. Graphite is great for its high performance, simple architecture, and easy-to-use features. It has proven its usage among the top organizations in the corporate world.
In addition to the benefits of open-source Graphite, you can access further benefits by using hosted Graphite including:
- Hosted Graphite backs up your user data and dashboard every hour.
- You will be fully supported by MetricFire's technical experts.
- MetricFire offers an extensive range of options for users of all sizes with plans and customization to meet your needs.
- MetricFire’s on-call team is ready 24/7. Our team keeps watching your hosted Graphite from around the world using an automated monitoring system.
- We have been ingesting billions of data points per day since 2012. Our mature metric processing and storage capabilities are trusted by thousands of engineers.
- You can directly send metrics from your application without additional dependencies or aggregation services.
Hosted StatsD by MetricFire
StatsD, as we learned, provides a range of benefits and it does not lock you in with any paid contract since it is open-source. However, when you use open-source software, everything is on your own. You need to install and maintain it. When you need support, you will have to spend time and solve a problem by yourself. This can create a burden in your organization. To help you to focus on what matters the most, MetricFire provides hosted StatsD.
MetricFire is a monitoring platform built on open-source software such as StatsD, Graphite, Prometheus, and Grafana. MetricFire aims at easing the burden of developers and companies by providing a hosted open-source monitoring platform. The firm began as a hosted StatsD and Graphite service, where developers only needed to install an agent onto their server. Then, metrics ingestion, storage, visualization, and alerting all get taken care of by MetricFire.
Since then, MetricFire has expanded to also offer Prometheus and Grafana services. When planning to monitor StatsD, it is essential to know that MetricFire handles the ingestion of StatsD metrics. This is extremely beneficial, as the majority of our customers have most of their infrastructure set up with StatsD. As a customer, you will not have to change anything about your infrastructure to start monitoring with MetricFire.
You can easily use StatsD with MetricFire directly. Alternatively, you can use the HostedGraphite Agent. The agent already has the StatsD daemon embedded within it to make pushing metrics to our Graphite back-end as easy as possible. It allows you to automatically aggregate your metrics in 8 different ways, enabling you to further utilize your data with no extra charge. It's a great option for users with StatsD data. The HostedGraphite Agent also allows for tagging, giving dimensionality to your StatsD data.
StatsD vs. Hosted StatsD
Open-source StatsD has four strengths - simplicity, decoupling, tiny footprint, and ubiquity. However, due to the nature of open-source software, starting and maintaining the daemon becomes your responsibility. Also, when you want to integrate it into other monitoring software such as Graphite, you may experience difficulties, and it will be challenging to get reliable support.
Hosted StatsD by MetricFire comes with all the benefits that StatsD has. On top of them, you can access MetricFire’s expert support and benefit from its ample experiences that are accumulated by working with other enterprises using StatsD. Also, you can significantly reduce maintenance burden and start using StatsD instantly.
We learned about StatsD and its benefits. The article also shared the differences between open-source StatsD and hosted StatsD. Hosted StatsD by MetricFire keeps all the benefits of the software and also provides support from experts. MetricFire has worked with numerous corporate customers that use StatsD. If you embark on a new journey to start using StatsD or have already been using open-source StatsD, hosted StatsD can be a great option.
Choose hosted solutions from MetricFire and create an optimal monitoring environment. Get a MetricFire free trial or book a demo with our experts to learn more about how MetricFire can help you.