Day 76 of 90 Days of DevOps Challenge: Build a Grafana Dashboard

Tushar PantTushar Pant
2 min read

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

  1. Create a New Dashboard.

  2. Add a New Panel.

  3. Configure the Query and Visualization.

  4. Save the Dashboard.


Step-by-Step Guide

Step 1: Create a New Dashboard

  1. Open Grafana:

    • Navigate to your Grafana instance in your web browser.
  2. 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

  1. Add a New Panel:

    • Click on Add a new panel in the dashboard editor.

Step 3: Configure the Query and Visualization

  1. 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.
  1. Set the Legend:

    • In the Legend field, enter {{route}} to rename the time series in the legend.
  2. Change the Panel Title:

    • In the Panel editor on the right side, under Settings, change the Panel title to “Traffic”.
  3. 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

  1. Apply the Panel:

    • Click Apply in the top-right corner to save the panel and return to the dashboard view.
  2. 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!

0
Subscribe to my newsletter

Read articles from Tushar Pant directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Tushar Pant
Tushar Pant