Commit 15027221 by Diana Payton Committed by GitHub

Docs: Add FAQcontent (#27139)

* update content

* updated content

* update content

* Update graphite.md
parent b54c0b5d
...@@ -12,7 +12,7 @@ weight = 2 ...@@ -12,7 +12,7 @@ weight = 2
Before you create your first dashboard, you need to add your data source. Following are the list of instructions to create one. Before you create your first dashboard, you need to add your data source. Following are the list of instructions to create one.
> Only users with the Admin role can add data sources. > **Note:** Only users with the organization Admin role can add data sources.
1. Move your cursor to the cog on the side menu which will show you the configuration menu. If the side menu is not visible click the Grafana icon in the upper left corner. Click on **Configuration** > **Data Sources** in the side menu and you'll be taken to the data sources page 1. Move your cursor to the cog on the side menu which will show you the configuration menu. If the side menu is not visible click the Grafana icon in the upper left corner. Click on **Configuration** > **Data Sources** in the side menu and you'll be taken to the data sources page
where you can add and edit data sources. You can also click the cog. where you can add and edit data sources. You can also click the cog.
......
...@@ -17,92 +17,125 @@ Grafana has an advanced Graphite query editor that lets you quickly navigate the ...@@ -17,92 +17,125 @@ Grafana has an advanced Graphite query editor that lets you quickly navigate the
change function parameters and much more. The editor can handle all types of graphite queries. It can even handle complex nested change function parameters and much more. The editor can handle all types of graphite queries. It can even handle complex nested
queries through the use of query references. queries through the use of query references.
## Adding the data source Refer to [Add a data source]({{< relref "add-a-data-source.md" >}}) for instructions on how to add a data source to Grafana. Only organization admins can add data sources.
1. Open the side menu by clicking the Grafana icon in the top header. ## Graphite settings
2. In the side menu under the `Configuration` link you should find a link named `Data Sources`.
3. Click the `+ Add data source` button in the top header.
4. Select `Graphite` from the *Type* dropdown.
> NOTE: If you're not seeing the `Data Sources` link in your side menu it means that your current user does not have the `Admin` role for the current organization. To access Graphite settings, hover your mouse over the **Configuration** (gear) icon, then click **Data Sources**, and then click the Graphite data source.
Name | Description Name | Description
------------ | ------------- ------------ | -------------
*Name* | The data source name. This is how you refer to the data source in panels and queries. Name | The data source name. This is how you refer to the data source in panels and queries.
*Default* | Default data source means that it will be pre-selected for new panels. Default | Default data source means that it will be pre-selected for new panels.
*Url* | The HTTP protocol, IP, and port of your graphite-web or graphite-api install. URL | The HTTP protocol, IP, and port of your graphite-web or graphite-api install.
*Access* | Server (default) = URL needs to be accessible from the Grafana backend/server, Browser = URL needs to be accessible from the browser. Access | Server (default) = URL needs to be accessible from the Grafana backend/server, Browser = URL needs to be accessible from the browser.
Auth | Refer to [Authentication]({{< relref "../../auth/_index.md" >}}) for more information.
Access mode controls how requests to the data source will be handled. Server should be the preferred way if nothing else stated. Basic Auth | Enable basic authentication to the data source.
User | User name for basic authentication.
### Server access mode (Default) Password | Password for basic authentication.
Custom HTTP Headers | Click **Add header** to add a custom HTTP header.
All requests will be made from the browser to Grafana backend/server which in turn will forward the requests to the data source and by that circumvent possible Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the grafana backend/server if you select this access mode. Header | Enter the custom header name.
Value | Enter the custom header value.
Graphite details |
Version | Select your version of Graphite.
Type | Select your type of Graphite.
Access mode controls how requests to the data source will be handled. Server should be the preferred way if nothing else is stated.
### Server access mode (default)
All requests will be made from the browser to Grafana backend/server which in turn will forward the requests to the data source and by that circumvent possible Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the Grafana backend/server if you select this access mode.
### Browser access mode ### Browser access mode
All requests will be made from the browser directly to the data source and may be subject to Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this access mode. All requests will be made from the browser directly to the data source and may be subject to Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this access mode.
## Metric editor ## Graphite query editor
Grafana includes a Graphite-specific query editor to help you build your queries.
### Navigate metric segments To see the raw text of the query that is sent to Graphite, click the **Toggle text edit mode** (pencil) icon.
Click the ``Select metric`` link to start navigating the metric space. Once you start you can continue using the mouse ### Choose metrics to query
or keyboard arrow keys. You can select a wildcard and still continue.
{{< docs-imagebox img="/img/docs/v45/graphite_query1_still.png" Click **Select metric** to start navigating the metric space. Once you start, you can continue using the mouse or keyboard arrow keys. You can select a wildcard and still continue.
animated-gif="/img/docs/v45/graphite_query1.gif" >}}
{{< docs-imagebox img="/img/docs/graphite/graphite-query-editor-still.png"
animated-gif="/img/docs/graphite/graphite-query-editor.gif" >}}
### Functions ### Functions
Click the plus icon to the right to add a function. You can search for the function or select it from the menu. Once Click the plus icon next to **Function** to add a function. You can search for the function or select it from the menu. Once
a function is selected it will be added and your focus will be in the text box of the first parameter. To later change a function is selected, it will be added and your focus will be in the text box of the first parameter.
a parameter just click on it and it will turn into a text box. To delete a function click the function name followed - To edit or change a parameter, click on it and it will turn into a text box.
by the x icon. - To delete a function, click the function name followed by the x icon.
{{< docs-imagebox img="/img/docs/v45/graphite_query2_still.png" {{< docs-imagebox img="/img/docs/graphite/graphite-functions-still.png"
animated-gif="/img/docs/v45/graphite_query2.gif" >}} animated-gif="/img/docs/graphite/graphite-functions-demo.gif" >}}
### Optional parameters Some functions like aliasByNode support an optional second argument. To add an argument, hover your mouse over the first argument and then click the `+` symbol that appears. To remove the second optional parameter, click on it and leave it blank and the editor will remove it.
Some functions like aliasByNode support an optional second argument. To add this parameter specify for example 3,-2 as the first parameter and the function editor will adapt and move the -2 to a second parameter. To remove the second optional parameter just click on it and leave it blank and the editor will remove it. ### Sort labels
{{< docs-imagebox img="/img/docs/v45/graphite_query3_still.png" If you want consistent ordering, use sortByName. This can be particularly annoying when you have the same labels on multiple graphs, and they are both sorted differently and using different colors. To fix this, use `sortByName()`.
animated-gif="/img/docs/v45/graphite_query3.gif" >}}
### Nested Queries ### Nested queries
You can reference queries by the row “letter” that they’re on (similar to Microsoft Excel). If you add a second query to a graph, you can reference the first query simply by typing in #A. This provides an easy and convenient way to build compounded queries. You can reference queries by the row “letter” that they’re on (similar to Microsoft Excel). If you add a second query to a graph, you can reference the first query simply by typing in #A. This provides an easy and convenient way to build compounded queries.
{{< docs-imagebox img="/img/docs/v45/graphite_nested_queries_still.png" ### Avoiding many queries by using wildcards
animated-gif="/img/docs/v45/graphite_nested_queries.gif" >}}
Occasionally one would like to see multiple time series plotted on the same graph. For example we might want to see how the CPU is being utilized on a machine. You might
initially create the graph by adding a query for each time series, such as `cpu.percent.user.g`,
`cpu.percent.system.g`, and so on. This results in *n* queries made to the data source, which is inefficient.
To be more efficient one can use wildcards in your search, returning all the time series in one query. For example, `cpu.percent.*.g`.
### Modify the metric name in my tables or charts
Use `alias` functions to change metric names on Grafana tables or graphs For example `aliasByNode()` or `aliasSub()`.
## Point consolidation ## Point consolidation
All Graphite metrics are consolidated so that Graphite doesn't return more data points than there are pixels in the graph. By default, All Graphite metrics are consolidated so that Graphite doesn't return more data points than there are pixels in the graph. By default,
this consolidation is done using `avg` function. You can control how Graphite consolidates metrics by adding the Graphite consolidateBy function. this consolidation is done using `avg` function. You can control how Graphite consolidates metrics by adding the Graphite consolidateBy function.
> *Notice* This means that legend summary values (max, min, total) cannot be all correct at the same time. They are calculated > **Note:** This means that legend summary values (max, min, total) cannot all be correct at the same time. They are calculated
> client side by Grafana. And depending on your consolidation function only one or two can be correct at the same time. > client-side by Grafana. And depending on your consolidation function, only one or two can be correct at the same time.
## Combine time series
To combine time series, click **Combine** in the **Functions** list.
## Data exploration and tags
In Graphite, _everything_ is a tag.
When exploring data, previously-selected tags are used to filter the remaining result set. To select data, you use the
`seriesByTag` function, which takes tag expressions (`=`, `!=`, `=~`, `!=~`) to filter timeseries.
The Grafana query builder does this for you automatically when you select a tag.
> **Tip:** The regular expression search can be quite slow on high-cardinality tags, so try to use other tags to reduce the scope first.
Starting off with a particular name/namespace can help reduce the results.
## Templating ## Template variables
Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place. Instead of hard-coding things like server, application, and sensor name in your metric queries, you can use variables in their place.
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data Variables are shown as drop-down select boxes at the top of the dashboard. These dropdowns make it easy to change the data
being displayed in your dashboard. being displayed in your dashboard.
Check out the [Templating]({{< relref "../../variables/templates-and-variables.md" >}}) documentation for an introduction to the templating feature and the different For more information, refer to [Variables and templates]({{< relref "../../variables/templates-and-variables.md" >}}).
types of template variables.
Graphite 1.1 introduced tags and Grafana added support for Graphite queries with tags in version 5.0. To create a variable using tag values, then you need to use the Grafana functions `tags` and `tag_values`. Graphite 1.1 introduced tags and Grafana added support for Graphite queries with tags in version 5.0. To create a variable using tag values, use the Grafana functions `tags` and `tag_values`.
Query | Description Query | Description
------------ | ------------- ------------ | -------------
*tags()* | Returns all tags. tags() | Returns all tags.
*tags(server=~backend\*)* | Returns only tags that occur in series matching the filter expression. tags(server=~backend\*) | Returns only tags that occur in series matching the filter expression.
*tag_values(server)* | Return tag values for the specified tag. tag_values(server) | Return tag values for the specified tag.
*tag_values(server, server=~backend\*)* | Returns filtered tag values that occur for the specified tag in series matching those expressions. tag_values(server, server=~backend\*) | Returns filtered tag values that occur for the specified tag in series matching those expressions.
*tag_values(server, server=~backend\*, app=~${apps:regex})* | Multiple filter expressions and expressions can contain other variables. tag_values(server, server=~backend\*, app=~${apps:regex}) | Multiple filter expressions and expressions can contain other variables.
For more details, see the [Graphite docs on the autocomplete API for tags](http://graphite.readthedocs.io/en/latest/tags.html#auto-complete-support). For more details, see the [Graphite docs on the autocomplete API for tags](http://graphite.readthedocs.io/en/latest/tags.html#auto-complete-support).
...@@ -114,7 +147,7 @@ variable with all possible values that exist in the wildcard position. ...@@ -114,7 +147,7 @@ variable with all possible values that exist in the wildcard position.
You can also create nested variables that use other variables in their definition. For example You can also create nested variables that use other variables in their definition. For example
`apps.$app.servers.*` uses the variable `$app` in its query definition. `apps.$app.servers.*` uses the variable `$app` in its query definition.
#### Using `__searchFilter` to filter results in Query Variable #### Using `__searchFilter` to filter query variable results
> Available from Grafana 6.5 and above > Available from Grafana 6.5 and above
Using `__searchFilter` in the query field will filter the query result based on what the user types in the dropdown select box. Using `__searchFilter` in the query field will filter the query result based on what the user types in the dropdown select box.
...@@ -132,7 +165,7 @@ TagValues ...@@ -132,7 +165,7 @@ TagValues
tag_values(server, server=~${__searchFilter:regex}) tag_values(server, server=~${__searchFilter:regex})
``` ```
### Variable Usage ### Variable usage
You can use a variable in a metric node path or as a parameter to a function. You can use a variable in a metric node path or as a parameter to a function.
![variable](/img/docs/v2/templated_variable_parameter.png) ![variable](/img/docs/v2/templated_variable_parameter.png)
...@@ -148,7 +181,7 @@ the second syntax in expressions like `my.server${serverNumber}.count`. ...@@ -148,7 +181,7 @@ the second syntax in expressions like `my.server${serverNumber}.count`.
Example: Example:
[Graphite Templated Dashboard](https://play.grafana.org/dashboard/db/graphite-templated-nested) [Graphite Templated Dashboard](https://play.grafana.org/dashboard/db/graphite-templated-nested)
### Variable Usage in Tag Queries ### Variable usage in tag queries
Multi-value variables in tag queries use the advanced formatting syntax introduced in Grafana 5.0 for variables: `{var:regex}`. Non-tag queries will use the default glob formatting for multi-value variables. Multi-value variables in tag queries use the advanced formatting syntax introduced in Grafana 5.0 for variables: `{var:regex}`. Non-tag queries will use the default glob formatting for multi-value variables.
...@@ -158,7 +191,7 @@ Example of a tag expression with regex formatting and using the Equal Tilde oper ...@@ -158,7 +191,7 @@ Example of a tag expression with regex formatting and using the Equal Tilde oper
server=~${servers:regex} server=~${servers:regex}
``` ```
Check out the [Advanced Formatting Options section in the Variables]({{< relref "../../variables/templates-and-variables.md#advanced-formatting-options" >}}) documentation for examples and details. For more information, refer to [Advanced variable format options]({{< relref "../../variables/advanced-variable-format-options.md" >}}).
## Annotations ## Annotations
...@@ -168,7 +201,7 @@ queries via the Dashboard menu / Annotations view. ...@@ -168,7 +201,7 @@ queries via the Dashboard menu / Annotations view.
Graphite supports two ways to query annotations. A regular metric query, for this you use the `Graphite query` textbox. A Graphite events query, use the `Graphite event tags` textbox, Graphite supports two ways to query annotations. A regular metric query, for this you use the `Graphite query` textbox. A Graphite events query, use the `Graphite event tags` textbox,
specify a tag or wildcard (leave empty should also work) specify a tag or wildcard (leave empty should also work)
## Getting Grafana metrics into Graphite ## Get Grafana metrics into Graphite
Grafana exposes metrics for Graphite on the `/metrics` endpoint. For detailed instructions, refer to [Internal Grafana metrics]({{< relref "../../administration/metrics.md">}}). Grafana exposes metrics for Graphite on the `/metrics` endpoint. For detailed instructions, refer to [Internal Grafana metrics]({{< relref "../../administration/metrics.md">}}).
......
...@@ -12,11 +12,11 @@ weight = 1 ...@@ -12,11 +12,11 @@ weight = 1
# Prometheus data source # Prometheus data source
Grafana includes built-in support for Prometheus. This topic explains options, variables, querying, and other options specific to the Prometheus data source. Refer to [Add a data source]({{< relref "add-a-data-source.md" >}}) for instructions on how to add a data source to Grafana. Grafana includes built-in support for Prometheus. This topic explains options, variables, querying, and other options specific to the Prometheus data source. Refer to [Add a data source]({{< relref "add-a-data-source.md" >}}) for instructions on how to add a data source to Grafana. Only users with the organization admin role can add data sources.
## Prometheus settings ## Prometheus settings
To access Prometheus settings, click the **Configuration** (gear) icon, then click **Data Sources**, and then click **Prometheus**. To access Prometheus settings, hover your mouse over the **Configuration** (gear) icon, then click **Data Sources**, and then click the Prometheus data source.
| Name | Description | | Name | Description |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
......
...@@ -51,7 +51,7 @@ Use these settings to change the appearance of the tooltip that appears when you ...@@ -51,7 +51,7 @@ Use these settings to change the appearance of the tooltip that appears when you
- **Mode** - **Mode**
- **All series -** The hover tooltip shows all series in the graph. Grafana highlights the series that you are hovering over in bold in the series list in the tooltip. - **All series -** The hover tooltip shows all series in the graph. Grafana highlights the series that you are hovering over in bold in the series list in the tooltip.
- **Single -** The hover tooltip shows only a single series, the one that you are hovering over on the graph. - **Single -** The hover tooltip shows only a single series, the one that you are hovering over on the graph.
- **Sort order -** Sorts the order of series in the hover tooltip if you have selected *All series* mode. - **Sort order -** Sorts the order of series in the hover tooltip if you have selected **All series** mode. When you hover your cursor on a graph, Grafana displays the values associated with the lines. Generally users are most interested in the highest or lowest values. Sorting these values can make it much easier to find the data of interest.
- **None -** The order of the series in the tooltip is determined by the sort order in your query. For example, they could be alphabetically sorted by series name. - **None -** The order of the series in the tooltip is determined by the sort order in your query. For example, they could be alphabetically sorted by series name.
- **Increasing -** The series in the hover tooltip are sorted by value and in increasing order, with the lowest value at the top of the list. - **Increasing -** The series in the hover tooltip are sorted by value and in increasing order, with the lowest value at the top of the list.
- **Decreasing -** The series in the hover tooltip are sorted by value and in decreasing order, with the highest value at the top of the list. - **Decreasing -** The series in the hover tooltip are sorted by value and in decreasing order, with the highest value at the top of the list.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment