Skip to content

Commit

Permalink
Docs: Clean up influxdb.md (grafana#20618)
Browse files Browse the repository at this point in the history
* Clean up influxdb.md

Mostly typos, some wording consistency and clarification

* feature-rich

Co-Authored-By: Marcus Olsson <[email protected]>

* Query editor wording

Co-Authored-By: Marcus Olsson <[email protected]>

* Update docs/sources/features/datasources/influxdb.md

Co-Authored-By: Marcus Olsson <[email protected]>

* One less "you can"

Co-Authored-By: Marcus Olsson <[email protected]>

* Query example wording

Co-Authored-By: Marcus Olsson <[email protected]>

* Remove extraneous newline

* Use less words

Co-Authored-By: Marcus Olsson <[email protected]>

* Remove more newlines

* Use present tense

* Add missing 'to'

* Summary fixup

Co-Authored-By: Diana Payton <[email protected]>

* Down with gerunds in headers

Co-Authored-By: Diana Payton <[email protected]>

* consistent tenses

Co-Authored-By: Diana Payton <[email protected]>

* Remove br html tag #1

Co-Authored-By: Diana Payton <[email protected]>

* Remove br html tag #2

Co-Authored-By: Diana Payton <[email protected]>

* Less future tense

Co-Authored-By: Diana Payton <[email protected]>

* Spell out location of annotations view

Co-Authored-By: Diana Payton <[email protected]>

* Query input fixups

Co-Authored-By: Diana Payton <[email protected]>

* More detail on where to access InfluxDB editor

Co-Authored-By: Diana Payton <[email protected]>

* Provisioning fixups

Co-Authored-By: Diana Payton <[email protected]>
  • Loading branch information
ehershey and oddlittlebird committed Nov 27, 2019
1 parent 116b618 commit 5cfc681
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions docs/sources/features/datasources/influxdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ weight = 2

# Using InfluxDB in Grafana

Grafana ships with very feature rich data source plugin for InfluxDB. Supporting a feature rich query editor, annotation and templating queries.
Grafana ships with a feature-rich data source plugin for InfluxDB. The plugin includes a custom query editor and supports annotations and query templates.

## Adding the data source
## Add the data source

1. Open the side menu by clicking the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
Expand Down Expand Up @@ -64,24 +64,24 @@ Identifier | Description

{{< docs-imagebox img="/img/docs/v45/influxdb_query_still.png" class="docs-image--no-shadow" animated-gif="/img/docs/v45/influxdb_query.gif" >}}

You find the InfluxDB editor in the metrics tab in Graph or Singlestat panel's edit mode. You enter edit mode by clicking the
panel title, then edit. The editor allows you to select metrics and tags.
You can access the InfluxDB editor under the metrics tab when you are in the edit mode of the Graph or Singlestat panels.
Enter edit mode by clicking the panel title, and clicking **Edit**. The editor allows you to select metrics and tags.

### Filter data (WHERE)
To add a tag filter click the plus icon to the right of the `WHERE` condition. You can remove tag filters by clicking on
the tag key and select `--remove tag filter--`.
the tag key and then selecting `--remove tag filter--`.

**Regex matching**

You can type in regex patterns for metric names or tag filter values, be sure to wrap the regex pattern in forward slashes (`/`). Grafana
will automatically adjust the filter tag condition to use the InfluxDB regex match condition operator (`=~`).
You can type in regex patterns for metric names or tag filter values. Be sure to wrap the regex pattern in forward slashes (`/`). Grafana automatically adjusts the filter tag condition to use the InfluxDB regex match condition operator (`=~`).

### Field and Aggregation functions
In the `SELECT` row you can specify what fields and functions you want to use. If you have a
group by time you need an aggregation function. Some functions like derivative require an aggregation function. The editor tries simplify and unify this part of the query. For example:<br>
![](/img/docs/influxdb/select_editor.png)<br>
group by time you need an aggregation function. Some functions like derivative require an aggregation function. The editor tries to simplify and unify this part of the query. For example:

The above will generate the following InfluxDB `SELECT` clause:
![](/img/docs/influxdb/select_editor.png)

The above generates the following InfluxDB `SELECT` clause:

```sql
SELECT derivative(mean("value"), 10s) /10 AS "REQ/s" FROM ....
Expand Down Expand Up @@ -203,24 +203,21 @@ be applied to all your InfluxDB queries.

## Annotations

[Annotations]({{< relref "reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation
queries via the Dashboard menu / Annotations view.
[Annotations]({{< relref "reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. Add annotation queries using the Annotations view in the Dashboard menu.

An example query:

```SQL
SELECT title, description from events WHERE $timeFilter ORDER BY time ASC
```

For InfluxDB you need to enter a query like in the above example. You need to have the ```where $timeFilter```
part. If you only select one column you will not need to enter anything in the column mapping fields. The
Tags field can be a comma separated string.
For InfluxDB, you need to enter a query like the one in the example above. The ```where $timeFilter``` component is required. If you only select one column, then you do not need to enter anything in the column mapping fields. The **Tags** field can be a comma-separated string.

## Configure the data source with provisioning

It's now possible to configure data sources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for data sources on the [provisioning docs page](/administration/provisioning/#datasources)
You can now configure data sources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for data sources on the [provisioning docs page](/administration/provisioning/#datasources).

Here are some provisioning examples for this dat asource.
Here are some provisioning examples for this data source.

```yaml
apiVersion: 1
Expand Down

0 comments on commit 5cfc681

Please sign in to comment.