Day 76 of 90 Days of DevOps Challenge: Build a Grafana Dashboard
Creating a Grafana dashboard allows you to visualize and monitor your data in a way that provides insights at a glance. In this task, we will create a simple dashboard with a panel that displays traffic metrics using a specific query.
Task Overview
Create a New Dashboard.
Add a New Panel.
Configure the Query and Visualization.
Save the Dashboard.
Step-by-Step Guide
Step 1: Create a New Dashboard
Open Grafana:
- Navigate to your Grafana instance in your web browser.
Create a Dashboard:
In the left sidebar, hover your cursor over the Create (plus sign) icon.
Click on Dashboard.
Step 2: Add a New Panel
Add a New Panel:
- Click on Add a new panel in the dashboard editor.
Step 3: Configure the Query and Visualization
Enter the Query:
- In the Query editor below the graph, enter the following query:
sum(rate(tns_request_duration_seconds_count[5m])) by (route)
- Press Shift + Enter to run the query.
Set the Legend:
- In the Legend field, enter
{{route}}
to rename the time series in the legend.
- In the Legend field, enter
Change the Panel Title:
- In the Panel editor on the right side, under Settings, change the Panel title to “Traffic”.
Visualize the Data:
- Ensure that the visualization type (e.g., graph, bar chart, etc.) is appropriate for the data being represented. Adjust visualization settings as needed to enhance the display.
Step 4: Save the Dashboard
Apply the Panel:
- Click Apply in the top-right corner to save the panel and return to the dashboard view.
Save the Dashboard:
Click the Save dashboard (disk) icon at the top of the dashboard.
In the Dashboard name field, enter a name for your dashboard (e.g., “Traffic Dashboard”).
Click Save.
Conclusion
You have successfully created a Grafana dashboard with a panel displaying traffic metrics. This is a crucial step in monitoring and visualizing your application’s performance. You can continue to add more panels to visualize other metrics and data points as needed. Let me know if you have any questions or need further assistance!
Subscribe to my newsletter
Read articles from Tushar Pant directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by