Apache Superset and InfluxDB Cloud 3.0

Navigate to:

In this tutorial, we’ll learn how to build dashboards using Apache Superset and data from InfluxDB Cloud 3.0. This guide will provide practical steps and insights to integrate these powerful tools, helping you visualize your time series data with ease and precision. Whether you are monitoring IoT devices, applications, or infrastructure, you’ll find valuable tips on leveraging Superset and InfluxDB Cloud to enhance your data analytics capabilities. The corresponding repo for this blog post can be found here.

Advantages of Apache Superset

Some of the advantages of Apache Superset include:

  • Compatibility with Time Series Data: InfluxDB is optimized for time series data, and Apache Superset is well-suited to handle such data effectively. Superset can create dynamic dashboards that update with real-time data, making it ideal for monitoring metrics that change over time, like those typically stored in InfluxDB.
  • Interactive Dashboards: Superset allows users to build interactive dashboards they can customize and share. Users can drill down into the data’s details, apply filters, and explore interactively, which is especially useful for the complex datasets often found in InfluxDB.
  • Wide Range of Visualization Options: Superset provides a broad array of visualization types, from simple line charts and bar graphs to more complex types like geospatial charts, histograms, and bubble charts. This variety lets users select the most appropriate visualizations for their specific InfluxDB data sets.
  • Scalability: Apache Superset can scale to handle large volumes of data, which complements InfluxDB’s ability to store massive amounts of time series data efficiently. This makes Superset a good choice for enterprises or situations where data grows rapidly.
  • SQL-Based Exploration: Superset uses SQL for querying data, which can be advantageous if you use InfluxDB with SQL-compatible querying layers. This feature allows data analysts familiar with SQL to leverage their skills to explore time series data in InfluxDB.
  • Open Source and Community Support: As an open source project, Apache Superset benefits from a large community of developers and users who contribute to its continuous improvement. This community can provide support and develop new features that keep the tool up-to-date with the latest data visualization trends.
  • Security Features: Superset offers robust security settings, including role-based access control, ensuring that sensitive InfluxDB data is protected and can be accessed only by authorized users.
  • Seamless Integration: Superset offers a user-friendly interface that allows easy integration with other tools and platforms in the data ecosystem. This integration enables users to effortlessly manage their workflow from data storage in InfluxDB to analysis and visualization in Superset, giving them a sense of control over their data processes.

Project structure overview

The corresponding repo for this blog aims to make connecting InfluxDB Cloud 3.0 to an instance of Superset as easy as possible with Docker and shell scripts that automate the initialization of Superset and the connection to InfluxDB. It contains the following structure:

  1. app Directory
    • Add_influxdb_connection.sh: A shell script possibly used for setting up or configuring a connection to InfluxDB. It might handle the automation of adding the InfluxDB data source to Superset through CLI commands or environment setups.
    • superset_config.py: The Python configuration file for Superset. It typically includes database connection settings, feature flags, logging configurations, and other operational settings that define how Superset behaves.
  2. superset_home Directory: A directory designated for storing Superset’s dynamic data such as logs, SQLite databases, or other user-generated content.
    • .bash_history: This file stores the command history for the shell session. It’s useful for recalling commands run in the container’s shell.
    • superset.db: The SQLite database file where Superset stores its internal data, such as users, dashboards, charts, and configurations. This file suggests that SQLite is used as the backend database.
  3. Root Project Files
    • docker-compose.yml: This is the Docker Compose configuration file used to define and run multi-container Docker applications. Here, it likely defines the services, networks, and volumes for your Superset setup.
    • Dockerfile: A script used by Docker to automatically build images from source. It includes instructions for building the Docker image of Superset, such as the base image to use, the commands to run, and the files to copy into the image.
    • Generate_secret_key.sh: This script generates a secure secret key for your Superset deployment. The secret key is essential for securely signing the session cookie in Flask (which Superset uses).

Start building dashboards in Apache Superset

This tutorial assumes that you have Docker running on your machine. To get started building dashboards in Superset, pull the Superset quickstart repo and follow these steps:

  1. Sign up for a free InfluxDB Cloud 3.0 trial.

  2. Gather your authentication credentials, including:
    • database
    • token
    • URL
  3. Edit the app/add_influxdb_connection.sh to include those credentials.

  4. cd into Superset.

  5. Run docker-compose up –build -d

  6. Visit http://127.0.0.1:8088 to use Apache Superset.

  7. Login with “admin” for the username and password (to change the username and password, edit the Dockerfile with the credentials you want to use instead).

  8. Start building visualizations and dashboards for your time series data!

After you log in, you’ll be able to start querying your InfluxDB instance and building a variety of visualizations.

An example of building a line graph in Apache Superset and data from InfluxDB Cloud 3.0.

Additional resources and conclusion

We hope this tutorial helps you get started visualizing your data with InfluxDB and Superset. We also want to encourage you to take a look at the following related resources to learn more about how to leverage InfluxDB with Superset:

Additionally, you might find the following resources on visualizing data with Grafana and Tableau helpful as well:

As always, get started with InfluxDB Cloud 3.0 here. If you need help, please contact us our community site or Slack channel.