Commit d0ac2584 by bergquist

Merge branch 'master' into alerting_definitions

parents 5bbfe39f 15aeb4ae
Thank you for helping us make Grafana even better! * **I'm submitting a ...**
- [ ] Bug report
- [ ] Feature request
- [ ] Question / Support request: **Please do not** open a github issue. [Support Options](https://grafana.org/support/)
To help us respond to your issues more quickly, please make sure to add as much information as possible. Please include this information:
If this issue is about a plugin, please open the issue in that plugin's repository.
Start your issue's title with [Feature Request] / [Bug] / [Question] or no tag if you're unsure. Also, please be aware that GitHub now supports uploading of screenshots; look at the bottom of this input field.
Please include some basic information:
- What Grafana version are you using? - What Grafana version are you using?
- What datasource are you using? - What datasource are you using?
- What OS are you running grafana on? - What OS are you running grafana on?
...@@ -14,6 +11,7 @@ Please include some basic information: ...@@ -14,6 +11,7 @@ Please include some basic information:
- What was the expected result? - What was the expected result?
- What happenend instead? - What happenend instead?
If your question/bug relates to a metric query / unexpected data visualization, please include: **IMPORTANT** If it realates to metric data viz:
- An image or text representation of your metric query - An image or text representation of your metric query
- The raw query and response from your data source (check this in chrome dev tools network tab) - 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)
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* **Graph**: Adds sort order options for graph tooltip, closes [#1189](https://github.com/grafana/grafana/issues/1189) * **Graph**: Adds sort order options for graph tooltip, closes [#1189](https://github.com/grafana/grafana/issues/1189)
* **Theme**: Add default theme to config file [#5011](https://github.com/grafana/grafana/pull/5011) * **Theme**: Add default theme to config file [#5011](https://github.com/grafana/grafana/pull/5011)
* **Page Footer**: Added page footer with links to docs, shows Grafana version and info if new version is available, closes [#4889](https://github.com/grafana/grafana/pull/4889) * **Page Footer**: Added page footer with links to docs, shows Grafana version and info if new version is available, closes [#4889](https://github.com/grafana/grafana/pull/4889)
* **InfluxDB**: Add spread function, closes [#5211](https://github.com/grafana/grafana/issues/5211)
# 3.0.4 Patch release (2016-05-25) # 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) * **Panel**: Fixed blank dashboard issue when switching to other dashboard while in fullscreen edit mode, fixes [#5163](https://github.com/grafana/grafana/pull/5163)
......
...@@ -143,7 +143,7 @@ cookie_remember_name = grafana_remember ...@@ -143,7 +143,7 @@ cookie_remember_name = grafana_remember
# disable gravatar profile images # disable gravatar profile images
disable_gravatar = false disable_gravatar = false
# data source proxy whitelist (ip_or_domain:port seperated by spaces) # data source proxy whitelist (ip_or_domain:port separated by spaces)
data_source_proxy_whitelist = data_source_proxy_whitelist =
[snapshots] [snapshots]
......
...@@ -129,7 +129,7 @@ check_for_updates = true ...@@ -129,7 +129,7 @@ check_for_updates = true
# disable gravatar profile images # disable gravatar profile images
;disable_gravatar = false ;disable_gravatar = false
# data source proxy whitelist (ip_or_domain:port seperated by spaces) # data source proxy whitelist (ip_or_domain:port separated by spaces)
;data_source_proxy_whitelist = ;data_source_proxy_whitelist =
[snapshots] [snapshots]
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log" "github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
) )
func runCommand(command func(commandLine CommandLine) error) func(context *cli.Context) { func runCommand(command func(commandLine CommandLine) error) func(context *cli.Context) {
...@@ -13,13 +13,13 @@ func runCommand(command func(commandLine CommandLine) error) func(context *cli.C ...@@ -13,13 +13,13 @@ func runCommand(command func(commandLine CommandLine) error) func(context *cli.C
cmd := &contextCommandLine{context} cmd := &contextCommandLine{context}
if err := command(cmd); err != nil { if err := command(cmd); err != nil {
log.Errorf("\n%s: ", color.RedString("Error")) logger.Errorf("\n%s: ", color.RedString("Error"))
log.Errorf("%s\n\n", err) logger.Errorf("%s\n\n", err)
cmd.ShowHelp() cmd.ShowHelp()
os.Exit(1) os.Exit(1)
} else { } else {
log.Info("\nRestart grafana after installing plugins . <service grafana-server restart>\n\n") logger.Info("\nRestart grafana after installing plugins . <service grafana-server restart>\n\n")
} }
} }
} }
......
...@@ -14,9 +14,10 @@ import ( ...@@ -14,9 +14,10 @@ import (
"strings" "strings"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log" "github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
m "github.com/grafana/grafana/pkg/cmd/grafana-cli/models" m "github.com/grafana/grafana/pkg/cmd/grafana-cli/models"
s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services" s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
"github.com/lunny/log"
) )
func validateInput(c CommandLine, pluginFolder string) error { func validateInput(c CommandLine, pluginFolder string) error {
...@@ -78,10 +79,10 @@ func InstallPlugin(pluginName, version string, c CommandLine) error { ...@@ -78,10 +79,10 @@ func InstallPlugin(pluginName, version string, c CommandLine) error {
pluginName, pluginName,
version) version)
log.Infof("installing %v @ %v\n", plugin.Id, version) logger.Infof("installing %v @ %v\n", plugin.Id, version)
log.Infof("from url: %v\n", downloadURL) logger.Infof("from url: %v\n", downloadURL)
log.Infof("into: %v\n", pluginFolder) logger.Infof("into: %v\n", pluginFolder)
log.Info("\n") logger.Info("\n")
err = downloadFile(plugin.Id, pluginFolder, downloadURL) err = downloadFile(plugin.Id, pluginFolder, downloadURL)
if err != nil { if err != nil {
......
package commands package commands
import ( import (
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log" "github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services" s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
) )
...@@ -18,7 +18,7 @@ func listremoteCommand(c CommandLine) error { ...@@ -18,7 +18,7 @@ func listremoteCommand(c CommandLine) error {
pluginVersion = i.Versions[0].Version pluginVersion = i.Versions[0].Version
} }
log.Infof("id: %v version: %s\n", i.Id, pluginVersion) logger.Infof("id: %v version: %s\n", i.Id, pluginVersion)
} }
return nil return nil
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log" "github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
m "github.com/grafana/grafana/pkg/cmd/grafana-cli/models" m "github.com/grafana/grafana/pkg/cmd/grafana-cli/models"
s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services" s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
) )
...@@ -17,7 +17,7 @@ var validateLsCommand = func(pluginDir string) error { ...@@ -17,7 +17,7 @@ var validateLsCommand = func(pluginDir string) error {
return errors.New("missing path flag") return errors.New("missing path flag")
} }
log.Debug("plugindir: " + pluginDir + "\n") logger.Debug("plugindir: " + pluginDir + "\n")
pluginDirInfo, err := s.IoHelper.Stat(pluginDir) pluginDirInfo, err := s.IoHelper.Stat(pluginDir)
if err != nil { if err != nil {
...@@ -40,11 +40,11 @@ func lsCommand(c CommandLine) error { ...@@ -40,11 +40,11 @@ func lsCommand(c CommandLine) error {
plugins := ls_getPlugins(pluginDir) plugins := ls_getPlugins(pluginDir)
if len(plugins) > 0 { if len(plugins) > 0 {
log.Info("installed plugins:\n") logger.Info("installed plugins:\n")
} }
for _, plugin := range plugins { for _, plugin := range plugins {
log.Infof("%s %s %s \n", plugin.Id, color.YellowString("@"), plugin.Info.Version) logger.Infof("%s %s %s \n", plugin.Id, color.YellowString("@"), plugin.Info.Version)
} }
return nil return nil
......
package commands package commands
import ( import (
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log" "github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
m "github.com/grafana/grafana/pkg/cmd/grafana-cli/models" m "github.com/grafana/grafana/pkg/cmd/grafana-cli/models"
s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services" s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
"github.com/hashicorp/go-version" "github.com/hashicorp/go-version"
...@@ -51,7 +51,7 @@ func upgradeAllCommand(c CommandLine) error { ...@@ -51,7 +51,7 @@ func upgradeAllCommand(c CommandLine) error {
} }
for _, p := range pluginsToUpgrade { for _, p := range pluginsToUpgrade {
log.Infof("Updating %v \n", p.Id) logger.Infof("Updating %v \n", p.Id)
s.RemoveInstalledPlugin(pluginsDir, p.Id) s.RemoveInstalledPlugin(pluginsDir, p.Id)
InstallPlugin(p.Id, "", c) InstallPlugin(p.Id, "", c)
......
...@@ -2,7 +2,7 @@ package commands ...@@ -2,7 +2,7 @@ package commands
import ( import (
"github.com/fatih/color" "github.com/fatih/color"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log" "github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services" s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
) )
...@@ -27,6 +27,6 @@ func upgradeCommand(c CommandLine) error { ...@@ -27,6 +27,6 @@ func upgradeCommand(c CommandLine) error {
return InstallPlugin(localPlugin.Id, "", c) return InstallPlugin(localPlugin.Id, "", c)
} }
log.Infof("%s %s is up to date \n", color.GreenString("✔"), localPlugin.Id) logger.Infof("%s %s is up to date \n", color.GreenString("✔"), localPlugin.Id)
return nil return nil
} }
package log package logger
import ( import (
"fmt" "fmt"
......
...@@ -7,7 +7,8 @@ import ( ...@@ -7,7 +7,8 @@ import (
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/commands" "github.com/grafana/grafana/pkg/cmd/grafana-cli/commands"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log" "github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
"github.com/lunny/log"
) )
var version = "master" var version = "master"
...@@ -42,7 +43,7 @@ func isDevenvironment(pwd string) bool { ...@@ -42,7 +43,7 @@ func isDevenvironment(pwd string) bool {
} }
func main() { func main() {
SetupLogging() setupLogging()
app := cli.NewApp() app := cli.NewApp()
app.Name = "Grafana cli" app.Name = "Grafana cli"
...@@ -73,14 +74,14 @@ func main() { ...@@ -73,14 +74,14 @@ func main() {
app.CommandNotFound = cmdNotFound app.CommandNotFound = cmdNotFound
if err := app.Run(os.Args); err != nil { if err := app.Run(os.Args); err != nil {
log.Errorf("%v", err) logger.Errorf("%v", err)
} }
} }
func SetupLogging() { func setupLogging() {
for _, f := range os.Args { for _, f := range os.Args {
if f == "-D" || f == "--debug" || f == "-debug" { if f == "-D" || f == "--debug" || f == "-debug" {
log.SetDebug(true) logger.SetDebug(true)
} }
} }
} }
......
...@@ -7,7 +7,7 @@ import ( ...@@ -7,7 +7,7 @@ import (
"path" "path"
"github.com/franela/goreq" "github.com/franela/goreq"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log" "github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
m "github.com/grafana/grafana/pkg/cmd/grafana-cli/models" m "github.com/grafana/grafana/pkg/cmd/grafana-cli/models"
) )
...@@ -64,7 +64,7 @@ func GetLocalPlugins(pluginDir string) []m.InstalledPlugin { ...@@ -64,7 +64,7 @@ func GetLocalPlugins(pluginDir string) []m.InstalledPlugin {
} }
func RemoveInstalledPlugin(pluginPath, id string) error { func RemoveInstalledPlugin(pluginPath, id string) error {
log.Infof("Removing plugin: %v\n", id) logger.Infof("Removing plugin: %v\n", id)
return IoHelper.RemoveAll(path.Join(pluginPath, id)) return IoHelper.RemoveAll(path.Join(pluginPath, id))
} }
......
...@@ -17,6 +17,10 @@ func Gziper() macaron.Handler { ...@@ -17,6 +17,10 @@ func Gziper() macaron.Handler {
return return
} }
if strings.HasPrefix(requestPath, "/api/plugin-proxy/") {
return
}
ctx.Invoke(macaronGziper) ctx.Invoke(macaronGziper)
} }
} }
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label width-7"> <label class="gf-form-label width-7">
Tags Tags
<info-popover mode="right-normal">Press enter to a add tag</info-popover> <info-popover mode="right-normal">Press enter to add a tag</info-popover>
</label> </label>
<bootstrap-tagsinput ng-model="dashboard.tags" tagclass="label label-tag" placeholder="add tags"> <bootstrap-tagsinput ng-model="dashboard.tags" tagclass="label label-tag" placeholder="add tags">
</bootstrap-tagsinput> </bootstrap-tagsinput>
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
<div ng-show="current.type === 'custom'" class="gf-form-group"> <div ng-show="current.type === 'custom'" class="gf-form-group">
<h5 class="section-heading">Custom Options</h5> <h5 class="section-heading">Custom Options</h5>
<div class="gf-form"> <div class="gf-form">
<span class="gf-form-label width-13">Values seperated by comma</span> <span class="gf-form-label width-13">Values separated by comma</span>
<input type="text" class="gf-form-input" ng-model='current.query' ng-blur="runQuery()" placeholder="1, 10, 20, myvalue"></input> <input type="text" class="gf-form-input" ng-model='current.query' ng-blur="runQuery()" placeholder="1, 10, 20, myvalue"></input>
</div> </div>
</div> </div>
......
...@@ -173,7 +173,7 @@ function (angular, _, kbn) { ...@@ -173,7 +173,7 @@ function (angular, _, kbn) {
return; return;
} }
// extract options in comma seperated string // extract options in comma separated string
variable.options = _.map(variable.query.split(/[,]+/), function(text) { variable.options = _.map(variable.query.split(/[,]+/), function(text) {
return { text: text.trim(), value: text.trim() }; return { text: text.trim(), value: text.trim() };
}); });
......
# CloudWatch Datasource - Native Plugin # Elasticsearch Datasource - Native Plugin
Grafana ships with **advanced support** for Elasticsearch. You can do many types of simple or complex elasticsearch queries to visualize logs or metrics stored in Elasticsearch. You can also annotate your graphs with log events stored in Elasticsearch. Grafana ships with **advanced support** for Elasticsearch. You can do many types of simple or complex elasticsearch queries to visualize logs or metrics stored in Elasticsearch. You can also annotate your graphs with log events stored in Elasticsearch.
......
...@@ -205,7 +205,9 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes ...@@ -205,7 +205,9 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
}; };
function escapeForJson(value) { function escapeForJson(value) {
return value.replace(/\"/g, '\\"'); return value
.replace(/\s/g, '\\ ')
.replace(/\"/g, '\\"');
} }
function luceneThenJsonFormat(value) { function luceneThenJsonFormat(value) {
......
...@@ -153,7 +153,7 @@ export default class InfluxQuery { ...@@ -153,7 +153,7 @@ export default class InfluxQuery {
value = this.templateSrv.replace(value, this.scopedVars); value = this.templateSrv.replace(value, this.scopedVars);
} }
if (operator !== '>' && operator !== '<') { if (operator !== '>' && operator !== '<') {
value = "'" + value.replace('\\', '\\\\') + "'"; value = "'" + value.replace(/\\/g, '\\\\') + "'";
} }
} else if (interpolate){ } else if (interpolate){
value = this.templateSrv.replace(value, this.scopedVars, 'regex'); value = this.templateSrv.replace(value, this.scopedVars, 'regex');
......
...@@ -231,6 +231,15 @@ QueryPartDef.register({ ...@@ -231,6 +231,15 @@ QueryPartDef.register({
}); });
QueryPartDef.register({ QueryPartDef.register({
type: 'spread',
addStrategy: addTransformationStrategy,
category: categories.Transformations,
params: [],
defaultParams: [],
renderer: functionRenderer,
});
QueryPartDef.register({
type: 'non_negative_derivative', type: 'non_negative_derivative',
addStrategy: addTransformationStrategy, addStrategy: addTransformationStrategy,
category: categories.Transformations, category: categories.Transformations,
......
...@@ -16,6 +16,15 @@ describe('InfluxQueryPart', () => { ...@@ -16,6 +16,15 @@ describe('InfluxQueryPart', () => {
expect(part.render('mean(value)')).to.be('derivative(mean(value), 10s)'); expect(part.render('mean(value)')).to.be('derivative(mean(value), 10s)');
}); });
it('should nest spread function', () => {
var part = queryPart.create({
type: 'spread'
});
expect(part.text).to.be('spread()');
expect(part.render('value')).to.be('spread(value)');
});
it('should handle suffirx parts', () => { it('should handle suffirx parts', () => {
var part = queryPart.create({ var part = queryPart.create({
type: 'math', type: 'math',
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
></select> ></select>
</li> </li>
<li class="tight-form-item"> <li class="tight-form-item">
Thresholds<tip>Comma seperated values</tip> Thresholds<tip>Comma separated values</tip>
</li> </li>
<li> <li>
<input type="text" class="input-small tight-form-input" style="width: 150px" ng-model="style.thresholds" ng-blur="editor.render()" placeholder="50,80" array-join></input> <input type="text" class="input-small tight-form-input" style="width: 150px" ng-model="style.thresholds" ng-blur="editor.render()" placeholder="50,80" array-join></input>
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<title>Grafana</title> <title>Grafana</title>
<link rel="stylesheet" href="[[.AppSubUrl]]/css/grafana.dark.min.css" title="Dark"> <link rel="stylesheet" href="[[.AppSubUrl]]/public/css/grafana.dark.min.css" title="Dark">
<link rel="icon" type="image/png" href="[[.AppSubUrl]]/img/fav32.png"> <link rel="icon" type="image/png" href="[[.AppSubUrl]]/public/img/fav32.png">
</head> </head>
......
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