4 minutes read

POSTED Aug, 2022 dot IN Serverless

Comparison between Prometheus/Grafana and Thundra APM

Suleyman Barman

Written by Suleyman Barman


VP of Engineering at Thundra

linkedin-share
 X

In modern technology, new applications are developed rapidly, and organizations are using cloud computing heavily for application deployment. In this context, Application Performance Monitoring (APM) plays a significant role in the monitoring and performance of software applications.

APM helps organizations provide services to in-depth observability of the application. In addition, APM helps identify problems related to the application and performance issues. Organizations can use different metrics to measure the performance and issues related to the application, such as load time and the application's response time.

Modern applications are becoming more complex compared to decades ago. Moreover, with the wide use of microservices and distributed systems, monitoring the application's performance is necessary to provide efficient service and greater satisfaction to the end-user.

We are looking into Prometheus/Grafana and Thundra APM from today's comparison. Prometheus/Grafana is a well-known open-source tool for monitoring applications and cloud resources.

An Overview of Prometheus

Prometheus is an open-source tool used for monitoring and maintaining applications. Prometheus joined the Cloud Native Computing Foundation as a second-hosted project after Kubernetes. Initially, it used StatsD and Graphite, which were not that advanced. After that, they added more features like a multi-dimensional database, operational simplicity, scalable data collection, etc. Finally, they integrated all these features within Prometheus itself, and it became the second incubated project under Cloud Native Computing Foundation.

Prometheus and Grafana collect performance metrics using exporters. Prometheus has an extensive list of exports that can be used for different use cases. You can go through the list of exports from here. In addition, Prometheus has SDK support for popular languages.

Some of the core features that make Prometheus so valuable are:

  • The multi-dimensional data model in which key-value pairs identify data.
  • PromQl, the language used for querying multidimensional data models.
  • Server-centered monitoring, no reliance on distributed storage.
  • Automatic pulling of metrics via an HTTP endpoint
  • Using exporters for non-supported metrics.
  • Multiple nodes for graphing and dashboarding support.

An Overview of Grafana

Prometheus is used for collecting and aggregating app metrics from different platforms. However, Prometheus is not very good at representing those metrics in a dashboard. Hence the more data you have, the more confusing it is. Grafana was developed to solve these issues. It is an open-source web application tool for metrics visualization. Grafana also helps create alerts for any unexpected app behavior and takes the proper steps towards it.

An Overview of Thundra APM

Thundra APM was developed with a mindset of serverless. It's the first and only platform providing end-to-end monitoring and management of serverless applications, containers, and virtual machines. Thundra provides an enhanced overview and insights on serverless applications and helps development, DevOps, and SRE teams identify performance bottlenecks.

How Prometheus works with APM

As I mentioned in the introduction to Prometheus, it's an open-source tool widely used in the cloud-native community. Prometheus uses exporters to import metrics from different types of workloads. At the time of writing, Prometheus has an extensive list of exporters for different workload monitoring. Prometheus is a metrics collecting application.

When we talk about APM, it should have the ability to collect metrics from the application itself apart from default metrics provided by the Prometheus exporters.

These additional metrics can be exposed with the Prometheus SDK. Prometheus supports SDK well.

By using SDK, we can create our metrics per our requirements and export those metrics via exporters. This is a great feature that extends the capability of Prometheus.

Let's take the example of adding Prometheus metrics for the net application

First, we can import the Prometheus package; after it is imported, we can use it to define our custom metrics.

Install-Package prometheus-net

Install-Package prometheus-net.AspNetCore

Next, we can add the required code Startup.cs to start the metrics server to collect application metrics

When we open the endpoint where Prometheus exposes metrics, we can see many dotnet-related metrics are exposed.

Creating Custom Metrics

As mentioned above, we can create custom metrics. The following example shows how to add custom metrics and view the metrics from the metrics endpoint.

The image below shows how we are adding a custom metric

View the custom metric from the exporter endpoint

Pros and Cons of using Prometheus and Grafana

Pros

  • Powerful and easy to monitor
  • Easy to setup
  • Extensive query language
  • Extensive integrations

Cons

  • Not supported for storing logs
  • Prometheus does not offer durable long-term storage, anomaly detection, automatic horizontal scaling, or user management.
  • Prometheus is not a dashboarding solution; it has a simple UI for experimentation with PromQL queries but relies on Grafana for dashboarding, adding additional setup complexity.
  • Additional configurations and setups need to be done, not scalable or highly available by default.

How Thundra works with APM

Thundra APM is a SaaS service specially built for APM. Thundra APM is originated with serverless. Serverless constraints drove the need for an end-to-end understanding of applications to efficiently troubleshoot and debug them. Thundra is the first and only platform providing true end-to-end management of distributed applications across serverless architectures, containers, and virtual machines. Thundra has more features and capabilities compared to Prometheus and Grafana. However, there are a few notable differences when comparing Prometheus and Grafana with Thundra.

Thundra APM can easily integrate your application code with the SDK. The following demo shows how we can integrate the NodeJS application running in AWS Lambda with Thundra APM.

Following is an example code for enabling Thundra APM for the .Net application.


// ...
// Make sure to load the Thundra Package
using Thundra.Agent.Wrapper.ASP;
namespace SampleApplication{
  public class Startup{
    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.public void Configure(IApplicationBuilder app, IHostingEnvironment env){
      // ...
      // Thundra .NET Middleware
      app.UseThundra();
      app.UseMvc(routes =>{
      // ...
      });
    }
  }
}
 
// We can add the Thundra API key and application name in appseting.json file.
 
{
  // ..."profiles": {
    "SampleApplication": {
      // ..."environmentVariables": {
        // ..."thundra_apiKey": "<Thundra-ApiKey>",
        "thundra_agent_application_name": "<Your-Application-Name>"
      }
    }
  }
}

Notable Features of Thundra APM

Architecture Page

Serverless applications are distributed.  Therefore it makes it hard to understand serverless architecture by only checking the function details. Consequently, it's important to have a visual design to understand the architecture.

This visual diagram helps to discover errors in your serverless application stack.  Thundra can identify the interaction between serverless resources such as DynamoDB, Redis, SQS, and your Lambda function.

Application Tracing

Tracing is essential for any distributed application. Tracing helps identify the flow of the request made from the application and increases observability. In addition, Tracing helps engineers to troubleshoot issues with ease and identify problematic applications or codes faster.

Pros and Cons of using Thundra APM

Pros

  • Fully managed APM monitoring system
  • Easy to setup
  • Less administrative overhead
  • A single place to view observability tools

Cons

  • Limited ability to extend
  • Advance features are under paid subscription

Conclusion

When comparing Prometheus/Grafana and Thundra APM, each product has its own capabilities. If you want to select APM for monitoring, both can be used depending on the requirement. Prometheus and Grafana are widely used in large enterprise-scale workloads monitoring and have a wider community. Prometheus has extensive support for different types of workloads.

On the other hand, if you're working with a serverless application,  Thundra APM has a wide range of features and capabilities to provide observability.  This is because Thundra APM has been designed for serverless application observability.