title | description | author | tags | date_published |
---|---|---|---|---|
Access time series data in InfluxDB Cloud with Google Data Studio |
Quickly deploy a comprehensive dashboard using Data Studio and your time series data. |
gunnaraasen |
time series, data, visualization, monitoring, Google Cloud, Data Studio |
2020-12-08 |
Gunnar Aasen | Product Manager | InfluxData
Contributed by the Google Cloud community. Not official Google documentation.
Google Data Studio is an interactive dashboard tool that turns any internet-accessible data source into informative dashboards that are easy to build and share, which help you to derive powerful insights from your data.
The easy-to-use user interface makes it possible for anyone with the curiosity to drill down into their live datasets and build dashboard and reports with interactive controls such as data selectors, column sorts, and page-level filters. It also has support for calculated metrics and calculated fields. The InfluxData platform comes with a Data Studio connector that allows users to query time series data from their InfluxDB instance to build these Data Studio dashboards. In this tutorial, you use Data Studio to visualize monitoring metrics stored in InfluxDB Cloud.
The same general steps in this tutorial can be used for other InfluxDB measurement data being collected. Simply replace the references to diskio-usage
and
diskio
with the bucket name and measurement name to connect to Data Studio.
- Connect Data Studio to your InfluxDB Cloud instance.
- Configure a downsampling task to aggregate metric data.
- Create comprehensive dashboards using Data Studio and your time series data.
This tutorial does not incur any costs on InfluxDB Cloud if you use a Free-tier account.
This tutorial explains how to monitor existing Google Cloud resources but does not require any new resources on Google Cloud.
This tutorial assumes that you have Data Studio, an existing InfluxDB Cloud account, and Telegraf enabled to collect disk usage data.
- Get free access to Data Studio.
- Create a new InfluxDB Cloud account for free.
- Install and configure the Telegraf metrics collection agent to collect monitoring metrics from a local system.
We recommend following the tutorial on Monitoring Google Cloud with InfluxDB templates to set up an InfluxDB Cloud account and configure it to monitor your Google Cloud resources.
-
Create two buckets, named
diskio-usage
anddiskio-usage-1h
.You can also rename an existing bucket or, if you would like to use different bucket names, substitute the
diskio-usage
anddiskio-usage-1h
bucket names throughout this tutorial. -
Generate a new security token to be used in your Data Studio setup: In your InfluxDB Cloud instance, select Load Data > Tokens > Generate Read/Write Token.
The new token only requires read permissions on the bucket where your disk usage data is stored.
We recommend using aggregated source data to avoid performance issues in the Data Studio UI.
The steps in this section show how to define a new task to downsample the disk usage metrics into a new bucket.
InfluxDB uses the Flux functional data scripting language to create data aggregation tasks.
-
In your InfluxDB Cloud instance, select Task > Create Task.
-
Copy the example Flux script below to create a new task for downsampling disk I/O metrics into 1-hour windows:
// option task = {name: "diskio-usage-1h", every: 1h} data = from(bucket: "diskio-usage") |> range(start: -duration(v: int(v: task.every) * 24)) |> filter(fn: (r) => (r["_measurement"] == "diskio")) |> filter(fn: (r) => (r["_field"] == "write_bytes" or r._field == "read_bytes" or r._field == "io_time" or r._field == "iops_in_progress")) data |> aggregateWindow(fn: sum, every: 1h) |> to(bucket: "diskio-usage-1h")
-
Add the following settings to the task definition:
Name = diskio-usage-1h
Schedule Task {Every} = 1h
-
Save the task, and wait for the task status to update to verify that it's running and aggregating data.
When the aggregated time series data is available, you can use it in your Data Studio project.
-
Authorize the Data Studio InfluxDB Community Connector data source to enable a direct connection from Data Studio to InfluxDB Cloud.
-
After authorizing the connector, enter the following connection details in the Data Studio data source wizard to connect with InfluxDB Cloud:
- InfluxDB Cloud URL for your region, such as
https://us-central1-1.gcp.cloud2.influxdata.com
- Token created in the "Configure InfluxDB Cloud" section
- Organization name
- Bucket name:
diskio-usage
ordiskio-usage-1h
depending on whether downsampling was configured - Measurement name:
diskio
- InfluxDB Cloud URL for your region, such as
-
Click Connect to continue.
After you complete the authorization, you see a list of fields available from your measurement, including all tags, fields, and timestamps.
-
Click Create report in Data Studio to start building your charts.
The Data Studio project can use InfluxDB Cloud as a data source for charts. Time series data stored in InfluxDB Cloud can be efficiently queried and combined with other data.
The task created in InfluxDB aggregates data every hour. Querying the aggregated hourly data creates even faster Data Studio reports, especially for longer time ranges.
To avoid incurring charges to your Google Cloud account for the resources used in this tutorial, you can delete the Data Studio InfluxDB Community Connector and remove the task from InfluxDB Cloud.
- Navigate to the Data Studio data sources page.
- In the upper right corner of the the Data Studio InfluxDB Community Connector's card, click More.
- Click Revoke access.
- Follow the instructions to delete the task named
diskio-usage-1h
.
- View the InfluxDB template gallery
- Learn more about Google and InfluxDB
- Learn more about integrating InfluxDB with Data Studio