Mastering Observability: A Comprehensive View Of Application State

Valerio Barbera

Following the recent series of posts your familiarity with these topics should begin to improve. You will naturally look for a more complete picture of your application state.

The concept of Observability in fact concerns the possibility of having a basic picture that represents the state of the application as a whole, with a set of data that allows you to dig deeper and deeper based on your current analysis needs.

Sometimes Observability turns out to be a controversial topic, because it exposes you to the risk of over-engineering the idea of monitoring and adopting tools that are so complicated that their integration and use is more difficult than the normal software development activities themselves.

From the beginning of the course we have framed Monitoring as an automation tool. If it complicates your life, you need to ask yourself a question. 

Now I want to show you how these tools work internally by explaining the Tracing technique.

Mastering Observability: Tracing

The most important mechanism on which Observability tools are based is Tracing.

That is the ability to collect a set of data that allows you to visually represent the behavior of the application at a level as granular as possible.

In this slide I show you a classic example of Tracing, in which you can see two fundamental elements: Transaction, and Segments.

The Transaction is intended to represent an execution cycle of the application. An execution cycle can be triggered in different ways, for example by an HTTP request from input to the response, or the background execution of a cron job.

Obviously in most cases the bulk of the transactions will be generated by HTTP traffic, but it is just to make you understand that the transaction is the highest level object and it represents the entire execution.

Segments instead represent the code instructions performed within an execution cycle. And here we can have many different things, like database queries, authentication procedures, data validations, calls to external services, etc.

Mastering Observability: Data Model

These two objects Transactions, and Segments are in practice json objects created by the monitoring library during the normal execution of the application, and streamed to the remote platform where you can visualize them in real time.

The one shown in this slide is an example taken from how Inspector works. It is an example of a data packet used by our platform to understand how your application works. The concept of tracing is quite standard, by learning some technical jargon and knowing what they refer to, you will be able to independently evaluate any monitoring tool.

At the start of the Transaction the library generates a unique hash that will be used to link subsequent segments to the current execution cycle.

Thanks to this connection, the monitoring tool should be able to automatically trace the chain of events inside your application and build a visual representation of it like the Timeline I showed you before.

One of the most important reasons why you need to know what transactions and segments are is to evaluate the pricing of these types of tools.

Evaluate Pricing Policy

One tool may place more emphasis on effort to manage segments, while another may have transaction-based pricing.

Having an idea of these characteristics and terminologies is important to help you do the math. 

For example, understanding whether with the same characteristics, one tool could cost you less than the other based on the type of data you are most interested in.

Fix Bugs On Autopilot

When an error occurr after a delivery cycle Inspector not only alerts you with a notification, but also creates a pull request on your GitHub repository to automatically fix the error.

Now you are able to release bug fixes after a few minutes the error occurred without human intervention in between. Learn more on the documentation.

Are you responsible for application development in your company? Monitor your software products with Inspector for free. You can fix bugs and bottlenecks in your code automatically, before your customers stumble onto the problem.

Register your account or learn more on the website:

Related Posts

Logging Database Queries with Eloquent ORM and Laravel – Fast Tips

Having a more clear understanding of what your application really does during its execution is an increasing necessity. Logging the raw database queries generated by your preferred ORM is one of the most common needs to be more aware of what is happening behind the scenes. More and more abstraction layers are becoming available in

Laravel Http Client Overview and Monitoring

Laravel HTTP client was introduced starting from version 10 of the framework, and then also made available in all previous versions. It stands out as a powerful tool for making HTTP requests and handling responses from external services. This article will delve into the technical foundations of the Laravel HTTP client, its motivations, and how

Laravel Form Request and Data Validation Tutorial

In this article I will talk about Laravel Form Request to send data from your application frontend to the backend. In web applications, data is usually sent via HTML forms: the data entered by the user into the browser is sent to the server and stored in the database eventually. Laravel makes it extremely simple