Building Real-Time Dashboards with Grafana

Joel Brass

March 9, 2025 / ,

Time-series data is everywhere, from monitoring industrial sensors and tracking financial markets to logging system performance and analyzing user behavior. However, raw data alone isn’t always useful. Effective visualization helps uncover patterns, detect anomalies, and drive better decisions. This is where Grafana, an open-source analytics and monitoring tool, shines. In this article, we’ll explore how to use Grafana to visualize time-series data and make the most of its powerful features.

Video

Why Grafana for Time-Series Data?

Grafana is one of the most popular visualization tools for time-series data, thanks to its versatility, real-time monitoring capabilities, and compatibility with various databases. The following are key advantages of Grafana:

  • Supports Multiple Data Sources: Works seamlessly with time-series databases like TDengine, InfluxDB, Prometheus, and TimescaleDB, as well as relational databases like PostgreSQL and MySQL.
  • Customizable Dashboards: Provides a flexible dashboard interface with multiple visualization options, such as line charts, heatmaps, and histograms.
  • Real-Time and Historical Data Analysis: Allows users to explore both real-time streaming data and historical trends for deeper insights.
  • Alerting System: Enables setting up alerts based on specific conditions, ensuring timely responses to critical events.
  • Plugins and Extensibility: Offers a wide range of plugins for additional features and integrations.

Integrate TDengine with Grafana

TDengine can be easily added as a data source to existing Grafana deployments as described in our documentation. If you would like to test TDengine’s integration with Grafana for yourself, we also provide a Docker Compose setup that includes a sample data generator for solar farms. This setup is described in the following diagram.

The following procedure describes how to use this setup.

Prerequisites

  • Install Git on your local machine. For instructions, see the Git website.
  • Install Docker on your local machine. For instructions, see the Docker website.

Procedure

  1. Clone the repository to your local machine.

    git clone https://github.com/taosdata/timeseries-essentials
  2. Open the grafana directory and run Docker Compose to create the containers:

    cd grafana
    docker-compose up -d
  3. In a web browser, open http://localhost:6060 to access the Grafana web interface.

  4. Enter admin as your username and passwerd as your password to log in.

  5. Add the TDengine data source to your Grafana instance.

    1. In the main menu on the left, select Add New Connection.

    2. Enter tdengine in the search box and click TDengine Datasource under Data Sources.

    3. In the upper right corner, click Install. Once the installation has completed, click Add new data source.

  6. Configure the TDengine data source as follows.

    • Name: Retain the default value of tdengine-datasource.

    • Host: Enter http://tdengine:6041.

    • User: Enter root.

    • Password: Enter taosdata.

    Then click Save & Test.

  7. Install the sample solar farm monitoring dashboard in Grafana.

    1. In the main menu on the left, click Dashboards.

    2. In the upper right corner, select New > Import.

    3. Click Upload dashboard JSON file and select the solarfarm_dashboard.json file included in the timeseries-essentials repository.

    4. Under renewables, select tdengine-datasource as your data source.

    Then click Import.

TDengine has now been connected to Grafana, and you can see data start to be displayed on the sample dashboard.

  • Joel Brass
    Joel Brass

    Joel Brass is a Solutions Architect at TDengine, bringing extensive experience in real-time data processing, time-series analytics, and full-stack development. With a 20 year background in software engineering and a deep focus on scalable applications and solutions, Joel has worked on a range of projects spanning joke databases, IoT, self-driving vehicles, and work management platforms. Prior to joining TDengine, Joel worked in Advisory Services for Enterprise customers of Atlassian and the Systems Engineering team at Waymo. He is currently based in the San Francisco Bay Area.