diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index e53a1159941..a4935b4afd7 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,12 +1,9 @@ -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. - -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: +Please include this information: - What Grafana version are you using? - What datasource are you using? - What OS are you running grafana on? @@ -14,6 +11,7 @@ Please include some basic information: - What was the expected result? - 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 -- 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) + diff --git a/CHANGELOG.md b/CHANGELOG.md index 323aaaecac2..b3b6371b324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * **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) * **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) * **Panel**: Fixed blank dashboard issue when switching to other dashboard while in fullscreen edit mode, fixes [#5163](https://github.com/grafana/grafana/pull/5163) diff --git a/conf/defaults.ini b/conf/defaults.ini index 88849949869..cab41df4eda 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -143,7 +143,7 @@ cookie_remember_name = grafana_remember # disable gravatar profile images 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 = [snapshots] diff --git a/conf/sample.ini b/conf/sample.ini index 7f358b07199..822d1770169 100644 --- a/conf/sample.ini +++ b/conf/sample.ini @@ -129,7 +129,7 @@ check_for_updates = true # disable gravatar profile images ;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 = [snapshots] diff --git a/pkg/cmd/grafana-cli/commands/commands.go b/pkg/cmd/grafana-cli/commands/commands.go index ec454078f9b..06e8dd16d21 100644 --- a/pkg/cmd/grafana-cli/commands/commands.go +++ b/pkg/cmd/grafana-cli/commands/commands.go @@ -5,7 +5,7 @@ import ( "github.com/codegangsta/cli" "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) { @@ -13,13 +13,13 @@ func runCommand(command func(commandLine CommandLine) error) func(context *cli.C cmd := &contextCommandLine{context} if err := command(cmd); err != nil { - log.Errorf("\n%s: ", color.RedString("Error")) - log.Errorf("%s\n\n", err) + logger.Errorf("\n%s: ", color.RedString("Error")) + logger.Errorf("%s\n\n", err) cmd.ShowHelp() os.Exit(1) } else { - log.Info("\nRestart grafana after installing plugins . \n\n") + logger.Info("\nRestart grafana after installing plugins . \n\n") } } } diff --git a/pkg/cmd/grafana-cli/commands/install_command.go b/pkg/cmd/grafana-cli/commands/install_command.go index eb5973d07be..9a5ee96560e 100644 --- a/pkg/cmd/grafana-cli/commands/install_command.go +++ b/pkg/cmd/grafana-cli/commands/install_command.go @@ -14,9 +14,10 @@ import ( "strings" "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" s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services" + "github.com/lunny/log" ) func validateInput(c CommandLine, pluginFolder string) error { @@ -78,10 +79,10 @@ func InstallPlugin(pluginName, version string, c CommandLine) error { pluginName, version) - log.Infof("installing %v @ %v\n", plugin.Id, version) - log.Infof("from url: %v\n", downloadURL) - log.Infof("into: %v\n", pluginFolder) - log.Info("\n") + logger.Infof("installing %v @ %v\n", plugin.Id, version) + logger.Infof("from url: %v\n", downloadURL) + logger.Infof("into: %v\n", pluginFolder) + logger.Info("\n") err = downloadFile(plugin.Id, pluginFolder, downloadURL) if err != nil { diff --git a/pkg/cmd/grafana-cli/commands/listremote_command.go b/pkg/cmd/grafana-cli/commands/listremote_command.go index 0f0c3077ab9..c4de82a985d 100644 --- a/pkg/cmd/grafana-cli/commands/listremote_command.go +++ b/pkg/cmd/grafana-cli/commands/listremote_command.go @@ -1,7 +1,7 @@ package commands 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" ) @@ -18,7 +18,7 @@ func listremoteCommand(c CommandLine) error { 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 diff --git a/pkg/cmd/grafana-cli/commands/ls_command.go b/pkg/cmd/grafana-cli/commands/ls_command.go index 796f6e500d1..212188caf5a 100644 --- a/pkg/cmd/grafana-cli/commands/ls_command.go +++ b/pkg/cmd/grafana-cli/commands/ls_command.go @@ -5,7 +5,7 @@ import ( "fmt" "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" s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services" ) @@ -17,7 +17,7 @@ var validateLsCommand = func(pluginDir string) error { return errors.New("missing path flag") } - log.Debug("plugindir: " + pluginDir + "\n") + logger.Debug("plugindir: " + pluginDir + "\n") pluginDirInfo, err := s.IoHelper.Stat(pluginDir) if err != nil { @@ -40,11 +40,11 @@ func lsCommand(c CommandLine) error { plugins := ls_getPlugins(pluginDir) if len(plugins) > 0 { - log.Info("installed plugins:\n") + logger.Info("installed plugins:\n") } 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 diff --git a/pkg/cmd/grafana-cli/commands/upgrade_all_command.go b/pkg/cmd/grafana-cli/commands/upgrade_all_command.go index 7f088be3e14..19e9ff45504 100644 --- a/pkg/cmd/grafana-cli/commands/upgrade_all_command.go +++ b/pkg/cmd/grafana-cli/commands/upgrade_all_command.go @@ -1,7 +1,7 @@ package commands 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" s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services" "github.com/hashicorp/go-version" @@ -51,7 +51,7 @@ func upgradeAllCommand(c CommandLine) error { } for _, p := range pluginsToUpgrade { - log.Infof("Updating %v \n", p.Id) + logger.Infof("Updating %v \n", p.Id) s.RemoveInstalledPlugin(pluginsDir, p.Id) InstallPlugin(p.Id, "", c) diff --git a/pkg/cmd/grafana-cli/commands/upgrade_command.go b/pkg/cmd/grafana-cli/commands/upgrade_command.go index e788b3bdfaa..2a6f5bd0f37 100644 --- a/pkg/cmd/grafana-cli/commands/upgrade_command.go +++ b/pkg/cmd/grafana-cli/commands/upgrade_command.go @@ -2,7 +2,7 @@ package commands import ( "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" ) @@ -27,6 +27,6 @@ func upgradeCommand(c CommandLine) error { 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 } diff --git a/pkg/cmd/grafana-cli/log/log.go b/pkg/cmd/grafana-cli/logger/logger.go similarity index 97% rename from pkg/cmd/grafana-cli/log/log.go rename to pkg/cmd/grafana-cli/logger/logger.go index c8222d60c81..de98a6f147b 100644 --- a/pkg/cmd/grafana-cli/log/log.go +++ b/pkg/cmd/grafana-cli/logger/logger.go @@ -1,4 +1,4 @@ -package log +package logger import ( "fmt" diff --git a/pkg/cmd/grafana-cli/main.go b/pkg/cmd/grafana-cli/main.go index b9549e00c1a..01a15f87fb3 100644 --- a/pkg/cmd/grafana-cli/main.go +++ b/pkg/cmd/grafana-cli/main.go @@ -7,7 +7,8 @@ import ( "github.com/codegangsta/cli" "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" @@ -42,7 +43,7 @@ func isDevenvironment(pwd string) bool { } func main() { - SetupLogging() + setupLogging() app := cli.NewApp() app.Name = "Grafana cli" @@ -73,14 +74,14 @@ func main() { app.CommandNotFound = cmdNotFound 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 { if f == "-D" || f == "--debug" || f == "-debug" { - log.SetDebug(true) + logger.SetDebug(true) } } } diff --git a/pkg/cmd/grafana-cli/services/services.go b/pkg/cmd/grafana-cli/services/services.go index 2332511ed89..c5991a6c7bc 100644 --- a/pkg/cmd/grafana-cli/services/services.go +++ b/pkg/cmd/grafana-cli/services/services.go @@ -7,7 +7,7 @@ import ( "path" "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" ) @@ -64,7 +64,7 @@ func GetLocalPlugins(pluginDir string) []m.InstalledPlugin { } 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)) } diff --git a/pkg/middleware/util.go b/pkg/middleware/util.go index babda94d5e7..c392f215450 100644 --- a/pkg/middleware/util.go +++ b/pkg/middleware/util.go @@ -17,6 +17,10 @@ func Gziper() macaron.Handler { return } + if strings.HasPrefix(requestPath, "/api/plugin-proxy/") { + return + } + ctx.Invoke(macaronGziper) } } diff --git a/public/app/features/dashboard/partials/settings.html b/public/app/features/dashboard/partials/settings.html index 6290ffeacba..7103cdcc49d 100644 --- a/public/app/features/dashboard/partials/settings.html +++ b/public/app/features/dashboard/partials/settings.html @@ -28,7 +28,7 @@
diff --git a/public/app/features/templating/partials/editor.html b/public/app/features/templating/partials/editor.html index 19f9c25715b..dd5aa6fa543 100644 --- a/public/app/features/templating/partials/editor.html +++ b/public/app/features/templating/partials/editor.html @@ -147,7 +147,7 @@
Custom Options
- Values seperated by comma + Values separated by comma
diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index 7bbb921735a..fb751a2ce3a 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -173,7 +173,7 @@ function (angular, _, kbn) { return; } - // extract options in comma seperated string + // extract options in comma separated string variable.options = _.map(variable.query.split(/[,]+/), function(text) { return { text: text.trim(), value: text.trim() }; }); diff --git a/public/app/plugins/datasource/elasticsearch/README.md b/public/app/plugins/datasource/elasticsearch/README.md index 21978025eeb..22445b022fe 100644 --- a/public/app/plugins/datasource/elasticsearch/README.md +++ b/public/app/plugins/datasource/elasticsearch/README.md @@ -1,7 +1,7 @@ -# 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. Read more about it here: -[http://docs.grafana.org/datasources/elasticsearch/](http://docs.grafana.org/datasources/elasticsearch/) \ No newline at end of file +[http://docs.grafana.org/datasources/elasticsearch/](http://docs.grafana.org/datasources/elasticsearch/) diff --git a/public/app/plugins/datasource/elasticsearch/datasource.js b/public/app/plugins/datasource/elasticsearch/datasource.js index d5926be3f81..f6095271b8e 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.js +++ b/public/app/plugins/datasource/elasticsearch/datasource.js @@ -205,7 +205,9 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes }; function escapeForJson(value) { - return value.replace(/\"/g, '\\"'); + return value + .replace(/\s/g, '\\ ') + .replace(/\"/g, '\\"'); } function luceneThenJsonFormat(value) { diff --git a/public/app/plugins/datasource/influxdb/influx_query.ts b/public/app/plugins/datasource/influxdb/influx_query.ts index ff003859277..1def8e8f424 100644 --- a/public/app/plugins/datasource/influxdb/influx_query.ts +++ b/public/app/plugins/datasource/influxdb/influx_query.ts @@ -153,7 +153,7 @@ export default class InfluxQuery { value = this.templateSrv.replace(value, this.scopedVars); } if (operator !== '>' && operator !== '<') { - value = "'" + value.replace('\\', '\\\\') + "'"; + value = "'" + value.replace(/\\/g, '\\\\') + "'"; } } else if (interpolate){ value = this.templateSrv.replace(value, this.scopedVars, 'regex'); diff --git a/public/app/plugins/datasource/influxdb/query_part.ts b/public/app/plugins/datasource/influxdb/query_part.ts index 63d70be5653..130174c3084 100644 --- a/public/app/plugins/datasource/influxdb/query_part.ts +++ b/public/app/plugins/datasource/influxdb/query_part.ts @@ -230,6 +230,15 @@ QueryPartDef.register({ renderer: functionRenderer, }); +QueryPartDef.register({ + type: 'spread', + addStrategy: addTransformationStrategy, + category: categories.Transformations, + params: [], + defaultParams: [], + renderer: functionRenderer, +}); + QueryPartDef.register({ type: 'non_negative_derivative', addStrategy: addTransformationStrategy, diff --git a/public/app/plugins/datasource/influxdb/specs/query_part_specs.ts b/public/app/plugins/datasource/influxdb/specs/query_part_specs.ts index 2024015ffc7..299ec9b47fd 100644 --- a/public/app/plugins/datasource/influxdb/specs/query_part_specs.ts +++ b/public/app/plugins/datasource/influxdb/specs/query_part_specs.ts @@ -16,6 +16,15 @@ describe('InfluxQueryPart', () => { 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', () => { var part = queryPart.create({ type: 'math', diff --git a/public/app/plugins/panel/table/editor.html b/public/app/plugins/panel/table/editor.html index c9e0bad5d9a..f0fc3d70abc 100644 --- a/public/app/plugins/panel/table/editor.html +++ b/public/app/plugins/panel/table/editor.html @@ -119,7 +119,7 @@ >
  • - ThresholdsComma seperated values + ThresholdsComma separated values
  • diff --git a/public/views/500.html b/public/views/500.html index e7a740df6ba..9565304e7ff 100644 --- a/public/views/500.html +++ b/public/views/500.html @@ -7,8 +7,8 @@ Grafana - - + +