diff --git a/CHANGELOG.md b/CHANGELOG.md index c7763166f20..dcdc838115c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * **Prometheus**: Prometheus annotation support, closes[#2883](https://github.com/grafana/grafana/pull/2883) * **Cli**: New cli tool for downloading and updating plugins * **Annotations**: Annotations can now contain links that can be clicked (you can navigate on to annotation popovers), closes [#1588](https://github.com/grafana/grafana/issues/1588) +* **Opentsdb**: Opentsdb 2.2 filters support, closes[#3077](https://github.com/grafana/grafana/issues/3077) ### Breaking changes * **Plugin API**: Both datasource and panel plugin api (and plugin.json schema) have been updated, requiring an update to plugins. See [plugin api](https://github.com/grafana/grafana/blob/master/public/app/plugins/plugin_api.md) for more info. @@ -21,6 +22,7 @@ * **Admin**: Admin can now have global overview of Grafana setup, closes [#3812](https://github.com/grafana/grafana/issues/3812) * **graph**: Right side legend height is now fixed at row height, closes [#1277](https://github.com/grafana/grafana/issues/1277) * **Table**: All content in table panel is now html escaped, closes [#3673](https://github.com/grafana/grafana/issues/3673) +* **graph**: Template variables can now be used in TimeShift and TimeFrom, closes[#1960](https://github.com/grafana/grafana/issues/1960) ### Bug fixes * **Playlist**: Fix for memory leak when running a playlist, closes [#3794](https://github.com/grafana/grafana/pull/3794) diff --git a/docker/blocks/elastic/elasticsearch.yml b/docker/blocks/elastic/elasticsearch.yml new file mode 100644 index 00000000000..c57b2c12908 --- /dev/null +++ b/docker/blocks/elastic/elasticsearch.yml @@ -0,0 +1,2 @@ +script.inline: on +script.indexed: on diff --git a/docker/blocks/elastic/elasticsearch/config/.placeholder b/docker/blocks/elastic/elasticsearch/config/.placeholder deleted file mode 100644 index 9ad266259c2..00000000000 --- a/docker/blocks/elastic/elasticsearch/config/.placeholder +++ /dev/null @@ -1 +0,0 @@ -Ensure the existence of the parent folder. diff --git a/docker/blocks/elastic/fig b/docker/blocks/elastic/fig index 498402ac7b0..357352cabaa 100644 --- a/docker/blocks/elastic/fig +++ b/docker/blocks/elastic/fig @@ -4,3 +4,5 @@ elasticsearch: ports: - "9200:9200" - "9300:9300" + volumes: + - ./blocks/elastic/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml diff --git a/docs/sources/datasources/opentsdb.md b/docs/sources/datasources/opentsdb.md index 43fcda643ee..757ddcefab5 100644 --- a/docs/sources/datasources/opentsdb.md +++ b/docs/sources/datasources/opentsdb.md @@ -23,6 +23,7 @@ Name | The data source name, important that this is the same as in Grafana v1.x Default | Default data source means that it will be pre-selected for new panels. Url | The http protocol, ip and port of you opentsdb server (default port is usually 4242) Access | Proxy = access via Grafana backend, Direct = access directory from browser. +Version | Version = opentsdb version, either <=2.1 or 2.2 ## Query editor Open a graph in edit mode by click the title. diff --git a/pkg/api/api.go b/pkg/api/api.go index 90d613e46e0..ed029a5171a 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -43,8 +43,9 @@ func Register(r *macaron.Macaron) { r.Get("/admin/orgs/edit/:id", reqGrafanaAdmin, Index) r.Get("/admin/stats", reqGrafanaAdmin, Index) - r.Get("/apps", reqSignedIn, Index) - r.Get("/apps/edit/*", reqSignedIn, Index) + r.Get("/plugins", reqSignedIn, Index) + r.Get("/plugins/:id/edit", reqSignedIn, Index) + r.Get("/plugins/:id/page/:page", reqSignedIn, Index) r.Get("/dashboard/*", reqSignedIn, Index) r.Get("/dashboard-solo/*", reqSignedIn, Index) diff --git a/pkg/api/index.go b/pkg/api/index.go index df752109530..a5199fa79ae 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -85,13 +85,13 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) { if plugin.Pinned { pageLink := &dtos.NavLink{ Text: plugin.Name, - Url: setting.AppSubUrl + "/apps/" + plugin.Id + "/edit", + Url: setting.AppSubUrl + "/plugins/" + plugin.Id + "/edit", Img: plugin.Info.Logos.Small, } for _, page := range plugin.Pages { pageLink.Children = append(pageLink.Children, &dtos.NavLink{ - Url: setting.AppSubUrl + "/apps/" + plugin.Id + "/page/" + page.Slug, + Url: setting.AppSubUrl + "/plugins/" + plugin.Id + "/page/" + page.Slug, Text: page.Name, }) } diff --git a/pkg/services/sqlstore/sqlstore.go b/pkg/services/sqlstore/sqlstore.go index e3db2d7f537..8dae7247a39 100644 --- a/pkg/services/sqlstore/sqlstore.go +++ b/pkg/services/sqlstore/sqlstore.go @@ -77,7 +77,7 @@ func NewEngine() { log.Fatal(3, "Sqlstore: Fail to connect to database: %v", err) } - err = SetEngine(x, true) + err = SetEngine(x, setting.Env == setting.DEV) if err != nil { log.Fatal(3, "fail to initialize orm engine: %v", err) @@ -105,14 +105,6 @@ func SetEngine(engine *xorm.Engine, enableLog bool) (err error) { return fmt.Errorf("sqlstore.init(fail to create xorm.log): %v", err) } x.Logger = xorm.NewSimpleLogger(f) - - if setting.Env == setting.DEV { - x.ShowSQL = false - x.ShowInfo = false - x.ShowDebug = false - x.ShowErr = true - x.ShowWarn = true - } } return nil diff --git a/public/app/core/directives/ng_model_on_blur.js b/public/app/core/directives/ng_model_on_blur.js index 1e3ebc38a25..6f4a55b53f0 100644 --- a/public/app/core/directives/ng_model_on_blur.js +++ b/public/app/core/directives/ng_model_on_blur.js @@ -47,6 +47,9 @@ function (coreModule, kbn, rangeUtil) { if (ctrl.$isEmpty(modelValue)) { return true; } + if (viewValue.indexOf('$') === 0) { + return true; // allow template variable + } var info = rangeUtil.describeTextRange(viewValue); return info.invalid !== true; }; diff --git a/public/app/core/utils/file_export.ts b/public/app/core/utils/file_export.ts index ad203f58495..944b6ae8a80 100644 --- a/public/app/core/utils/file_export.ts +++ b/public/app/core/utils/file_export.ts @@ -14,6 +14,41 @@ export function exportSeriesListToCsv(seriesList) { saveSaveBlob(text, 'grafana_data_export.csv'); }; +export function exportSeriesListToCsvColumns(seriesList) { + var text = 'Time;'; + // add header + _.each(seriesList, function(series) { + text += series.alias + ';'; + }); + text = text.substring(0,text.length-1); + text += '\n'; + + // process data + var dataArr = [[]]; + var sIndex = 1; + _.each(seriesList, function(series) { + var cIndex = 0; + dataArr.push([]); + _.each(series.datapoints, function(dp) { + dataArr[0][cIndex] = new Date(dp[1]).toISOString(); + dataArr[sIndex][cIndex] = dp[0]; + cIndex++; + }); + sIndex++; + }); + + // make text + for (var i = 0; i < dataArr[0].length; i++) { + text += dataArr[0][i] + ';'; + for (var j = 1; j < dataArr.length; j++) { + text += dataArr[j][i] + ';'; + } + text = text.substring(0,text.length-1); + text += '\n'; + } + saveSaveBlob(text, 'grafana_data_export.csv'); +}; + export function exportTableDataToCsv(table) { var text = ''; // add header diff --git a/public/app/core/utils/kbn.js b/public/app/core/utils/kbn.js index 97f2f10f799..f6e4277523e 100644 --- a/public/app/core/utils/kbn.js +++ b/public/app/core/utils/kbn.js @@ -12,39 +12,66 @@ function($, _) { kbn.round_interval = function(interval) { switch (true) { - // 0.5s - case (interval <= 500): + // 0.3s + case (interval <= 300): return 100; // 0.1s - // 5s - case (interval <= 5000): + // 0.75s + case (interval <= 750): + return 500; // 0.5s + // 1.5s + case (interval <= 1500): return 1000; // 1s + // 3.5s + case (interval <= 3500): + return 2000; // 2s // 7.5s case (interval <= 7500): return 5000; // 5s - // 15s - case (interval <= 15000): + // 12.5s + case (interval <= 12500): return 10000; // 10s + // 17.5s + case (interval <= 17500): + return 15000; // 15s + // 25s + case (interval <= 25000): + return 20000; // 20s // 45s case (interval <= 45000): return 30000; // 30s - // 3m - case (interval <= 180000): + // 1.5m + case (interval <= 90000): return 60000; // 1m - // 9m + // 3.5m + case (interval <= 210000): + return 120000; // 2m + // 7.5m case (interval <= 450000): return 300000; // 5m - // 20m - case (interval <= 1200000): + // 12.5m + case (interval <= 750000): return 600000; // 10m + // 12.5m + case (interval <= 1050000): + return 900000; // 15m + // 25m + case (interval <= 1500000): + return 1200000; // 20m // 45m case (interval <= 2700000): return 1800000; // 30m - // 2h - case (interval <= 7200000): + // 1.5h + case (interval <= 5400000): return 3600000; // 1h - // 6h - case (interval <= 21600000): + // 2.5h + case (interval <= 9000000): + return 7200000; // 2h + // 4.5h + case (interval <= 16200000): return 10800000; // 3h + // 9h + case (interval <= 32400000): + return 21600000; // 6h // 24h case (interval <= 86400000): return 43200000; // 12h diff --git a/public/app/features/annotations/editor_ctrl.js b/public/app/features/annotations/editor_ctrl.js index d9731686a4f..8d3887ee757 100644 --- a/public/app/features/annotations/editor_ctrl.js +++ b/public/app/features/annotations/editor_ctrl.js @@ -12,10 +12,7 @@ function (angular, _, $) { var annotationDefaults = { name: '', datasource: null, - showLine: true, - iconColor: '#C0C6BE', - lineColor: 'rgba(255, 96, 96, 0.592157)', - iconSize: 13, + iconColor: 'rgba(255, 96, 96, 1)', enable: true }; diff --git a/public/app/features/annotations/partials/editor.html b/public/app/features/annotations/partials/editor.html index c54d33fe939..702d8921bef 100644 --- a/public/app/features/annotations/partials/editor.html +++ b/public/app/features/annotations/partials/editor.html @@ -76,8 +76,8 @@