Merge pull request #1941 from influxdata/notebooks

Notebooks early access docs
pull/1955/head
noramullen1 2020-12-07 16:01:25 -08:00 committed by GitHub
commit 368bd37d7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 286 additions and 3 deletions

View File

@ -0,0 +1,26 @@
---
title: Notebooks
seotitle: Build notebooks in InfluxDB Cloud
description: >
Use notebooks to build and annotate processes and data flows for time series data.
menu:
influxdb_cloud:
name: Notebooks
weight: 6
---
{{% note %}}
**Notebooks is currently an early access feature.**
[Submit a request](https://w2.influxdata.com/notebooks-early-access/) for early access, and we'll send you a confirmation notebooks is available in your account.
{{% /note %}}
Notebooks are a way to build and annotate processes and data flows for time series data. Using notebooks, you can:
- Create documents with live code, equations, visualizations, and explanatory notes.
- Create dashbaord cells or scheduled tasks.
- Clean and downsample data.
- Build runbooks.
- Document data processing steps.
To learn how to use notebooks, check out the following articles:
{{< children >}}

View File

@ -0,0 +1,44 @@
---
title: Normalize data with notebooks
description: >
Clean, standardize, or normalize you data to make it easier to compare with other measurements.
weight: 102
influxdb/cloud/tags:
menu:
influxdb_cloud:
name: Normalize data with notebooks
parent: Notebooks
---
{{% note %}}
**Notebooks is currently an early access feature.**
[Submit a request](https://w2.influxdata.com/notebooks-early-access/) for early access, and we'll send you a confirmation notebooks is available in your account.
{{% /note %}}
Learn how to create a notebook that normalizes data. Walk through the following example to create a notebook that does the following:
- Inputs sample data from NOAA
- Normalizes sample data with a Flux script
- Outputs normalized data to a bucket
## Requirements
- This example uses [NOAA water database data](/influxdb/v2.0/reference/sample-data/#noaa-water-sample-data). Note that using this data counts towards your total usage.
- Create a destination bucket to write normalized data to. For details, see [Create a bucket](/influxdb/cloud/organizations/buckets/create-bucket/).
## Normalize data with a notebook
1. Create a new notebook (see [Create a notebook](/influxdb/cloud/notebooks/create-notebook/).
2. Add a **Metric Selector** cell to select a bucket to query data from:
- In the **Choose a bucket** dropdown, select your NOAA bucket.
- Select the **h2o_temperature** field.
- Select the **mean** function from the aggregate selector in the upper-right.
3. Add a **Flux Transformation** cell with the following script to bring in data from the previous cell and normalize it:
```sh
__PREVIOUS_RESULT__
|> map(fn: (r) => ({ r with _value: float(v: r._value) / 10.0 }))
```
4. Add an **Output to Bucket** cell:
- Select the destination bucket for your normalized data.
5. Add a **Markdown** cell to add a note to your team about what this notebook does. For example, the cell might say, "This notebook makes `h20_temperature` easier to view alongside `water_level`."
5. Click **Preview** in the upper left to verify that your notebook runs and preview the output.
6. Run your notebook:
- Click **Run** to run the notebook and write to the output bucket a single time.
- To write continuously, click **Export as Task** in the upper right corner of the **Output to Bucket** cell. For details about working with tasks, see [Manage tasks](/influxdb/cloud/process-data/manage-tasks/).

View File

@ -0,0 +1,61 @@
---
title: Create a notebook
description: >
Create a notebook to explore, visualize, and process your data.
weight: 102
influxdb/cloud/tags:
menu:
influxdb_cloud:
name: Create a notebook
parent: Notebooks
---
{{% note %}}
**Notebooks is currently an early access feature.**
[Submit a request](https://w2.influxdata.com/notebooks-early-access/) for early access, and we'll send you a confirmation notebooks is available in your account.
{{% /note %}}
Create a notebook to explore, visualize, and process your data.
This guide walks through the basics of creating a notebook. For specific examples, see the following:
- [Downsample data](/influxdb/cloud/notebooks/downsample/)
- [Normalize data](/influxdb/cloud/notebooks/normalize/)
## Create a new notebook
1. In the navigation menu on the left, click **Notebooks**.
{{< nav-icon "notebooks" >}}
2. Click **+Create Notebook**.
3. Enter a name for your notebook in the **Name this notebook** field.
4. By default, a **Metric Selector** and **Visualization** cell appear (see [Cell types](#cell-types) below for details.)
5. Click the **+** icon to add a cell. See [Cell types](#cell-types) below for details on each type of cell.
6. Click **Preview** to preview the results of each cell in a raw data table without writing any data.
7. Click the dropdown menu next to **Preview** and select **Run** to show the results of each cell and write it to the specified output bucket.
7. Click the eye icon to hide a cell.
## Cell types
Notebooks are comprised of different cells. Add one or more of the following cell types to your notebook:
- **Input: Metric Selector**:
- Choose a bucket to define your data source.
- Edit your time range with the time range option in the dropdown menu.
- Add filters to narrow your data.
- **Transform: Flux Script**:
- Use `__PREVIOUS_RESULT__` to build from data in the previous cell.
- Enter a Flux script to transform your data.
- **Pass-through: Markdown**: Enter explanatory notes or other information for yourself or one of your team members in Markdown.
- **Pass-through: Visualization**:
- Create a visualization of your data. For details on available visualization types and how to use them, see [Visualization types](/influxdb/cloud/visualize-data/visualization-types/).
- Click **Export to Dashboard** in the upper right to send your cell to a new or existing dashboard.
- **Output: Output to Bucket**: Write data to a bucket. Click **Run** in the upper left to write a single time, or select **Export as Task** to schedule your output as a task.
## Notebook controls
The following options appear in the upper right of each notebook.
### Presentation mode
Toggle the **Presentation** option to enter presentation mode. Use presentation mode to view notebooks in full screen, hiding the left and top navigation menus so only the cells appear. This mode might be helpful, for example, for stationary screens dedicated to monitoring visualizations.
### Time range
Select from the options in the dropdown list or select **Custom Time Range** to enter a custom time range with precision up to nanoseconds.
### Timezone
Click the timezone dropdown list to select a timezone to use for the dashboard. Select either the local time (default) or UTC.

View File

@ -0,0 +1,49 @@
---
title: Downsample data with notebooks
description: >
Downsample data to reduce overall disk usage as data collects over time.
weight: 102
influxdb/cloud/tags:
menu:
iinfluxdb_cloud:
name: Downsample data with notebooks
parent: Notebooks
---
{{% note %}}
**Notebooks is currently an early access feature.**
[Submit a request](https://w2.influxdata.com/notebooks-early-access/) for early access, and we'll send you a confirmation notebooks is available in your account.
{{% /note %}}
Downsample data to reduce the overall disk usage as data collects over time. over time.
Learn how to create a notebook that downsamples data—walk through the following example to create a notebook that does the following:
- Inputs InfluxDB Cloud demo data from the Website Monitoring Bucket
- Downsamples data by aggregating data within windows of time with a Flux script
- Outputs downsampled data to a bucket.
## Requirements
- This example uses [InfluxDB Cloud demo data](/influxdb/cloud/reference/sample-data/#influxdb-cloud-demo-data).
- Create a destination bucket to write downsampled data to. For details, see [Create a bucket](/influxdb/cloud/organizations/buckets/create-bucket/).
## Downsample data with a notebook
1. Create a new notebook (see [Create a notebook](/influxdb/cloud/notebooks/create-notebook/)).
2. Add a **Metric Selector** cell to select a bucket to query data from:
- In the **Choose a bucket** dropdown list, select **Website Monitoring Bucket**.
- Select the **response_time** field.
- Select the **mean** function from the aggregate selector in the upper-right.
3. Add a **Flux Script** cell with the following script to bring in data from the previous cell and downsample it:
```sh
__PREVIOUS_RESULT__
|> aggregateWindow(fn: mean, every: 1h)
```
{{% note %}}
If the `every` duration is longer the the total time range queried, aggregateWindow will only return one value.
{{% /note %}}
4. Add an **Output to Bucket** cell, and then select the destination bucket for your downsampled data.
5. Add a **Markdown** cell to add a note to your team about what this notebook does. For example, the cell might say, "Downsample to one value per hour so we can do week-over-week performance. Sending data to downsample bucket."
5. Click **Preview** in the upper left to verify that your notebook runs and preview the output.
6. Run your notebook:
- Click **Run** from the **Preview** dropdown list to run the notebook and write to the output bucket a single time.
- To write continuously, click **Export as Task** in the upper right corner of the **Output to Bucket** cell. For details about working with tasks, see [Manage tasks](/influxdb/cloud/process-data/manage-tasks/).

View File

@ -0,0 +1,33 @@
---
title: Manage notebooks
description: View, update, and delete notebooks.
weight: 102
influxdb/cloud/tags:
menu:
influxdb_cloud:
name: Manage notebooks
parent: Notebooks
---
{{% note %}}
**Notebooks is currently an early access feature.**
[Submit a request](https://w2.influxdata.com/notebooks-early-access/) for early access, and we'll send you a confirmation notebooks is available in your account.
{{% /note %}}
View, update, and delete notebooks in the UI.
## View or update notebooks
1. In the navigation menu on the left, click **Notebooks**.
{{< nav-icon "notebooks" >}}
A list of notebooks appears.
2. Click a notebook to open it.
3. To update, edit the notebook's cells and content. Changes are saved automatically.
## Delete a notebook
1. In the navigation menu on the left, click **Notebooks**.
{{< nav-icon "notebooks" >}}
2. Hover over a notebook in the list that appears.
3. Click **Delete Notebook**.
4. Click **Confirm**.

View File

@ -0,0 +1,23 @@
---
title: Troubleshoot notebooks
description: Common issues with the notebooks feature.
weight: 102
influxdb/cloud/tags:
menu:
influxdb_cloud:
name: Troubleshoot notebooks
parent: Notebooks
---
{{% note %}}
**Notebooks is currently an early access feature.**
[Submit a request](https://w2.influxdata.com/notebooks-early-access/) for early access, and we'll send you a confirmation notebooks is available in your account.
{{% /note %}}
### No measurements appear in my bucket even though there's data in it.
Try changing the time range. You might have measurements prior to the time range you selected. For example, if the selected time range is `Past 1h` and the last write happened 16 hours ago, you'd need to change the time range to `Past 24h` (or more) to see your data.
### "No bucket exists" error message appears.
This error appears when the Buckets API endpoint returns a list of bucket and you dont have access to that bucket. Verify that you have access permissions to the bucket that you're trying to query or write to
### Metric selector crashes.
This can occur with high cardinality buckets when there's too much data for the browser. To decrease the amount of data in your bucket, see how to [resolve high series cardinality](/influxdb/cloud/write-data/best-practices/resolve-high-cardinality/).

View File

@ -52,3 +52,35 @@ to query and analyze the geo-temporal data in this sample data set.
</a> </a>
_Used in [Work with geo-temporal data](/influxdb/cloud/query-data/flux/geo/)._ _Used in [Work with geo-temporal data](/influxdb/cloud/query-data/flux/geo/)._
### NOAA water sample data
This data set is publicly available data from the [National Oceanic and Atmospheric Administrations (NOAA) Center for Operational Oceanographic Products and Services](http://tidesandcurrents.noaa.gov/stations.html).
[The CSV data](https://influx-testdata.s3.amazonaws.com/noaa.csv) includes 15,258
observations of water levels (ft) collected every six minutes at two stations
(Santa Monica, CA (ID 9410840) and Coyote Creek, CA (ID 9414575)) over the period
from August 18, 2015 through September 18, 2015.
To avoid having to re-download this 10MB dataset every time you run a query,
we recommend that you [create a new bucket](/influxdb/cloud/organizations/buckets/create-bucket/)
(`noaa`) and write the NOAA data to it.
We also recommend updating the timestamps of the data to be relative to `now()`.
To do so, run the following:
```js
import "experimental/csv"
relativeToNow = (tables=<-) =>
tables
|> elapsed()
|> sort(columns: ["_time"], desc: true)
|> cumulativeSum(columns: ["elapsed"])
|> map(fn: (r) => ({ r with _time: time(v: int(v: now()) - (r.elapsed * 1000000000))}))
csv.from(url: "https://influx-testdata.s3.amazonaws.com/noaa.csv")
|> relativeToNow()
|> to(bucket: "noaa", org: "example-org")
```
_Used in [Common queries](/influxdb/cloud/query-data/common-queries/) and [Common tasks](/influxdb/cloud/process-data/common-tasks/)._

View File

@ -48,15 +48,30 @@ _Used in [Work with geo-temporal data](/influxdb/v2.0/query-data/flux/geo/)._
This data set is publicly available data from the [National Oceanic and Atmospheric Administrations (NOAA) Center for Operational Oceanographic Products and Services](http://tidesandcurrents.noaa.gov/stations.html). This data set is publicly available data from the [National Oceanic and Atmospheric Administrations (NOAA) Center for Operational Oceanographic Products and Services](http://tidesandcurrents.noaa.gov/stations.html).
[The CSV data](https://influx-testdata.s3.amazonaws.com/noaa.csv) includes 15,258 observations of water levels (ft) collected every six minutes at two stations (Santa Monica, CA (ID 9410840) and Coyote Creek, CA (ID 9414575)) over the period from August 18, 2015 through September 18, 2015. [The CSV data](https://influx-testdata.s3.amazonaws.com/noaa.csv) includes 15,258
observations of water levels (ft) collected every six minutes at two stations
(Santa Monica, CA (ID 9410840) and Coyote Creek, CA (ID 9414575)) over the period
from August 18, 2015 through September 18, 2015.
To avoid having to re-download this 10MB dataset every time you run a query, we recommend that you [create a new bucket](/influxdb/v2.0/organizations/buckets/create-bucket/) (`noaa`) and write the NOAA data to it. To do so, run the following: To avoid having to re-download this 10MB dataset every time you run a query,
we recommend that you [create a new bucket](/influxdb/v2.0/organizations/buckets/create-bucket/)
(`noaa`) and write the NOAA data to it.
We also recommend updating the timestamps of the data to be relative to `now()`.
To do so, run the following:
```js ```js
import "experimental/csv" import "experimental/csv"
relativeToNow = (tables=<-) =>
tables
|> elapsed()
|> sort(columns: ["_time"], desc: true)
|> cumulativeSum(columns: ["elapsed"])
|> map(fn: (r) => ({ r with _time: time(v: int(v: now()) - (r.elapsed * 1000000000))}))
csv.from(url: "https://influx-testdata.s3.amazonaws.com/noaa.csv") csv.from(url: "https://influx-testdata.s3.amazonaws.com/noaa.csv")
|> to(bucket: "noaa", org: "your-org") |> relativeToNow()
|> to(bucket: "noaa", org: "example-org")
``` ```
_Used in [Common queries](/influxdb/v2.0/query-data/common-queries/) and [Common tasks](/influxdb/v2.0/process-data/common-tasks/)._ _Used in [Common queries](/influxdb/v2.0/query-data/common-queries/) and [Common tasks](/influxdb/v2.0/process-data/common-tasks/)._