InfluxDB Time Series Data Monitoring with Grafana | InfluxData (2024)

ByGunnar Aasen /Product, Developer, Company
Nov 02, 2017

Navigate to:

    The “open platform for beautiful analytics and monitoring,” Grafana supports various backends that store time series data. One of those backends is InfluxDB. InfluxDB is a time series database built specifically for storing time series data, and Grafana is a visualization tool for time series data.Given this perfect match, Grafana has a tight integration with InfluxDB.

    Introduction to time series monitoring with Grafana

    Grafana is definitely one of the most popular time series data visualization tools that we recommend using with InfluxDB. Below are some basics on how to set up your Grafana dashboard with InfluxDB, how to use the Grafana InfluxDB solution to get the most out of your time series data, and how to visualize what you want - the way that you want - using InfluxDB time series database.

    InfluxDB Time Series Data Monitoring with Grafana | InfluxData (1)

    Grafana dashboard setup for InfluxDB

    For starters, download InfluxDB and Grafana. The basic setup is to have InfluxDB and Grafana monitoring connected together. InfluxDB has an API, and typically, that defaults to port 8086 while Grafana’s API is on port 3000. And Grafana will call the InfluxDB API whenever it wants to query data.

    When you set up the InfluxData time series platform, you will need a collection agent collecting your metrics. For InfluxDB, use Telegraf which already has over 200 plugins.

    InfluxDB Time Series Data Monitoring with Grafana | InfluxData (2)

    Some Grafana InfluxDB setup basics to remember:

    • InfluxDB is essentially a time series database process that runs on a server. That process can also run on the same box that Grafana runs on. Grafana has a very lightweight server-side application, and most of Grafana monitoring runs in the browser.
    • It's easiest to set up Grafana and InfluxDB on the same instance, yet if you find you have a very large installation of InfluxDB, a number of Grafana users, or a certain security, or deployment profile within your organization, then setting up InfluxDB and Grafana on separate servers is also perfectly acceptable.
    • InfluxDB will be the more memory-intensive and CPU-intensive application of the two, simply because a lot of Grafana's work happens in the browser. To maintain best performance, we recommend for Grafana monitoring that you use the latest browsers.

    Grafana and InfluxDB setup configurations

    A lot of the defaults set up for InfluxDB can be maintained. Note that you can enable query log—which will log all queries when executed or when sent to the InfluxDB API, which can be useful for debugging Grafana issues.

    One important thing to note when setting up InfluxDB with Grafana is to set up the coordinator section of the config—specifically, set the maximum number of concurrent queries:

    • If you have issues with different Grafana users all hitting InfluxDB with different open browsers and sending a bunch of time series database queries through, we recommend setting the max concurrent queries. You can also set query time-outs and set queries to be logged if they take longer than a certain amount of time.
    • The settings around max-select point, max-select series, and max-select buckets are also very useful in limiting the amount of results that can be returned — thereby preventing a particularly expansive query from potentially taking down the InfluxDB server or causing a slowdown for everyone else.

    When exploring Grafana’s configuration file, you’ll find a wealth of other great ways to configure Grafana monitoring to make it more usable. These include setting Grafana http port, router logging, and enabling the user to make your browser pages load faster.

    Learn about Grafana security settings

    As for security settings, every Grafana instance has a default admin user and default password. If you are setting up Grafana monitoring on anything where anyone is able to get into your instances, set your own custom username or at least password to prevent people from getting access.

    Here are some basic Grafana security settings:

    • By default, Grafana will allow users to sign up and register and also allows non-admin users to create organizations. So we recommend setting the "enable anonymous access" option as "false" to prevent people from setting up users on organizations if you didn't want them to.
    • Also, anonymous access is disabled by default, but you can enable anonymous access, which is very useful if you have a public Grafana dashboard that you'd like to promote.
    • If you do a password reset that requires a user to receive an email, you'll want to set that up in the SMTP section.
    • Grafana also has a number of log levels, so if you're trying to debug, definitely bump up the log level to debug.
    • Grafana will expose metrics about itself — Telegraf has a Prometheus input built-in so you can direct it towards that and receive or collect internal Grafana metrics, put them into InfluxDB, then graph them again in Grafana.

    If you are using InfluxDB Cloud and need to configure access to different groups and users on Grafana to view the time series data that InfluxDB Cloud collects, view the webinar short “InfluxDB Cloud with Multi-Tenant Grafana.”

    Setting up graphs for Grafana Metrics

    InfluxData’s “How to use Grafana with InfluxDB” webinar explains how to use Grafana UI to set up graphs and use InfluxDB Query Builder.

    InfluxDB Time Series Data Monitoring with Grafana | InfluxData (3)

    Here are some webinar highlights on what to expect in building your Grafana dashboard and customizing your graphs:

    • Once in config, add a data source, select the InfluxDB Type, and give that source a name. You might want to make it the default data source for your Grafana monitoring instance. You pick the InfluxDB URL and enter the database, user, and credentials. Once you get the "success" notification on that, then you add a Grafana dashboard.
    • Grafana dashboards are based off rows and panels. You can have multiple panels on a row, and you can edit panels.
    • While in edit mode, you see the Grafana Metrics path, where you specify your InfluxDB query. You can also specify the InfluxDB policy that you want to use.
    • The default is to use the "value" as a field and "mean", but you can use any aggregator of your choice. You can also select multiple fields, or select the same field twice and use different aggregators.
    • You can add various kinds of transformation like moving_average.
    • Another property in the Grafana Metrics tab is how they're GROUPED BY. By default, Grafana GROUPS BY a predefined interval value, which is calculated based on the screen and the panel width. You can also specify how InfluxDB should handle null values.
    • You can change how to display the graph (as lines, bars, points, etc.) and take advantage of the different display settings.

    InfluxDB Time Series Data Monitoring with Grafana | InfluxData (4)

    Optimize time series monitoring with Grafana

    InfluxDB and Grafana perform well together, but you can definitely hit some performance issues. If you’re collecting a lot of time series data, or alternatively querying a lot of data and putting some stress on InfluxDB, you’ll typically find that InfluxDB — since it is doing a lot of the server-side work — is the first piece of the Grafana InfluxDB chain to experience issues.

    Each Grafana graph is actually a query to InfluxDB. The more graphs you have, the more load there is on the InfluxDB server. So if you have a Grafana dashboard of 30 graphs, that’s 30 queries that you’re sending to InfluxDB and 30 queries that need to get the results collated by InfluxDB, and then sent back through Grafana monitoring. If you have a lot of queries or graphs, think about what you’re graphing and whether all the graphs that you have displayed are actually useful to you.

    To further improve the performance of InfluxDB and Grafana, here are some helpful tips:

    • Set your rows to be collapsible - when you collapse rows, Grafana will not show or render that graph, and therefore won't produce the queries to InfluxDB. So if you happen to have a Grafana dashboard that has a lot of useful graphs, that are perhaps not all useful at once, a great way to reduce or speed up your Grafana monitoring experience with InfluxDB is to use collapsible rows.
    • There are also several graph types and other options you can add to graphs. For example, if you care only about the number of queries executed, you can just return the latest number of queries that was executed and not a graph over time. You can also do templating and annotations.
    • Every query generated by Grafana graphs typically has a GROUP BY option, so you'll see a lot of recalculation on each loading of the graph.
    • If you do a very expansive query to calculate, and InfluxDB takes a while to respond and the query times out and you get an error in your Grafana graph, wait a little before you hit the Refresh button.
    • InfluxDB and Grafana monitoring both provide many logging options. If Grafana is displaying an error for a graph, go through and figure out why it's producing that error if it doesn't show up after one or two refreshes. InfluxDB doesn't cache queries, so every time you send a query, it recalculates the results. Typically, if you're zooming out or selecting larger time ranges, such as 24 hours, it'll take longer for InfluxDB to pull out all those results. The more data you accumulate, the more data Grafana and InfluxDB have to process to load.

    Conclusion

    There is no limitation on the number of Grafana metrics displayed on one graph, but remember to track those most useful to you for time series monitoring performance, extracting insights or enabling forecasts. If you’re thinking about how many Grafana metrics you want to display at one time, you might also want to think about what that time series data is actually showing you and what you’re trying to accomplish by reading all that data.

    InfluxDB Time Series Data Monitoring with Grafana | InfluxData (2024)

    FAQs

    How to see InfluxDB data in Grafana? ›

    Query InfluxDB with Grafana
    1. Click Explore.
    2. In the dropdown, select the saved InfluxDB data source to query.
    3. Use the SQL query form to build your query: Table: Select the measurement to query. ...
    4. Recommended: Change format to Time series. ...
    5. Click Run query to execute the query.

    Can Grafana show real time data? ›

    Grafana Live uses persistent connections (WebSocket at the moment) to deliver real-time updates to clients.

    Is Prometheus better than InfluxDB? ›

    InfluxDB is much more suitable for event logging. Prometheus is focused on metrics recording. They both require some manual effort to manage and scale. Prometheus, for example, requires configuring and installing new Prometheus servers whenever you need to scale, plus routine upgrades.

    What is the best database to use with Grafana? ›

    Time series databases

    Time series data is the best type of data for monitoring and visualizing in Grafana. One of the most popular databases for storing time-series data. InfluxDB is a part of the TICK-stack: the collection of tools for collecting, storing, and analyzing time-series data.

    How to visualize data in InfluxDB? ›

    Get started visualizing data
    1. Create a dashboard.
    2. Create dashboard cells.
    3. Create and use dashboard variables. Create a custom dashboard variable. Use a custom dashboard variable.

    What is the difference between Grafana and InfluxDB dashboard? ›

    Data Visualization Capabilities:

    Grafana supports a wide variety of data sources and offers extensive customization options to tailor the visualizations exactly how you want them. In contrast, InfluxDB has more limited visualization capabilities.

    Is Grafana a continuous monitoring tool? ›

    Grafana Pyroscope is an open source continuous profiling database that provides fast, scalable, highly available, and efficient storage and querying. This helps you get a better understanding of resource usage in your applications down to the line number.

    What type of monitoring can be done via Grafana? ›

    Application Monitoring: Grafana can be used to monitor application performance metrics such as response time, error rates, and throughput. Log Monitoring: Grafana can be used to analyze logs and create visualizations of log data to identify trends, patterns, and anomalies.

    Can Grafana read from Excel? ›

    A connection establishes a link between Grafana and Microsoft Excel 365 nodes (or vice versa) to route data through the workflow. A connection between two nodes passes data from one node's output to another node's input. Each node can have one or multiple connections.

    What are the downsides of InfluxDB? ›

    Con: Writing points with random times or with time not in ascending order is significantly less performant. Scale is critical. The database must be able to handle a high volume of reads and writes. Pro: The database can handle a high volume of reads and writes.

    What are the limitations of InfluxDB? ›

    Global limits
    • Write request limits: ...
    • Write partition limit: ...
    • Query processing time: 90 seconds.
    • Total query time: 1500 seconds of total query time every 30 seconds.
    • Task processing time: 150 seconds.
    • Total task time: 1500 seconds of total task time every 30 seconds.

    Why is InfluxDB the best? ›

    InfluxDB is purpose-built for time series data. Relational databases can handle time series data, but are not optimized for common time series workloads. InfluxDB is designed to store large volumes of time series data and quickly perform real-time analysis on that data.

    Who competes with Grafana? ›

    Top Grafana Cloud Alternatives
    • SolarWinds Server & Application Monitor.
    • Zabbix.
    • Datadog.
    • Dynatrace.
    • VMware Aria Operations.
    • SCOM.
    • New Relic.
    • DX Spectrum.

    Which is better Prometheus or Grafana? ›

    Prometheus focuses on data acquisition, allowing users to select and aggregate time series data in real time. Grafana, on the other hand, focuses on data visualization. We can't really say one is better than the other, but in fact, they work best when they work together.

    Can Grafana handle big data? ›

    There is no restriction or limitation of data that Grafana can handle, also no restriction for the dashboards, panels or even user, in this context of on-premise installation.

    How do I view raw data in Grafana? ›

    Grafana generates a CSV file in your default browser download location. You can open it in the viewer of your choice. In the Inspector tab, get raw query results by following the instructions described in Inspect raw query results. Refine query settings until you can see the raw data that you want to export.

    How do I view raw data in InfluxDB? ›

    Toggle the View Raw Data option to see your data in table format instead of a graph. Scroll through raw data using arrows, or click page numbers to find specific tables. Group keys and data types are easily identifiable at the top of each column underneath the headings.

    How do I monitor a database with Grafana? ›

    In Grafana, hover your mouse over the Configuration (gear) icon on the left sidebar and then click Data Sources. Select the Prometheus data source. On the Dashboards tab, Import the Grafana metrics dashboard. All scraped Grafana metrics are available in the dashboard.

    How to link Grafana to InfluxDB? ›

    In the left navigation of the Grafana UI, open the Connections section and select Add new connection. Select InfluxDB from the list of available data sources and click Add new data source. On the Data Source configuration page, enter a name for your InfluxDB data source.

    Top Articles
    Latest Posts
    Article information

    Author: Van Hayes

    Last Updated:

    Views: 5912

    Rating: 4.6 / 5 (46 voted)

    Reviews: 85% of readers found this page helpful

    Author information

    Name: Van Hayes

    Birthday: 1994-06-07

    Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

    Phone: +512425013758

    Job: National Farming Director

    Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

    Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.