We have an idea of what observability is and what data it is made up of. This brings up an important question. How can we get this data? Should we manually instrument every single service, layer by layer? No, this would take as much time as writing the code itself. Luckily, there are some awesome open source projects as well as companies that make this a lot easier.
The answer is open telemetry. What do we mean by open telemetry? Let's start off with the name itself. We have open, so like open source, and then telemetry, which is the process of gathering, analyzing, and transmitting data from remote sources to monitor the performance of systems. The word itself comes from the Greek words tele, meaning remote, and metron, meaning measure.
With any app, when you're looking at this kind of data, you have two parts that need to come together. The first is figuring out how to generate and transmit that data. The second part is deciding what you're going to do with that data. Open telemetry deals with the first part. Up until recently, there really hasn't been a standardized way of describing what your system is doing. This problem has been compounded by the vast variety of programming languages and computers in use, making it difficult to build standardized observability tooling. Solving this problem is the core of the open telemetry project, providing a standardization for describing what distributed systems are doing, no matter what programming language or computer systems you're using. Today, the open telemetry project can be described as a collection of tools, APIs, and SDKs used to instrument, generate, collect, and export telemetry data so we can analyze that data with whatever platform we wish.
Once we have open telemetry set up, we are collecting data and now need to export it somewhere to visualize it. Let's take a look at how you can use Grafana, the leading open source technology for dashboards and visualization, to analyze this data and to monitor your application. To begin with, you need to first install the instrumentation libraries. In the case of a node application, you will need to install both the open telemetry API and auto-instrumentation node packages. Next, you need to configure your application to export telemetry data. We will be writing a basic bash script that sets up open telemetry and runs our application. To get the authentication environment variables, you will need to set up a free account in Grafana Cloud and configure open telemetry for your Grafana Cloud stack. Then, you can choose a service name. Let's say this is our cart service, and then run your application via the shell script and make requests to the service to send telemetry data to Grafana Cloud.
Within Grafana Cloud, you can now observe your service and application observability. Inside of application observability, you can monitor your services' metrics, logs, traces, and profiles. Profiles we haven't mentioned yet, they identify performance bottlenecks in your application's code. Now that we have this data, what can you do with it? Well, you can configure alerts and on-call to help your team know when something's going wrong, such as if your node's application CPU usage goes above a certain threshold. Within application observability, you can also trigger an incident that automatically includes the important context from interim data. While investigating an incident, you can even run machine learning analysis via SIFT investigations, a powerful diagnostic assistant that helps you holistically analyze your system's telemetry during investigations. It does this through checks such as grouping similar error logs, identifying resources that had a recent deployment, identifying cube crashes, and more. Observability is not just confined to the back end. You can also configure observability for your front end to collect metrics such as page load, errors, user sessions, custom logs and events, and more. To start capturing telemetry from your front-end applications within Grafana, you can configure GrafanaFerro in your JavaScript initialization code. There we have it, how you can gain valuable insight and improve your JavaScript applications beyond relying on console.logs.
Thank you for your time today.
Comments