mirror of https://github.com/grafana/grafana
Change metadata of doc topics (#27943)
* Changes. to metadata in Manage users * changes to install section * Added titile * More changes. * Updated administration folder metadata, moved 2 files from installation folder. * Added links to Administration landing page, other metadata changes worked out. * Updated alerting section metadata. * Updated metadata of Auth section. Broke index and created separate Grafana Authentication section. * Added correct weight. * Updated metadata for the Best practices section. * Updated metadata in templates, broke Overview topic. * Updated subment Variable types metadata * Fixed yaml file and H1 description of Variables syntax topic. * Couple more metadata changes. * Added aliases files, as suggested by Diana.pull/27917/head^2
parent
715f0133ee
commit
add777ad40
@ -0,0 +1,125 @@ |
||||
+++ |
||||
title = "Grafana Authentication" |
||||
description = "Grafana OAuthentication Guide " |
||||
keywords = ["grafana", "configuration", "documentation", "oauth"] |
||||
type = "docs" |
||||
[menu.docs] |
||||
name = "GitLab" |
||||
identifier = "grafana-oauth" |
||||
parent = "authentication" |
||||
weight = 100 |
||||
+++ |
||||
|
||||
## Grafana Auth |
||||
|
||||
Grafana of course has a built in user authentication system with password authentication enabled by default. You can |
||||
disable authentication by enabling anonymous access. You can also hide login form and only allow login through an auth |
||||
provider (listed above). There is also options for allowing self sign up. |
||||
|
||||
### Login and short-lived tokens |
||||
|
||||
> The following applies when using Grafana's built in user authentication, LDAP (without Auth proxy) or OAuth integration. |
||||
|
||||
Grafana are using short-lived tokens as a mechanism for verifying authenticated users. |
||||
These short-lived tokens are rotated each `token_rotation_interval_minutes` for an active authenticated user. |
||||
|
||||
An active authenticated user that gets it token rotated will extend the `login_maximum_inactive_lifetime_days` time from "now" that Grafana will remember the user. |
||||
This means that a user can close its browser and come back before `now + login_maximum_inactive_lifetime_days` and still being authenticated. |
||||
This is true as long as the time since user login is less than `login_maximum_lifetime_days`. |
||||
|
||||
#### Remote logout |
||||
|
||||
You can logout from other devices by removing login sessions from the bottom of your profile page. If you are |
||||
a Grafana admin user you can also do the same for any user from the Server Admin / Edit User view. |
||||
|
||||
## Settings |
||||
|
||||
Example: |
||||
|
||||
```bash |
||||
[auth] |
||||
|
||||
# Login cookie name |
||||
login_cookie_name = grafana_session |
||||
|
||||
# The lifetime (days) an authenticated user can be inactive before being required to login at next visit. Default is 7 days. |
||||
login_maximum_inactive_lifetime_days = 7 |
||||
|
||||
# The maximum lifetime (days) an authenticated user can be logged in since login time before being required to login. Default is 30 days. |
||||
login_maximum_lifetime_days = 30 |
||||
|
||||
# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes. |
||||
token_rotation_interval_minutes = 10 |
||||
|
||||
# The maximum lifetime (seconds) an api key can be used. If it is set all the api keys should have limited lifetime that is lower than this value. |
||||
api_key_max_seconds_to_live = -1 |
||||
``` |
||||
|
||||
### Anonymous authentication |
||||
|
||||
You can make Grafana accessible without any login required by enabling anonymous access in the configuration file. |
||||
|
||||
Example: |
||||
|
||||
```bash |
||||
[auth.anonymous] |
||||
enabled = true |
||||
|
||||
# Organization name that should be used for unauthenticated users |
||||
org_name = Main Org. |
||||
|
||||
# Role for unauthenticated users, other valid values are `Editor` and `Admin` |
||||
org_role = Viewer |
||||
``` |
||||
|
||||
If you change your organization name in the Grafana UI this setting needs to be updated to match the new name. |
||||
|
||||
### Basic authentication |
||||
|
||||
Basic auth is enabled by default and works with the built in Grafana user password authentication system and LDAP |
||||
authentication integration. |
||||
|
||||
To disable basic auth: |
||||
|
||||
```bash |
||||
[auth.basic] |
||||
enabled = false |
||||
``` |
||||
|
||||
### Disable login form |
||||
|
||||
You can hide the Grafana login form using the below configuration settings. |
||||
|
||||
```bash |
||||
[auth] |
||||
disable_login_form = true |
||||
``` |
||||
|
||||
### Automatic OAuth login |
||||
|
||||
Set to true to attempt login with OAuth automatically, skipping the login screen. |
||||
This setting is ignored if multiple OAuth providers are configured. |
||||
Defaults to `false`. |
||||
|
||||
```bash |
||||
[auth] |
||||
oauth_auto_login = true |
||||
``` |
||||
|
||||
### Hide sign-out menu |
||||
|
||||
Set the option detailed below to true to hide sign-out menu link. Useful if you use an auth proxy. |
||||
|
||||
```bash |
||||
[auth] |
||||
disable_signout_menu = true |
||||
``` |
||||
|
||||
### URL redirect after signing out |
||||
|
||||
URL to redirect the user to after signing out from Grafana. This can for example be used to enable signout from oauth provider. |
||||
|
||||
```bash |
||||
[auth] |
||||
signout_redirect_url = |
||||
``` |
||||
@ -0,0 +1,28 @@ |
||||
+++ |
||||
title = "Variables syntax and types" |
||||
keywords = ["grafana", "templating", "documentation", "guide", "template", "variable"] |
||||
type = "docs" |
||||
aliases = ["/docs/grafana/latest/reference/templating"] |
||||
[menu.docs] |
||||
identifier = "variables-syntax-types" |
||||
parent = "variables" |
||||
weight = 100 |
||||
+++ |
||||
|
||||
# Variable syntax |
||||
|
||||
Panel titles and metric queries can refer to variables using two different syntaxes: |
||||
|
||||
- `$varname` |
||||
This syntax is easy to read, but it does not allow you to use a variable in the middle of a word. |
||||
**Example:** apps.frontend.$server.requests.count |
||||
- `${var_name}` Use this syntax when you want to interpolate a variable in the middle of an expression. |
||||
- `${var_name:<format>}` This format gives you more control over how Grafana interpolates values. Refer to [Advanced variable format options]({{< relref "advanced-variable-format-options.md" >}}) for more detail on all the formatting types. |
||||
- `[[varname]]` Do not use. Deprecated old syntax, will be removed in a future release. |
||||
|
||||
Before queries are sent to your data source the query is _interpolated_, meaning the variable is replaced with its current value. During |
||||
interpolation, the variable value might be _escaped_ in order to conform to the syntax of the query language and where it is used. |
||||
For example, a variable used in a regex expression in an InfluxDB or Prometheus query will be regex escaped. Read the data source specific |
||||
documentation topic for details on value escaping during interpolation. |
||||
|
||||
For advanced syntax to override data source default formatting, refer to [Advanced variable format options]({{< relref "advanced-variable-format-options.md" >}}). |
||||
@ -1,86 +0,0 @@ |
||||
+++ |
||||
title = "Variables" |
||||
keywords = ["grafana", "templating", "documentation", "guide", "template", "variable"] |
||||
type = "docs" |
||||
aliases = ["/docs/grafana/latest/reference/templating"] |
||||
[menu.docs] |
||||
name = "Templates and variables" |
||||
parent = "variables" |
||||
weight = 100 |
||||
+++ |
||||
|
||||
# Templates and variables |
||||
|
||||
A variable is a placeholder for a value. You can use variables in metric queries and in panel titles. So when you change |
||||
the value, using the drop-down list at the top of the dashboard, your panel's metric queries will change to reflect the new value. |
||||
|
||||
Variables allow you to create more interactive and dynamic dashboards. Instead of hard-coding things like server, application, |
||||
and sensor names in your metric queries, you can use variables in their place. Variables are displayed as drop-down lists at the top of |
||||
the dashboard. These drop-downs make it easy to change the data being displayed in your dashboard. |
||||
|
||||
{{< docs-imagebox img="/img/docs/v50/variables_dashboard.png" >}} |
||||
|
||||
These can be especially useful for administrators who want to allow Grafana viewers to quickly adjust visualizations but do not want to give them full editing permissions. Grafana Viewers can use variables. |
||||
|
||||
Variables and templates also allow you to single-source dashboards. If you have multiple identical data sources or servers, you can make one dashboard and use variables to change what you are viewing. This simplifies maintenance and upkeep enormously. |
||||
|
||||
## Templates |
||||
|
||||
A _template_ is any query that contains a variable. |
||||
|
||||
For example, if you were administering a dashboard to monitor several servers, you _could_ make a dashboard for each server. Or you could create one dashboard and use panels with template queries like this one: |
||||
|
||||
``` |
||||
wmi_system_threads{instance=~"$server"} |
||||
``` |
||||
|
||||
Variable values are always synced to the URL using the syntax `var-<varname>=value`. |
||||
|
||||
## Examples of templates and variables |
||||
|
||||
To see variable and template examples, go to any of the dashboards listed in [Variable examples]({{< relref "variable-examples.md" >}}). |
||||
|
||||
Variables are listed in drop-down lists across the top of the screen. Select different variables to see how the visualizations change. |
||||
|
||||
To see variable settings, navigate to **Dashboard Settings > Variables**. Click a variable in the list to see its settings. |
||||
|
||||
Variables can be used in titles, descriptions, text panels, and queries. Queries with text that starts with `$` are templates. Not all panels will have template queries. |
||||
|
||||
## Variable syntax |
||||
|
||||
Panel titles and metric queries can refer to variables using two different syntaxes: |
||||
|
||||
- `$varname` |
||||
This syntax is easy to read, but it does not allow you to use a variable in the middle of a word. |
||||
**Example:** apps.frontend.$server.requests.count |
||||
- `${var_name}` Use this syntax when you want to interpolate a variable in the middle of an expression. |
||||
- `${var_name:<format>}` This format gives you more control over how Grafana interpolates values. Refer to [Advanced variable format options]({{< relref "advanced-variable-format-options.md" >}}) for more detail on all the formatting types. |
||||
- `[[varname]]` Do not use. Deprecated old syntax, will be removed in a future release. |
||||
|
||||
Before queries are sent to your data source the query is _interpolated_, meaning the variable is replaced with its current value. During |
||||
interpolation, the variable value might be _escaped_ in order to conform to the syntax of the query language and where it is used. |
||||
For example, a variable used in a regex expression in an InfluxDB or Prometheus query will be regex escaped. Read the data source specific |
||||
documentation topic for details on value escaping during interpolation. |
||||
|
||||
For advanced syntax to override data source default formatting, refer to [Advanced variable format options]({{< relref "advanced-variable-format-options.md" >}}). |
||||
|
||||
## Variable types |
||||
|
||||
Grafana uses the following types of variables. |
||||
|
||||
| Variable type | Description | |
||||
|:---|:---| |
||||
| Query | Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on. [Add a query variable]({{< relref "variable-types/add-query-variable.md" >}}). | |
||||
| Custom | Define the variable options manually using a comma-separated list. [Add a custom variable]({{< relref "variable-types/add-custom-variable.md" >}}). | |
||||
| Text box | Display a free text input field with an optional default value. [Add a text box variable]({{< relref "variable-types/add-text-box-variable.md" >}}). | |
||||
| Constant | Define a hidden constant. [Add a constant variable]({{< relref "variable-types/add-constant-variable.md" >}}). | |
||||
| Data source | Quickly change the data source for an entire dashboard. [Add a data source variable]({{< relref "variable-types/add-data-source-variable.md" >}}). | |
||||
| Interval | Interval variables represent time spans. [Add an interval variable]({{< relref "variable-types/add-interval-variable.md" >}}). | |
||||
| Ad hoc filters | Key/value filters that are automatically added to all metric queries for a data source (InfluxDB, Prometheus, and Elasticsearch only). [Add ad hoc filters]({{< relref "variable-types/add-ad-hoc-filters.md" >}}). | |
||||
| Global variables | Built-in variables that can be used in expressions in the query editor. Refer to [Global variables]({{< relref "variable-types/global-variables" >}}). | |
||||
| Chained variables | Variable queries can contain other variables. Refer to [Chained variables]({{< relref "variable-types/chained-variables.md" >}}). | |
||||
|
||||
## Variable best practices |
||||
|
||||
- Variable drop-down lists are displayed in the order they are listed in the variable list in Dashboard settings. |
||||
- Put the variables that you will change often at the top, so they will be shown first (far left on the dashboard). |
||||
Loading…
Reference in new issue