grafana/docs/sources/getting-started/get-started-grafana-influxdb.md
Christopher Moyer a568d421f8
Docs: Setup refactor (#49739)
* builds out refactored setup topics

* Automatically fix some relrefs with mv-manager

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use refs for tutorials content which is outside of this repository

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Manually fix complicated relrefs

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* consolidates team sync and db encryption topics

* Fix relrefs

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* updates setup index file

* Convert TOML to YAML

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add current alias for new alerting content

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add current aliases to new setup-grafana and configure-security pages

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* moves saml docs, updates order in TOC

* Manually fix relrefs

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* added usage insights topics, adjusted weights

* corrected relrefs

* Fix relrefs broken in rebase

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2022-06-02 11:57:22 -05:00

7.0 KiB

aliases description title weight
/docs/grafana/latest/getting-started/get-started-grafana-influxdb/
/docs/grafana/latest/getting-started/getting-started-influxdb/
Learn how to build your first InfluxDB dashboard in Grafana. Get started with Grafana and InfluxDB 400

Get started with Grafana and InfluxDB

{{< docs/shared "influxdb/intro.md" >}}

Note: You can also configure a Grafana Cloud instance to display system metrics without having to host Grafana yourself. Grafana offers a free account with Grafana Cloud to help you get started.

{{< docs/shared "getting-started/first-step.md" >}}

Get InfluxDB

You can download InfluxDB and install it locally or you can sign up for InfluxDB Cloud. Windows installers are not available for some versions of InfluxDB.

Install other InfluxDB software

Install Telegraf. This tool is an agent that helps you get metrics into InfluxDB. For more information, refer to Telegraf documentation.

If you chose to use InfluxDB Cloud, then you should download and install the InfluxDB Cloud CLI. This tool allows you to send command line instructions to your cloud account. For more information, refer to Influx CLI documentation.

Get data into InfluxDB

If you downloaded and installed InfluxDB on your local machine, then use the Quick Start feature to visualize InfluxDB metrics.

If you are using the cloud account, then the wizards will guide you through the initial process. For more information, refer to Configure Telegraf.

Note for Windows users:

Windows users might need to make additional adjustments. Look for special instructions in the InfluxData documentation and Using Telegraf on Windows blog post. The regular system monitoring template in InfluxDB Cloud is not compatible with Windows. Windows users who use InfluxDB Cloud to monitor their system will need to use the Windows System Monitoring Template.

Add your InfluxDB data source to Grafana

You can have more than one InfluxDB data source defined in Grafana.

  1. Follow the general instructions to [add a data source]({{< relref "../datasources/add-a-data-source/" >}}).
  2. Decide if you will use InfluxQL or Flux as your query language.
    • For InfluxQL, refer to [InfluxDB data source]({{< relref "../datasources/influxdb/" >}}) for information about specific data source fields.
    • For Flux, refer to [Flux query language in Grafana]({{< relref "../datasources/influxdb/influxdb-flux/" >}}) for information about specific data source fields.
InfluxDB guides

InfluxDB publishes guidance for connecting different versions of their product to Grafana.

Important tips
  • Make sure your Grafana token has read access. If it doesn't, then you'll get an authentication error and be unable to connect Grafana to InfluxDB.
  • Avoid apostrophes and other non-standard characters in bucket and token names.
  • If the text name of the organization or bucket doesn't work, then try the ID number.
  • If you change your bucket name in InfluxDB, then you must also change it in Grafana and your Telegraf .conf file as well.

Add a query

This step varies depending on the query language that you selected when you set up your data source in Grafana.

InfluxQL query language

In the query editor, click select measurement.

InfluxQL query

Grafana displays a list of possible series. Click one to select it, and Grafana graphs any available data. If there is no data to display, then try another selection or check your data source.

Flux query language

Create a simple Flux query.

  1. Add a panel.
  2. In the query editor, select your InfluxDB-Flux data source. For more information, refer to Queries.
  3. Select the Table visualization.
  4. In the query editor text field, enter buckets() and then click outside of the query editor.

This generic query returns a list of buckets.

Flux query

You can also create Flux queries in the InfluxDB Explore view.

  1. In your browser, log in to the InfluxDB native UI (OSS is typically something like http://localhost:8086 or for InfluxDB Cloud use: https://cloud2.influxdata.com).

  2. Click Explore to open the Data Explorer.

  3. The InfluxDB Data Explorer provides two mechanisms for creating Flux queries: a graphical query editor and a script editor. Using the graphical query editor, create a query. It will look something like this:

    InfluxDB Explore query

  4. Click Script Editor to view the text of the query, and then copy all the lines of your Flux code, which will look something like this:

    InfluxDB Explore Script Editor

  5. In Grafana, add a panel and then paste your Flux code into the query editor.

  6. Click Apply. Your new panel should be visible with data from your Flux query.

Check InfluxDB metrics in Grafana Explore

In your Grafana instance, go to the [Explore]({{< relref "../explore/" >}}) view and build queries to experiment with the metrics you want to monitor. Here you can also debug issues related to collecting metrics.

Start building dashboards

There you go! Use Explore and Data Explorer to experiment with your data, and add the queries that you like to your dashboard as panels. Have fun!

Here are some resources to learn more: