Merge branch 'master' into alerting

This commit is contained in:
Torkel Ödegaard 2016-06-25 09:56:57 -04:00
commit 346ca3fc89
23 changed files with 286 additions and 87 deletions

View File

@ -9,9 +9,9 @@ Please include this information:
- What OS are you running grafana on?
- What did you do?
- What was the expected result?
- What happenend instead?
- What happened instead?
**IMPORTANT** If it realates to metric data viz:
**IMPORTANT** If it relates to metric data viz:
- An image or text representation of your metric query
- The raw query and response for the network request (check this in chrome dev tools network tab, here you can see metric requests and other request, please include the request body and request response)

View File

@ -1,4 +1,4 @@
# 3.1.0 (unreleased)
# 3.1.0-beta1 (2016-06-23)
### Enhancements
* **Dashboard Export/Import**: Dashboard export now templetize data sources and constant variables, users pick these on import, closes [#5084](https://github.com/grafana/grafana/issues/5084)
@ -11,16 +11,16 @@
* **InfluxDB**: Add spread function, closes [#5211](https://github.com/grafana/grafana/issues/5211)
* **Scripts**: Use restart instead of start for deb package script, closes [#5282](https://github.com/grafana/grafana/pull/5282)
* **Logging**: Moved to structured logging lib, and moved to component specific level filters via config file, closes [#4590](https://github.com/grafana/grafana/issues/4590)
* **Search**: Add search limit query parameter, closes [#5292](https://github.com/grafana/grafana/pull/5292)
* **OpenTSDB**: Support nested template variables in tag_values function, closes [4398](https://github.com/grafana/grafana/issues/4398)
* **Datasource**: Pending data source requests are cancelled before new ones are issues (Graphite & Prometheus), closes [5321](https://github.com/grafana/grafana/issues/5321)
### Breaking changes
* **Logging** : Changed default logging output format (now structured into message, and key value pairs, with logger key acting as component). You can also no change in config to json log ouput.
* **Graphite** : The Graph panel no longer have a Graphite PNG option. closes #[5367](https://github.com/grafana/grafana/issues/5367)
* **Graphite** : The Graph panel no longer have a Graphite PNG option. closes [#5367](https://github.com/grafana/grafana/issues/5367)
### Bug fixes
* **PNG rendering**: Fixed phantomjs rendering and y-axis label rotation. fixes #[5220](https://github.com/grafana/grafana/issues/5220)
* **PNG rendering**: Fixed phantomjs rendering and y-axis label rotation. fixes [#5220](https://github.com/grafana/grafana/issues/5220)
* **CLI**: The cli tool now supports reading plugin.json from dist/plugin.json. fixes [#5410](https://github.com/grafana/grafana/issues/5410)
# 3.0.4 Patch release (2016-05-25)
* **Panel**: Fixed blank dashboard issue when switching to other dashboard while in fullscreen edit mode, fixes [#5163](https://github.com/grafana/grafana/pull/5163)

View File

@ -251,7 +251,7 @@ templates_pattern = emails/*.html
# Use space to separate multiple modes, e.g. "console file"
mode = console, file
# Either "trace", "debug", "info", "warn", "error", "critical", default is "info"
# Either "debug", "info", "warn", "error", "critical", default is "info"
level = info
# For "console" mode only

View File

@ -14,10 +14,10 @@ LoadPlugin interface
LoadPlugin uptime
LoadPlugin swap
LoadPlugin write_graphite
<Plugin cpu>
ReportByCpu {{ REPORT_BY_CPU | default("false") }}
</Plugin>
LoadPlugin processes
LoadPlugin aggregation
LoadPlugin match_regex
# LoadPlugin memcached
<Plugin df>
# expose host's mounts into container using -v /:/host:ro (location inside container does not matter much)
@ -46,6 +46,9 @@ LoadPlugin write_graphite
ReportByDevice false
ReportReserved true
ReportInodes true
ValuesAbsolute true
ValuesPercentage true
ReportInodes true
</Plugin>
<Plugin "disk">
@ -53,6 +56,15 @@ LoadPlugin write_graphite
IgnoreSelected false
</Plugin>
<Plugin "aggregation">
<Aggregation>
Plugin "cpu"
Type "cpu"
GroupBy "Host"
GroupBy "TypeInstance"
CalculateAverage true
</Aggregation>
</Plugin>
<Plugin interface>
Interface "lo"
@ -61,6 +73,24 @@ LoadPlugin write_graphite
IgnoreSelected true
</Plugin>
# <Plugin "memcached">
# Host "memcached"
# Port "11211"
# </Plugin>
<Chain "PostCache">
<Rule>
<Match regex>
Plugin "^cpu$"
PluginInstance "^[0-9]+$"
</Match>
<Target write>
Plugin "aggregation"
</Target>
Target stop
</Rule>
Target "write"
</Chain>
<Plugin "write_graphite">
<Carbon>

View File

@ -9,3 +9,4 @@ collectd:
COLLECT_INTERVAL: 10
links:
- graphite
- memcached

View File

@ -0,0 +1,5 @@
memcached:
image: memcached:latest
ports:
- "11211:11211"

View File

@ -6,6 +6,12 @@ prometheus:
volumes:
- /var/docker/prometheus:/prometheus-data
node_exporter:
image: prom/node-exporter
net: bridge
ports:
- "9100:9100"
fake-prometheus-data:
image: grafana/fake-data-gen
net: bridge

View File

@ -23,4 +23,4 @@ scrape_configs:
# scheme defaults to 'http'.
target_groups:
- targets: ['localhost:9090', '172.17.0.1:9091']
- targets: ['localhost:9090', '172.17.0.1:9091', '172.17.0.1:9100', '172.17.0.1:9150']

View File

@ -1 +1 @@
3.0.0
3.1.0

View File

@ -45,6 +45,7 @@ pages:
- ['guides/basic_concepts.md', 'User Guides', 'Basic Concepts']
- ['guides/gettingstarted.md', 'User Guides', 'Getting Started']
- ['guides/whats-new-in-v3-1.md', 'User Guides', "What's New in Grafana v3.1"]
- ['guides/whats-new-in-v3.md', 'User Guides', "What's New in Grafana v3.0"]
- ['guides/whats-new-in-v2-6.md', 'User Guides', "What's New in Grafana v2.6"]
- ['guides/whats-new-in-v2-5.md', 'User Guides', "What's New in Grafana v2.5"]

View File

@ -0,0 +1,68 @@
---
page_title: What's New in Grafana v3.1
page_description: What's new in Grafana v3.1
page_keywords: grafana, new, changes, features, documentation
---
# What's New in Grafana v3.1
## Dashboard Export & Import
The export feature is now accessed from the share menu.
<img src="/img/v31/export_menu.png">
Dashboards exported from Grafana 3.1 are now more portable and easier for others to import than before.
The export process extracts information data source types used by panels and adds these to a new `inputs`
section in the dashboard json. So when you or another person tries to import the dashboard they will be asked to
select data source and optional metrix prefix options.
<img src="/img/v31/import_step1.png">
The above screenshot shows the new import modal that gives you 3 options for how to import a dashboard.
One notable new addition here is the ability to import directly from Dashboards shared on [Grafana.net](https://grafana.net).
The next step in the import process:
<img src="/img/v31/import_step2.png">
Here you can change the name of the dashboard and also pick what data sources you want the dashboard to use. The above screenshot
shows a CollectD dashboard for Graphite that requires a metric prefix be specified.
## Discover Dashboards
On [Grafana.net](https://grafana.net) you can now browse & search for dashboards. We have already added a few but
more are being uploaded every day. To import a dashboard just copy the dashboard url and head back to Grafana,
then Dashboard Search -> Import -> Paste Grafana.net Dashboard URL.
<img src="/img/v31/gnet_dashboards_list.png">
## Constant template variables
We added a new template variable named constant that makes it easier to share and export dashboard that have custom prefixes.
## Dashboard Urls
Having current time range and template variable value always sync with the URL makes it possible to always copy your current
Grafana url to share with a colleague without having to use the Share modal.
## Internal metrics
Do you want metrics about viewing metrics? Ofc you do! In this release we added support for sending metrics about Grafana to graphite.
You can configure interval and server in the config file.
## Logging
Switched logging framework to log15 to enable key value per logging and filtering based on different log levels.
Its now possible to configure different log levels for different modules.
### Breaking changes
- **Logging** format have been changed to improve log filtering.
- **Graphite PNG** Graphite PNG support dropped from Graph panel (use Grafana native PNG instead).
- **Migration** No longer possible to migrate dashboards from 1.x (Stored in ES or Influx 0.8).
## CHANGELOG
For a detailed list and link to github issues for everything included
in the 3.1 release please view the
[CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md)
file.

View File

@ -446,6 +446,19 @@ Grafana backend index those json dashboards which will make them appear in regul
### path
The full path to a directory containing your json dashboards.
## [log]
### mode
Either "console", "file", "syslog". Default is console and file
Use space to separate multiple modes, e.g. "console file"
### level
Either "debug", "info", "warn", "error", "critical", default is "info"
### filter
optional settings to set different levels for specific loggers.
Ex `filters = sqlstore:debug`
## [metrics]
### enabled

View File

@ -10,7 +10,8 @@ page_keywords: grafana, installation, debian, ubuntu, guide
Description | Download
------------ | -------------
Stable .deb for Debian-based Linux | [grafana_3.0.4-1464167696.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.4-1464167696_amd64.deb)
Stable .deb for Debian-based Linux | [3.0.4](https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.4-1464167696_amd64.deb)
Beta .deb for Debian-based Linux | [3.1.0-beta1](https://grafanarel.s3.amazonaws.com/builds/grafana_3.1.0-1466666977beta1_amd64.deb)
## Install Stable
@ -18,6 +19,12 @@ Stable .deb for Debian-based Linux | [grafana_3.0.4-1464167696.deb](https://graf
$ sudo apt-get install -y adduser libfontconfig
$ sudo dpkg -i grafana_3.0.4-1464167696_amd64.deb
## Install 3.1 beta
$ wget https://grafanarel.s3.amazonaws.com/builds/grafana_3.1.0-1466666977beta1_amd64.deb
$ sudo apt-get install -y adduser libfontconfig
$ sudo dpkg -i grafana_3.1.0-1466666977beta1_amd64.deb
## APT Repository
Add the following line to your `/etc/apt/sources.list` file.

View File

@ -10,9 +10,10 @@ page_keywords: grafana, installation, centos, fedora, opensuse, redhat, guide
Description | Download
------------ | -------------
Stable .RPM for CentOS / Fedora / OpenSuse / Redhat Linux | [grafana-3.0.4-1464167696.x86_64.rpm](https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.4-1464167696.x86_64.rpm)
Stable .RPM for CentOS / Fedora / OpenSuse / Redhat Linux | [3.0.4 (x86-64 rpm)](https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.4-1464167696.x86_64.rpm)
Beta .RPM for CentOS / Fedora / OpenSuse / Redhat Linux | [3.1.0-beta1 (x86-64 rpm)](https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.0-1466666977beta1.x86_64.rpm)
## Install Stable Release from package file
## Install Latest Stable
You can install Grafana using Yum directly.
@ -29,6 +30,23 @@ Or install manually using `rpm`.
$ sudo rpm -i --nodeps grafana-3.0.4-1464167696.x86_64.rpm
## Install 3.1 Beta
You can install Grafana using Yum directly.
$ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.0-1466666977beta1.x86_64.rpm
Or install manually using `rpm`.
#### On CentOS / Fedora / Redhat:
$ sudo yum install initscripts fontconfig
$ sudo rpm -Uvh https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.0-1466666977beta1.x86_64.rpm
#### On OpenSuse:
$ sudo rpm -i --nodeps https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.0-1466666977beta1.x86_64.rpm
## Install via YUM Repository
Add the following to a new file at `/etc/yum.repos.d/grafana.repo`

View File

@ -40,3 +40,10 @@ as the name for the fields that should be used for the annotation title, tags an
For InfluxDB you need to enter a query like in the above screenshot. 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.
## Prometheus Annotations
![](/img/v3/annotations_prom.png)
Prometheus supports two ways to query annotations.
- A regular metric query
- A Prometheus query for pending and firing alerts (for details see [Inspecting alerts during runtime](https://prometheus.io/docs/alerting/rules/#inspecting-alerts-during-runtime))

View File

@ -8,78 +8,97 @@ page_keywords: grafana, export, import, documentation
## Exporting a dashboard
Dashboards are exported in Grafana JSON format, and contain everything you need (layout, variables, styles, data sources, queries, etc)to import the dashboard at a later time.
Dashboards are exported in Grafana JSON format, and contain everything you need (layout, variables, styles, data sources, queries, etc)to import the dashboard at a later time.
#### Export to file
The export feature is accessed from the share menu.
To export a dashboard, locate the settings menu within the desired dashboard and click the gear icon. The export option will always be available, and will open a browser save-as dialog window.
<img src="/img/v31/export_menu.png">
<img class="no-shadow" src="/img/v2/export.gif">
### Making a dashboard portable
#### Copy JSON
If you want to export a dashboard for others to use then it could be a good idea to
add template variables for things like a metric prefix (use contant variable) and server name.
The raw JSON may be accessed directly from within the interface and copy/pasted into an editor of your choice to be saved later. To view this JSON, locate the settings menu within the desired dashboard and click the gear icon. The View JSON option will always be available, and will open the raw JSON in a text area. To copy the entire JSON file, click into the text area, the select all `CTRL`+`A` (PC, Linux) or `⌘`+`A` (Mac).
<img class="no-shadow" src="/img/v2/export-2.gif">
A template varible of the type `Constant` will automatically be hidden in
the dashboard, and will also be added as an required input when the dashboard is imported.
## Importing a dashboard
Grafana 2.0 now has integrated dashboard storage engine that can be configured to use an internal sqlite3 database, MySQL, or Postgres. This eliminates the need to use Elasticsearch for dashboard storage for Graphite users. Grafana 2.0 does not support storing dashboards in InfluxDB.
To import a dashboard open dashboard search and then hit the import button.
The import view can be found at the Dashboard Picker dropdown, next to the New Dashboard and Playlist buttons.
<img src="/img/v31/import_step1.png">
<img class="no-shadow" src="/img/v2/import.gif">
From here you can upload a dashboard json file, paste a [Grafana.net](https://grafana.net) dashboard
url or paste dashboard json text directly into the text area.
<img src="/img/v31/import_step2.png">
#### Import from a file
In step 2 of the import process Grafana will let you change the name of the dashboard, pick what
data source you want the dashboard to use and specify any metric prefixes (if the dashboard use any).
To import a dashboard through a local JSON file, click the 'Choose file' button in the Import from File section. Note that JSON is not linted or validated prior during upload, so we recommend validating locally if you're editing. In a pinch, you can use http://jsonlint.com/, and if you are editing dashboard JSON frequently, there are linter plugins for popular text editors.
## Discover dashboards on Grafana.net
Find dashboads for common server applications at [Grafana.net/dashboards](https://grafana.net/dashboards).
#### Importing dashboards from Elasticsearch
<img src="/img/v31/gnet_dashboards_list.png">
Start by going to the `Data Sources` view (via the side menu), and make sure your Elasticsearch data source is added. Specify the Elasticsearch index name where your existing Grafana v1.x dashboards are stored (the default is `grafana-dash`).
## Import & Sharing with Grafana 2.x or 3.0
![](/img/v2/datasource_edit_elastic.jpg)
Dashboards on Grafana.net use a new feature in Grafana 3.1 that allows the import process
to update each panel so that they are using a data source of your choosing. If you are running a
Grafana version older than 3.1 then you might need to do some manual steps either
before or after import in order for the dashboard to work properly.
#### Importing dashboards from InfluxDB
Dashboards exported from Grafana 3.1+ have a new json section `__inputs`
that define what data sources and metric prefixes the dashboard uses.
Start by going to the `Data Sources` view (via the side menu), and make sure your InfluxDB data source is added. Specify the database name where your Grafana v1.x dashboards are stored, the default is `grafana`.
Example:
```json
{
"__inputs": [
{
"name": "DS_GRAPHITE",
"label": "graphite",
"description": "",
"type": "datasource",
"pluginId": "graphite",
"pluginName": "Graphite"
},
{
"name": "VAR_PREFIX",
"type": "constant",
"label": "prefix",
"value": "collectd",
"description": ""
}
],
}
### Import view
```
In the Import view you find the section `Migrate dashboards`. Pick the data source you added (from Elasticsearch or InfluxDB), and click the `Import` button.
These are then referenced in the dashboard panels like this:
![](/img/v2/migrate_dashboards.jpg)
```json
{
"rows": [
{
"panels": [
{
"type": "graph",
"datasource": "${DS_GRAPHITE}",
}
]
}
]
}
```
Your dashboards should be automatically imported into the Grafana 2.0 back-end. Dashboards will no longer be stored in your previous Elasticsearch or InfluxDB databases.
These inputs and their usage in data source properties are automatically added during export in Grafana 3.1.
If you run an older version of Grafana and want to share a dashboard on Grafana.net you need to manually
add the inputs and templatize the datasource properties like above.
If you want to import a dashboard from Grafana.net into an older version of Grafana then you can either import
it as usual and then update the data source option in the metrics tab so that the panel is using the correct
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.
## Troubleshooting
### Template variables could not be initialized.
When importing a dashboard, keep an eye out for template variables in your JSON that may not exist in your instance of Grafana. For example,
"templating": {
"list": [
{
"allFormat": "glob",
"current": {
"tags": [],
"text": "google_com + monkey_id_au",
"value": [
"google_com",
"monkey_id_au"
]
},
"datasource": null,
To resolve this, remove any unnecessary JSON that may be specific to the instance you are exporting from. In this case, we can remove the entire "current" section entirely, and Grafana will populate default.
"templating": {
"list": [
{
"allFormat": "glob",
"datasource": null,

View File

@ -1,3 +1,4 @@
<li><a class='version' href='/v3.1'>Version v3.1</a></li>
<li><a class='version' href='/v3.0'>Version v3.0</a></li>
<li><a class='version' href='/v2.6'>Version v2.6</a></li>
<li><a class='version' href='/v2.5'>Version v2.5</a></li>

View File

@ -4,7 +4,7 @@
"company": "Coding Instinct AB"
},
"name": "grafana",
"version": "3.1.0",
"version": "3.2.0-pre1",
"repository": {
"type": "git",
"url": "http://github.com/grafana/grafana.git"

View File

@ -1,20 +1,20 @@
#! /usr/bin/env bash
deb_ver=3.0.4-1464167696
rpm_ver=3.0.4-1464167696
deb_ver=3.1.0-1466666977beta1
rpm_ver=3.1.0-1466666977beta1
wget https://grafanarel.s3.amazonaws.com/builds/grafana_${deb_ver}_amd64.deb
# wget https://grafanarel.s3.amazonaws.com/builds/grafana_${deb_ver}_amd64.deb
package_cloud push grafana/stable/debian/jessie grafana_${deb_ver}_amd64.deb
package_cloud push grafana/stable/debian/wheezy grafana_${deb_ver}_amd64.deb
# package_cloud push grafana/stable/debian/jessie grafana_${deb_ver}_amd64.deb
# package_cloud push grafana/stable/debian/wheezy grafana_${deb_ver}_amd64.deb
package_cloud push grafana/testing/debian/jessie grafana_${deb_ver}_amd64.deb
package_cloud push grafana/testing/debian/wheezy grafana_${deb_ver}_amd64.deb
wget https://grafanarel.s3.amazonaws.com/builds/grafana-${rpm_ver}.x86_64.rpm
# wget https://grafanarel.s3.amazonaws.com/builds/grafana-${rpm_ver}.x86_64.rpm
package_cloud push grafana/testing/el/6 grafana-${rpm_ver}.x86_64.rpm
package_cloud push grafana/testing/el/7 grafana-${rpm_ver}.x86_64.rpm
package_cloud push grafana/stable/el/7 grafana-${rpm_ver}.x86_64.rpm
package_cloud push grafana/stable/el/6 grafana-${rpm_ver}.x86_64.rpm
# package_cloud push grafana/stable/el/7 grafana-${rpm_ver}.x86_64.rpm
# package_cloud push grafana/stable/el/6 grafana-${rpm_ver}.x86_64.rpm

View File

@ -48,13 +48,10 @@ var pluginCommands = []cli.Command{
Usage: "list all installed plugins",
Action: runCommand(lsCommand),
}, {
Name: "uninstall",
Usage: "uninstall <plugin id>",
Action: runCommand(removeCommand),
}, {
Name: "remove",
Usage: "remove <plugin id>",
Action: runCommand(removeCommand),
Name: "uninstall",
Aliases: []string{"remove"},
Usage: "uninstall <plugin id>",
Action: runCommand(removeCommand),
},
}

View File

@ -33,11 +33,23 @@ func ListAllPlugins(repoUrl string) (m.PluginRepo, error) {
}
func ReadPlugin(pluginDir, pluginName string) (m.InstalledPlugin, error) {
pluginDataPath := path.Join(pluginDir, pluginName, "plugin.json")
pluginData, _ := IoHelper.ReadFile(pluginDataPath)
distPluginDataPath := path.Join(pluginDir, pluginName, "dist", "plugin.json")
var data []byte
var err error
data, err = IoHelper.ReadFile(distPluginDataPath)
if err != nil {
pluginDataPath := path.Join(pluginDir, pluginName, "plugin.json")
data, err = IoHelper.ReadFile(pluginDataPath)
if err != nil {
return m.InstalledPlugin{}, errors.New("Could not find dist/plugin.json or plugin.json on " + pluginName + " in " + pluginDir)
}
}
res := m.InstalledPlugin{}
json.Unmarshal(pluginData, &res)
json.Unmarshal(data, &res)
if res.Info.Version == "" {
res.Info.Version = "0.0.0"

View File

@ -1,8 +1,9 @@
define([
'jquery',
'lodash',
'moment'
],
function($, _) {
function($, _, moment) {
'use strict';
var kbn = {};
@ -580,6 +581,18 @@ function($, _) {
}
};
kbn.toDuration = function(size, timeScale) {
return moment.duration(size, timeScale);
};
kbn.valueFormats.dtdurationms = function(size) {
return kbn.toDuration(size, 'ms').humanize();
};
kbn.valueFormats.dtdurations = function(size) {
return kbn.toDuration(size, 's').humanize();
};
///// FORMAT MENU /////
kbn.getUnitFormats = function() {
@ -616,6 +629,8 @@ function($, _) {
{text: 'minutes (m)', value: 'm' },
{text: 'hours (h)', value: 'h' },
{text: 'days (d)', value: 'd' },
{text: 'duration (ms)', value: 'dtdurationms' },
{text: 'duration (s)', value: 'dtdurations' }
]
},
{

View File

@ -71,7 +71,6 @@ export class DashboardCtrl {
};
$scope.broadcastRefresh = function() {
$rootScope.performance.panelsRendered = 0;
$rootScope.$broadcast('refresh');
};