mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'master' of https://github.com/grafana/grafana
This commit is contained in:
@@ -45,8 +45,11 @@ can still show them if you add a new **Annotation Query** and filter by tags. Bu
|
||||
### Query by tag
|
||||
|
||||
You can create new annotation queries that fetch annotations from the native annotation store via the `-- Grafana --` data source and by setting *Filter by* to `Tags`. Specify at least
|
||||
one tag. For example create an annotation query name `outages` and specify a tag named `outage`. This query will show all annotations you create (from any dashboard or via API) that
|
||||
have the `outage` tag.
|
||||
one tag. For example create an annotation query name `outages` and specify a tag named `outage`. This query will show all annotations you create (from any dashboard or via API) that have the `outage` tag. By default, if you add multiple tags in the annotation query, Grafana will only show annotations that have all the tags you supplied. You can invert the behavior by enabling `Match any` which means that Grafana will show annotations that contains at least one of the tags you supplied.
|
||||
|
||||
In Grafana v5.3+ it's possible to use template variables in the tag query. So if you have a dashboard showing stats for different services and a template variable that dictates which services to show, you can now use the same template variable in your annotation query to only show annotations for those services.
|
||||
|
||||
{{< docs-imagebox img="/img/docs/v53/annotation_tag_filter_variable.png" max-width="600px" >}}
|
||||
|
||||
## Querying other data sources
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ When a user creates a new dashboard, a new dashboard JSON object is initialized
|
||||
"list": []
|
||||
},
|
||||
"refresh": "5s",
|
||||
"schemaVersion": 16,
|
||||
"schemaVersion": 17,
|
||||
"version": 0,
|
||||
"links": []
|
||||
}
|
||||
|
||||
@@ -107,3 +107,5 @@ it as usual and then update the data source option in the metrics tab so that th
|
||||
data source. Another alternative is to open the json file in a a text editor and update the data source properties
|
||||
to value that matches a name of your data source.
|
||||
|
||||
## Note
|
||||
In Grafana v5.3.4+ the export modal has new checkbox for sharing for external use (other instances). If the checkbox is not checked then the `__inputs` section will not be included in the exported JSON file.
|
||||
|
||||
@@ -12,7 +12,7 @@ weight = 9
|
||||
|
||||
If you have lots of metric names that change (new servers etc) in a defined pattern it is irritating to constantly have to create new dashboards.
|
||||
|
||||
With scripted dashboards you can dynamically create your dashboards using javascript. In the folder grafana install folder
|
||||
With scripted dashboards you can dynamically create your dashboards using javascript. In the grafana install folder
|
||||
under `public/dashboards/` there is a file named `scripted.js`. This file contains an example of a scripted dashboard. You can access it by using the url:
|
||||
`http://grafana_url/dashboard/script/scripted.js?rows=3&name=myName`
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ the value, using the dropdown at the top of the dashboard, your panel's metric q
|
||||
|
||||
Panel titles and metric queries can refer to variables using two different syntaxes:
|
||||
|
||||
- `$<varname>` Example: apps.frontend.$server.requests.count
|
||||
- `$varname` Example: apps.frontend.$server.requests.count
|
||||
- `[[varname]]` Example: apps.frontend.[[server]].requests.count
|
||||
|
||||
Why two ways? The first syntax is easier to read and write but does not allow you to use a variable in the middle of word. Use
|
||||
@@ -91,6 +91,7 @@ Type | Description
|
||||
*Custom* | Define the variable options manually using a comma separated list.
|
||||
*Constant* | Define a hidden constant. Useful for metric path prefixes for dashboards you want to share. During dashboard export, constant variables will be made into an import option.
|
||||
*Ad hoc filters* | Very special kind of variable that only works with some data sources, InfluxDB & Elasticsearch currently. It allows you to add key/value filters that will automatically be added to all metric queries that use the specified data source.
|
||||
*Text box* | This variable type will display as a free text input field with an optional default value.
|
||||
|
||||
### Query options
|
||||
|
||||
@@ -246,7 +247,7 @@ Grafana has global built-in variables that can be used in expressions in the que
|
||||
|
||||
### The $__interval Variable
|
||||
|
||||
This $__interval variable is similar to the `auto` interval variable that is described above. It can be used as a parameter to group by time (for InfluxDB), Date histogram interval (for Elasticsearch) or as a *summarize* function parameter (for Graphite).
|
||||
This $__interval variable is similar to the `auto` interval variable that is described above. It can be used as a parameter to group by time (for InfluxDB, MySQL, Postgres, MSSQL), Date histogram interval (for Elasticsearch) or as a *summarize* function parameter (for Graphite).
|
||||
|
||||
Grafana automatically calculates an interval that can be used to group by time in queries. When there are more data points than can be shown on a graph then queries can be made more efficient by grouping by a larger interval. It is more efficient to group by 1 day than by 10s when looking at 3 months of data and the graph will look the same and the query will be faster. The `$__interval` is calculated using the time range and the width of the graph (the number of pixels).
|
||||
|
||||
@@ -292,9 +293,11 @@ The `direction` controls how the panels will be arranged.
|
||||
|
||||
By choosing `horizontal` the panels will be arranged side-by-side. Grafana will automatically adjust the width
|
||||
of each repeated panel so that the whole row is filled. Currently, you cannot mix other panels on a row with a repeated
|
||||
panel. Each panel will never be smaller that the provided `Min width` if you have many selected values.
|
||||
panel.
|
||||
|
||||
By choosing `vertical` the panels will be arranged from top to bottom in a column. The `Min width` doesn't have any effect in this case. The width of the repeated panels will be the same as of the first panel (the original template) being repeated.
|
||||
Set `Max per row` to tell grafana how many panels per row you want at most. It defaults to *4* if you don't set anything.
|
||||
|
||||
By choosing `vertical` the panels will be arranged from top to bottom in a column. The width of the repeated panels will be the same as of the first panel (the original template) being repeated.
|
||||
|
||||
Only make changes to the first panel (the original template). To have the changes take effect on all panels you need to trigger a dynamic dashboard re-build.
|
||||
You can do this by either changing the variable value (that is the basis for the repeat) or reload the dashboard.
|
||||
|
||||
Reference in New Issue
Block a user