Now that we have explored monitoring apis with Prometheus, let's take a look at monitoring our APIs with Grafana. You may have noticed from the previous blog that Prometheus is awesome, but takes some time to fully flesh out and their dashboards aren’t easy to read or very eye-catching. Luckily for us, Grafana specializes in data visualization. We won’t even have to configure all our Prometheus queries, so let’s get started.
We first need to confirm everything is running. If everything is working correctly, your output should look similar to the image above. If you are not familiar with getting everything up and operating, please reference our previous blog. By navigating to 127.0.0.1:3000 you should see the Grafana home page. If you are not familiar with Grafana you may be wondering where the dashboards are. They are all located in the top left dropdown where we will see 4 pre-configured dashboards. Let’s review each of them to understand what each of them does.
The Docker Host Dashboard is a powerful tool that provides a centralized view of the performance and health of your Docker host and its containers. With the Docker Host Dashboard, you can monitor resource usage, track network traffic, and keep an eye on the logs and events of your Docker host. This dashboard is designed to be easy to use and offers a variety of visualization options, making it an essential tool for any organization that relies on Docker for their application deployment. Thanks to dockerprom for pre-configuring all this. We can now see:
The Docker Containers Dashboard shows key metrics for monitoring running containers:
The Monitor Services Dashboard shows key metrics for monitoring the containers that make up the monitoring stack:
If you're looking to monitor your APIs with Grafana, here are a few tips to keep in mind to ensure that your monitoring is as effective as possible.
By following these tips and continuously refining your monitoring approach, you can ensure that your APIs remain performant and reliable for your end-users.
We now have a fully functioning monitoring tool with no code. Isn’t that awesome? A no code API tool and a no code data visualization tool, it can’t get much better than this. This post has only scratched the surface with regards to what you can accomplish with these tools. If you are interested in this for a Ruby application, check out our friends over at Scout who wrote a blog about doing exactly that. If you like what you see, sign up for a free trial today or contact us for more information!
Monitoring APIs with Prometheus