Pros and Cons of CloudWatch for Error Monitoring

Pros and Cons of CloudWatch for Error Monitoring

Sentry sponsored this post. As a developer, I love Lambda functions. They allow me to focus on the purpose of the functionality and save tons of time writing and deploying code. At the same time, one of the biggest challenges of using Lambda functions in production has been the troubleshooting of issues.

As a developer, I love Lambda functions. They allow me to focus on the purpose of the functionality and save tons of time writing and deploying code. At the same time, one of the biggest challenges of using Lambda functions in production has been the troubleshooting of issues. This stems from a visibility gap between the code and how the user experiences the application, and a lack of monitoring tools that specifically address this key problem in serverless environments.

Certainly, Amazon’s monitoring tool CloudWatchprovides a way to track function metrics and deep dive in the logs for debugging. However, combing through logs is not how I want to debug my issues — it takes _hours. _

I took a look at a number of tools that help you set up log forwarding, to monitor errors and exceptions. Here’s how they typically work:

  1. Use the pre-configured CloudFormation stack to setup cloud resources and permissions in your environment.
  2. Use CloudWatch APIs to stream (usually using Kinesis+Firehose) filtered logs into their own tool.
  3. Apply formatting on ingested logs to present the errors and exceptions in a more consumable way.

This process works great. I was able to set up error monitoring in a few minutes without changing my code. In addition, I now had stack traces and interesting function details like:

  1. Function memory usage
  2. Function invocation time
  3. Cost of executing my lambda functions

Challenges

Now, here are the challenges with the approach:

  1. I don’t like that a tool has control over my aws account, because it is using assumeRole to access my account info.
  2. The stack traces are still quite hard to read. Here’s an example:
  3. A lot of run-time context is lost, for example other threads and the ability to configure additional parameters.
  4. I can’t see traces or transactions, to be able to debug issues across my application to correlate front-end and back-end behavior.

So, while log forwarding from CloudWatch is better than using the CloudWatch itself, it is not without flaws.

cloud services monitoring serverless contributed sponsored

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Multi-cloud Spending: 8 Tips To Lower Cost

Mismanagement of multi-cloud expense costs an arm and leg to business and its management has become a major pain point. Here we break down some crucial tips to take some of the management challenges off your plate and help you optimize your cloud spend.

What are the benefits of cloud migration? Reasons you should migrate

To move or not to move? Benefits are multifold when you are migrating to the cloud. Get the correct information to make your decision, with our cloud engineering expertise.

Essential Metrics to Monitor Serverless on Amazon Web Services

In this article we explore the serverless metrics that are critical to the health of your Amazon Web Services application.

Serverless on Public Cloud: The Ultimate Showdown

In this article, we’ll discuss the serverless offerings of each of the three major cloud service providers: Amazon Web Services, Google Cloud and Microsoft Azure.

Top Cloud Computing Service Providing Companies Reviews

Here is the list of Top Cloud Computing service providers who can give your business a new shift. Cloud technology is the new phase of business augmentation where the tailored business needs are taken forward to resolve various resource security...