Log-based monitoring for AWS Lambda
Tags: aws, serverless, devops
Published: 2020-12-08 12:23:58

Monitoring and analytics have been an issue for Serverless systems since they were invented. While it's easy to attach an agent like NewRelic or DataDog to a server or container, **function monitoring requires a different approach**. Serverless applications, where logic is distributed over a large number of functions, attaching agents or wrappers leads to cost increase and development overhead. To provide insights into FaaS architectures, Dashbird collects all your [CloudWatch logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) and **extracts meaningful and actionable metrics**.

**[Dashbird](https://dashbird.io/monitor-aws-lambda) is a service that simplifies AWS monitoring and error alerting by collecting and analyzing CloudWatch logs and translating them into actions categorized as critical, warnings, and info. On top of preconfigured error alerts, you can also set customized alerts for whatever is important for you.**

The service takes advantage of the fact that [Lambda functions emit logs ](https://dashbird.io/docs/dashbird/how-dashbird-work/)with a lot of useful, pre-formatted information. With **smart parsing**, Dashbird provides **time-series metrics for invocations**, **memory usage**, **durations**, while also **sorting** and **displaying invocations separately**. Every piece of data is then culminated into [a single dashboard ](https://dashbird.io/docs/application-guide/dashboard/)that offers a bird's eye view of your entire system and points out problematic areas. It also acts as an error-alerting system, by recognizing exceptions, runtime errors, configuration problems, and timeouts and[ sending an email or Slack notification](https://dashbird.io/docs/quickstart/enable-alerting/) in real-time.

Dashbird requires minimal effort to[ set up](https://dashbird.io/docs/quickstart/setting-up-dashbird/) and has no cost effect on your AWS bill. Onboarding requires a delegation to your AWS account, which allows the service to get basic data about Lambda functions and collect their logs from CloudWatch. There is no additional code needed or any intrusion to your existing infrastructure. 

Enhanced AWS Monitoring
-----------------------

### ![Dashbird main dashboard](https://dashbird.io/wp-content/uploads/2017/11/Screenshot-2020-12-08-at-10.23.42.png)

[Dashbird](https://dashbird.io/monitor-aws-lambda) captures all things Serverless in a **single view**, preventing **problems from going unnoticed** and gives developers an **understanding of the traffic trends in the system**. The main page consists of time-series metrics for invocations, mean durations and memory usage, health stats, billed duration, error reports, and function-level load distribution. From there, you can drill down into any metric or locate misbehaving functions and troubleshoot issues.

![Dashbird single function view](https://dashbird.io/wp-content/uploads/2017/11/Dashbird-single-function-view.gif)

Dashbird's single function view gives you execution, duration, and memory usage graphs, along with errors, statistics, and invocation listing. You can use this insight to [optimize](https://dashbird.io/docs/best-practices-and-common-use-cases/improving-lambda-functions/) memory usage or view the average latency, while also seeing errors and [search ](https://dashbird.io/docs/application-guide/global-search/)and [live tail a Lambda function](https://dashbird.io/docs/application-guide/live-tailing/). Making for debugging and development easier and one step ahead.

Error alerting
--------------

![](https://dashbird.io/wp-content/uploads/2017/11/Dashbird-error.gif)

Dashbird has a **no BS ****approach** to error detecting and alerting. It finds [all runtime](https://dashbird.io/docs/best-practices-and-common-use-cases/lambda-errors-runtime-agnostic/) problems like **crashes**, **exceptions**, **early exits**, and **configuration errors** and [integrates with Slack, email, SNS, and webhooks](https://dashbird.io/docs/quickstart/notification-channels/). What sets it apart from other error trackers, is its ability to find timeouts and configuration errors. **These errors do not get notified to APMS that rely on sending data with a net request, since the execution is halted immediately.**

Dashbird also **aggregates error data**, so that you can track the relevance and magnitude of a recurring error and find overlaps in the Lambda logs that help with debugging.

Set up and cost
---------------

Creating the delegation takes about **two minutes**, and the setup screen guides you through it with a few simple steps. After that, the data will start pouring in immediately and you will **learn stuff about your system and unknown errors in a matter of minutes**. Apart from `logs:deleteSubscriptionFilter` and `logs:putSubscriptionFilter`, Dashbird only requires read rights to your AWS account.

In the first 14 days, Dashbird offers an unlimited amount of data for an unlimited amount of functions. [Here are the full pricing details.](https://dashbird.io/pricing)

Wrapping up
-----------

If your application logic is **distributed over large amounts of functions**, it makes a lot more sense to **collect information from the logs** rather than sending telemetry at the execution time. Dashbird introduces what will one day be the ***de facto***** standard for Serverless monitoring**. If you're building on AWS Lambda, Dashbird is one of the best tools for enhanced AWS monitoring and improving your Serverless architecture thanks to its Well Archiotected Insights engine, analyzing your data and translating it into easy-to-understand critical, warning, or info actions.