Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
In this post, Iâm covering five approaches for gaining observability in serverless (FaaS based) systems. I hope that it can help developers, system architects, and DevOps engineers make the serverless journey successful, less frustrating, and of courseâââenjoyable.
Serverless and Function-as-a-Service (FaaS) have been around for about three years now. It started with AWS Lambda, and quickly expanded into similar services provided by the leading cloud vendorsâââMicrosoft, Google, IBM, and others. However, as people started using it, serverless became much more than just FaaS. Serverless systems today involve functions, containers, managed services provided by the cloud vendor (e.g., message queues, DBs, storage), and a vast variety of SaaS APIs (e.g., Auth0, Twilio, Stripe), all interacting with one another.
Due to the nature of these functionsâââlimited running time, low memory, and no state, developers are encouraged to utilize more and more of these managed services. As the number of functions and APIs increase, so does the complexity of serverless applications. Modern applications are highly distributed (ânano-servicesâ) and event-driven. On top of that, the lack of access to any server, and everything being stateless, doesnât make things easier. Observability is a central challenge when trying to resolve issues quickly and preventing system downtime, as well as understanding performance and cost implications.
Serverless system are distributed and event-driven
To overcome these challenge, developers and DevOps engineers have several options today for gaining observability into their systems. Each approach has pros and cons, and naturallyâââits sweet spots. Since AWS is the most popular platform for serverless today, many of the examples presented here are from AWS, but they can be applied in other cloud vendors.
1. âThis is easyââââusing the default cloud vendor console
The cloud vendorâs console is the first and most direct approach to attempting to solve issues in your serverless system. AWS equips developers with CloudWatch, âa monitoring service for AWS cloud resources and the applications you run on AWS.â Anyone using AWS Lambda is well familiar with the CloudWatch console. There, you can find log groups for each of your functions, and each group contains all the logs of the function. The logs refresh asynchronously, and it can take any time from seconds to minutes for the logs to update.
Since most developers feel comfortable writing logs, itâs pretty straightforward to use. Just run your function, and take a look at the log. However, when things become a bit more complicated, i.e., in a distributed system with multiple functions, queues, triggers, and more, it can be quite challenging to understand the whole picture and connect all the different log items. Imagine a chain of 5 Lambda functions with triggers in betweenââânot to mention the times you donât remember to log everything. Azure and Google have a similar solution for logging from their FaaS services. The default console is great to start with, and indeed cannot be ignored. However, when crossing the 5 or 10 functions range, most teams quickly discover challenges in understanding their systems, and some even refer to it has âlog hell.â Letâs explore some alternatives.
2. âLetâs go somewhere else!ââââlog streaming to an external service
When your serverless architecture evolves, and youâre going through logs, more logs, and some more logs, something suddenly doesnât feel right. It shouldnât be this wayâââshould it? Youâre spending all your time going through endless lists of lines, written from functions which run millions of times every day. Itâs not practical, and it just doesnât work anymore. Even if you found the correct error in the log, going backward and doing root-cause-analysis is nearly impossible.
What has been going on in all the message queues? Perhaps an external API is slowing your system down and causing your cloud bill to spike? There must be a better solutionâââright?
You probably heard about log aggregation platforms, such as Splunk, Loggly, and others. Some of them are greatâââthey even automatically detect anomalies for you! In that case, why not stream all of your logs into such a service, and then quickly and easily search and filter everything there? No more manual log scrubbing? Hurray!
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.