From f768808b6ee7952ca7ac3c5ae2bcc4d07422cc07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sat, 23 Feb 2019 08:59:00 +0100 Subject: [PATCH 01/16] Fixed value dropdown not updating when it's current value updates, fixes #15566 --- .../app/core/directives/value_select_dropdown.ts | 16 ++++++++-------- .../dashboard/components/SubMenu/template.html | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/public/app/core/directives/value_select_dropdown.ts b/public/app/core/directives/value_select_dropdown.ts index a75ecd46ad0..0df1b2758be 100644 --- a/public/app/core/directives/value_select_dropdown.ts +++ b/public/app/core/directives/value_select_dropdown.ts @@ -240,7 +240,7 @@ export class ValueSelectDropdownCtrl { /** @ngInject */ export function valueSelectDropdown($compile, $window, $timeout, $rootScope) { return { - scope: { variable: '=', onUpdated: '&' }, + scope: { dashboard: '=', variable: '=', onUpdated: '&' }, templateUrl: 'public/app/partials/valueSelectDropdown.html', controller: 'ValueSelectDropdownCtrl', controllerAs: 'vm', @@ -288,13 +288,13 @@ export function valueSelectDropdown($compile, $window, $timeout, $rootScope) { } }); - const cleanUp = $rootScope.$on('template-variable-value-updated', () => { - scope.vm.updateLinkText(); - }); - - scope.$on('$destroy', () => { - cleanUp(); - }); + scope.vm.dashboard.on( + 'template-variable-value-updated', + () => { + scope.vm.updateLinkText(); + }, + scope + ); scope.vm.init(); }, diff --git a/public/app/features/dashboard/components/SubMenu/template.html b/public/app/features/dashboard/components/SubMenu/template.html index 1ccbfcc915c..fd52deaf403 100644 --- a/public/app/features/dashboard/components/SubMenu/template.html +++ b/public/app/features/dashboard/components/SubMenu/template.html @@ -4,7 +4,7 @@ - + From d1e249a8039aa068af1de9d92d6aaf482e26d461 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Sun, 24 Feb 2019 17:32:47 +0100 Subject: [PATCH 02/16] stackdriver: fix for float64 bounds for distribution metrics Adds support for explicit distribution metrics and float64 bounds Fixes #14509 --- pkg/tsdb/stackdriver/stackdriver.go | 4 +- pkg/tsdb/stackdriver/stackdriver_test.go | 51 ++++- ...es-response-distribution-exponential.json} | 0 ...series-response-distribution-explicit.json | 209 ++++++++++++++++++ pkg/tsdb/stackdriver/types.go | 2 +- 5 files changed, 262 insertions(+), 4 deletions(-) rename pkg/tsdb/stackdriver/test-data/{3-series-response-distribution.json => 3-series-response-distribution-exponential.json} (100%) create mode 100644 pkg/tsdb/stackdriver/test-data/4-series-response-distribution-explicit.json diff --git a/pkg/tsdb/stackdriver/stackdriver.go b/pkg/tsdb/stackdriver/stackdriver.go index 8317e2a748a..76b346553ad 100644 --- a/pkg/tsdb/stackdriver/stackdriver.go +++ b/pkg/tsdb/stackdriver/stackdriver.go @@ -336,6 +336,8 @@ func (e *StackdriverExecutor) unmarshalResponse(res *http.Response) (Stackdriver return StackdriverResponse{}, err } + // slog.Info("stackdriver", "response", string(body)) + if res.StatusCode/100 != 2 { slog.Error("Request failed", "status", res.Status, "body", string(body)) return StackdriverResponse{}, fmt.Errorf(string(body)) @@ -559,7 +561,7 @@ func calcBucketBound(bucketOptions StackdriverBucketOptions, n int) string { } else if bucketOptions.ExponentialBuckets != nil { bucketBound = strconv.FormatInt(int64(bucketOptions.ExponentialBuckets.Scale*math.Pow(bucketOptions.ExponentialBuckets.GrowthFactor, float64(n-1))), 10) } else if bucketOptions.ExplicitBuckets != nil { - bucketBound = strconv.FormatInt(bucketOptions.ExplicitBuckets.Bounds[(n-1)], 10) + bucketBound = fmt.Sprintf("%g", bucketOptions.ExplicitBuckets.Bounds[n]) } return bucketBound } diff --git a/pkg/tsdb/stackdriver/stackdriver_test.go b/pkg/tsdb/stackdriver/stackdriver_test.go index 4b16b6b5294..78c3086a94b 100644 --- a/pkg/tsdb/stackdriver/stackdriver_test.go +++ b/pkg/tsdb/stackdriver/stackdriver_test.go @@ -344,8 +344,8 @@ func TestStackdriver(t *testing.T) { }) }) - Convey("when data from query is distribution", func() { - data, err := loadTestFile("./test-data/3-series-response-distribution.json") + Convey("when data from query is distribution with exponential bounds", func() { + data, err := loadTestFile("./test-data/3-series-response-distribution-exponential.json") So(err, ShouldBeNil) So(len(data.TimeSeries), ShouldEqual, 1) @@ -370,6 +370,14 @@ func TestStackdriver(t *testing.T) { So(res.Series[0].Points[2][1].Float64, ShouldEqual, 1536669060000) }) + Convey("bucket bounds should be correct", func() { + So(res.Series[0].Name, ShouldEqual, "0") + So(res.Series[1].Name, ShouldEqual, "1") + So(res.Series[2].Name, ShouldEqual, "2") + So(res.Series[3].Name, ShouldEqual, "4") + So(res.Series[4].Name, ShouldEqual, "8") + }) + Convey("value should be correct", func() { So(res.Series[8].Points[0][0].Float64, ShouldEqual, 1) So(res.Series[9].Points[0][0].Float64, ShouldEqual, 1) @@ -383,6 +391,45 @@ func TestStackdriver(t *testing.T) { }) }) + Convey("when data from query is distribution with explicit bounds", func() { + data, err := loadTestFile("./test-data/4-series-response-distribution-explicit.json") + So(err, ShouldBeNil) + So(len(data.TimeSeries), ShouldEqual, 1) + + res := &tsdb.QueryResult{Meta: simplejson.New(), RefId: "A"} + query := &StackdriverQuery{AliasBy: "{{bucket}}"} + err = executor.parseResponse(res, data, query) + So(err, ShouldBeNil) + + So(len(res.Series), ShouldEqual, 33) + for i := 0; i < 33; i++ { + if i == 0 { + So(res.Series[i].Name, ShouldEqual, "0") + } + So(len(res.Series[i].Points), ShouldEqual, 2) + } + + Convey("timestamps should be in ascending order", func() { + So(res.Series[0].Points[0][1].Float64, ShouldEqual, 1550859086000) + So(res.Series[0].Points[1][1].Float64, ShouldEqual, 1550859146000) + }) + + Convey("bucket bounds should be correct", func() { + So(res.Series[0].Name, ShouldEqual, "0") + So(res.Series[1].Name, ShouldEqual, "0.01") + So(res.Series[2].Name, ShouldEqual, "0.05") + So(res.Series[3].Name, ShouldEqual, "0.1") + }) + + Convey("value should be correct", func() { + So(res.Series[8].Points[0][0].Float64, ShouldEqual, 381) + So(res.Series[9].Points[0][0].Float64, ShouldEqual, 212) + So(res.Series[10].Points[0][0].Float64, ShouldEqual, 56) + So(res.Series[8].Points[1][0].Float64, ShouldEqual, 375) + So(res.Series[9].Points[1][0].Float64, ShouldEqual, 213) + So(res.Series[10].Points[1][0].Float64, ShouldEqual, 56) + }) + }) }) Convey("when interpolating filter wildcards", func() { diff --git a/pkg/tsdb/stackdriver/test-data/3-series-response-distribution.json b/pkg/tsdb/stackdriver/test-data/3-series-response-distribution-exponential.json similarity index 100% rename from pkg/tsdb/stackdriver/test-data/3-series-response-distribution.json rename to pkg/tsdb/stackdriver/test-data/3-series-response-distribution-exponential.json diff --git a/pkg/tsdb/stackdriver/test-data/4-series-response-distribution-explicit.json b/pkg/tsdb/stackdriver/test-data/4-series-response-distribution-explicit.json new file mode 100644 index 00000000000..98435294762 --- /dev/null +++ b/pkg/tsdb/stackdriver/test-data/4-series-response-distribution-explicit.json @@ -0,0 +1,209 @@ +{ + "timeSeries": [ + { + "metric": { + "type": "custom.googleapis.com\/opencensus\/grpc.io\/client\/roundtrip_latency" + }, + "resource": { + "type": "global", + "labels": { + "project_id": "grafana-demo" + } + }, + "metricKind": "DELTA", + "valueType": "DISTRIBUTION", + "points": [ + { + "interval": { + "startTime": "2019-02-22T18:11:26Z", + "endTime": "2019-02-22T18:12:26Z" + }, + "value": { + "distributionValue": { + "count": "1878", + "mean": 17.813718392255, + "sumOfSquaredDeviation": 7141630.651914, + "bucketOptions": { + "explicitBuckets": { + "bounds": [ + 0, + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ] + } + }, + "bucketCounts": [ + "0", + "0", + "0", + "0", + "8", + "403", + "297", + "184", + "375", + "213", + "56", + "31", + "15", + "13", + "4", + "1", + "5", + "2", + "8", + "13", + "26", + "13", + "45", + "48", + "61", + "10", + "3", + "6", + "7", + "4", + "7", + "12", + "8" + ] + } + } + }, + { + "interval": { + "startTime": "2019-02-22T18:10:26Z", + "endTime": "2019-02-22T18:11:26Z" + }, + "value": { + "distributionValue": { + "count": "1887", + "mean": 17.654277577766, + "sumOfSquaredDeviation": 7082587.2133073, + "bucketOptions": { + "explicitBuckets": { + "bounds": [ + 0, + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ] + } + }, + "bucketCounts": [ + "0", + "0", + "0", + "0", + "8", + "404", + "298", + "187", + "381", + "212", + "56", + "31", + "15", + "14", + "4", + "1", + "4", + "2", + "9", + "13", + "24", + "13", + "46", + "46", + "61", + "11", + "3", + "6", + "7", + "5", + "7", + "11", + "8" + ] + } + } + } + ] + } + ] +} diff --git a/pkg/tsdb/stackdriver/types.go b/pkg/tsdb/stackdriver/types.go index 3821ce7ceda..e4ede41d269 100644 --- a/pkg/tsdb/stackdriver/types.go +++ b/pkg/tsdb/stackdriver/types.go @@ -26,7 +26,7 @@ type StackdriverBucketOptions struct { Scale float64 `json:"scale"` } `json:"exponentialBuckets"` ExplicitBuckets *struct { - Bounds []int64 `json:"bounds"` + Bounds []float64 `json:"bounds"` } `json:"explicitBuckets"` } From 35fc0c532994159f5200e4e2a6906175c16f3a35 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Sat, 23 Feb 2019 15:52:40 +0100 Subject: [PATCH 03/16] stackdriver: change reducer mapping for distribution metrics - Distribution metrics are now mapped to more reducers when the metric kind is cumulative. - The witdth of the metrics dropdown is now much wider. - Changed the text from Select Aggregation to Select Reducer to line up with the UI in Stackdriver. --- .../stackdriver/components/Aggregations.test.tsx | 3 ++- .../datasource/stackdriver/components/Aggregations.tsx | 2 +- .../datasource/stackdriver/components/Metrics.tsx | 2 +- .../__snapshots__/Aggregations.test.tsx.snap | 2 +- .../components/__snapshots__/QueryEditor.test.tsx.snap | 4 ++-- public/app/plugins/datasource/stackdriver/constants.ts | 10 +++++----- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/public/app/plugins/datasource/stackdriver/components/Aggregations.test.tsx b/public/app/plugins/datasource/stackdriver/components/Aggregations.test.tsx index 2402cc5da2c..5b14fa73a72 100644 --- a/public/app/plugins/datasource/stackdriver/components/Aggregations.test.tsx +++ b/public/app/plugins/datasource/stackdriver/components/Aggregations.test.tsx @@ -49,7 +49,8 @@ describe('Aggregations', () => { }); it('', () => { const options = wrapper.state().aggOptions[0].options; - expect(options.length).toEqual(5); + + expect(options.length).toEqual(10); expect(options.map(o => o.value)).toEqual(expect.arrayContaining(['REDUCE_NONE'])); }); }); diff --git a/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx b/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx index c616d55ba7a..9b8dca01151 100644 --- a/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx +++ b/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx @@ -73,7 +73,7 @@ export class Aggregations extends React.Component { value={crossSeriesReducer} variables={templateSrv.variables} options={aggOptions} - placeholder="Select Aggregation" + placeholder="Select Reducer" className="width-15" /> diff --git a/public/app/plugins/datasource/stackdriver/components/Metrics.tsx b/public/app/plugins/datasource/stackdriver/components/Metrics.tsx index 06094d0c1e9..a09b6108370 100644 --- a/public/app/plugins/datasource/stackdriver/components/Metrics.tsx +++ b/public/app/plugins/datasource/stackdriver/components/Metrics.tsx @@ -185,7 +185,7 @@ export class Metrics extends React.Component { }, ]} placeholder="Select Metric" - className="width-15" + className="width-26" />
diff --git a/public/app/plugins/datasource/stackdriver/components/__snapshots__/Aggregations.test.tsx.snap b/public/app/plugins/datasource/stackdriver/components/__snapshots__/Aggregations.test.tsx.snap index defd8ef01a4..ed9fe98bbf8 100644 --- a/public/app/plugins/datasource/stackdriver/components/__snapshots__/Aggregations.test.tsx.snap +++ b/public/app/plugins/datasource/stackdriver/components/__snapshots__/Aggregations.test.tsx.snap @@ -28,7 +28,7 @@ Array [
- Select Aggregation + Select Reducer
- Select Aggregation + Select Reducer
Date: Sat, 23 Feb 2019 23:35:26 +0100 Subject: [PATCH 04/16] moves metric package to /infra ref #14679 --- pkg/api/admin_users.go | 2 +- pkg/api/dashboard.go | 2 +- pkg/api/dashboard_snapshot.go | 2 +- pkg/api/dataproxy.go | 2 +- pkg/api/login.go | 2 +- pkg/api/login_oauth.go | 2 +- pkg/api/org.go | 2 +- pkg/api/org_invite.go | 2 +- pkg/api/search.go | 2 +- pkg/api/signup.go | 2 +- pkg/cmd/grafana-server/main.go | 2 +- pkg/cmd/grafana-server/server.go | 2 +- pkg/{ => infra}/metrics/graphitebridge/graphite.go | 0 pkg/{ => infra}/metrics/graphitebridge/graphite_test.go | 0 pkg/{ => infra}/metrics/metrics.go | 0 pkg/{ => infra}/metrics/service.go | 2 +- pkg/{ => infra}/metrics/settings.go | 2 +- pkg/infra/usagestats/usage_stats.go | 2 +- pkg/middleware/request_metrics.go | 2 +- pkg/services/alerting/eval_handler.go | 2 +- pkg/services/alerting/notifier.go | 2 +- pkg/services/alerting/reader.go | 2 +- pkg/services/alerting/result_handler.go | 2 +- pkg/services/sqlstore/dashboard.go | 2 +- pkg/services/sqlstore/datasource.go | 2 +- pkg/tsdb/cloudwatch/cloudwatch.go | 2 +- pkg/tsdb/cloudwatch/metric_find_query.go | 2 +- 27 files changed, 24 insertions(+), 24 deletions(-) rename pkg/{ => infra}/metrics/graphitebridge/graphite.go (100%) rename pkg/{ => infra}/metrics/graphitebridge/graphite_test.go (100%) rename pkg/{ => infra}/metrics/metrics.go (100%) rename pkg/{ => infra}/metrics/service.go (94%) rename pkg/{ => infra}/metrics/settings.go (96%) diff --git a/pkg/api/admin_users.go b/pkg/api/admin_users.go index efc760d2b51..c16c2f126f8 100644 --- a/pkg/api/admin_users.go +++ b/pkg/api/admin_users.go @@ -3,7 +3,7 @@ package api import ( "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/bus" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/util" ) diff --git a/pkg/api/dashboard.go b/pkg/api/dashboard.go index 20d717ef8fa..f1ad935e621 100644 --- a/pkg/api/dashboard.go +++ b/pkg/api/dashboard.go @@ -13,8 +13,8 @@ import ( "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/components/dashdiffs" "github.com/grafana/grafana/pkg/components/simplejson" + "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/log" - "github.com/grafana/grafana/pkg/metrics" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/services/guardian" diff --git a/pkg/api/dashboard_snapshot.go b/pkg/api/dashboard_snapshot.go index ca7e78a58cd..ba4a09f6f01 100644 --- a/pkg/api/dashboard_snapshot.go +++ b/pkg/api/dashboard_snapshot.go @@ -10,7 +10,7 @@ import ( "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/components/simplejson" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/services/guardian" "github.com/grafana/grafana/pkg/setting" diff --git a/pkg/api/dataproxy.go b/pkg/api/dataproxy.go index 5cde0efd0b4..54a744fccdc 100644 --- a/pkg/api/dataproxy.go +++ b/pkg/api/dataproxy.go @@ -2,7 +2,7 @@ package api import ( "github.com/grafana/grafana/pkg/api/pluginproxy" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/plugins" ) diff --git a/pkg/api/login.go b/pkg/api/login.go index 106a48dd6a8..1445463852b 100644 --- a/pkg/api/login.go +++ b/pkg/api/login.go @@ -7,9 +7,9 @@ import ( "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/bus" + "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/log" "github.com/grafana/grafana/pkg/login" - "github.com/grafana/grafana/pkg/metrics" "github.com/grafana/grafana/pkg/middleware" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/setting" diff --git a/pkg/api/login_oauth.go b/pkg/api/login_oauth.go index 87a8ecc876f..7d9537b4790 100644 --- a/pkg/api/login_oauth.go +++ b/pkg/api/login_oauth.go @@ -16,9 +16,9 @@ import ( "golang.org/x/oauth2" "github.com/grafana/grafana/pkg/bus" + "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/log" "github.com/grafana/grafana/pkg/login" - "github.com/grafana/grafana/pkg/metrics" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/social" diff --git a/pkg/api/org.go b/pkg/api/org.go index 8d0d48bad13..07122ecd6ca 100644 --- a/pkg/api/org.go +++ b/pkg/api/org.go @@ -3,7 +3,7 @@ package api import ( "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/bus" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/util" diff --git a/pkg/api/org_invite.go b/pkg/api/org_invite.go index 835b03a2cc9..86067cd7721 100644 --- a/pkg/api/org_invite.go +++ b/pkg/api/org_invite.go @@ -6,7 +6,7 @@ import ( "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/events" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/util" diff --git a/pkg/api/search.go b/pkg/api/search.go index 8c2b708d5a2..22709bf8a6d 100644 --- a/pkg/api/search.go +++ b/pkg/api/search.go @@ -4,7 +4,7 @@ import ( "strconv" "github.com/grafana/grafana/pkg/bus" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/services/search" ) diff --git a/pkg/api/signup.go b/pkg/api/signup.go index fe577dd9ef9..c572ccc09f7 100644 --- a/pkg/api/signup.go +++ b/pkg/api/signup.go @@ -4,7 +4,7 @@ import ( "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/events" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/util" diff --git a/pkg/cmd/grafana-server/main.go b/pkg/cmd/grafana-server/main.go index d371d4e91da..825d48e0076 100644 --- a/pkg/cmd/grafana-server/main.go +++ b/pkg/cmd/grafana-server/main.go @@ -14,8 +14,8 @@ import ( "time" "github.com/grafana/grafana/pkg/extensions" + "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/log" - "github.com/grafana/grafana/pkg/metrics" _ "github.com/grafana/grafana/pkg/services/alerting/conditions" _ "github.com/grafana/grafana/pkg/services/alerting/notifiers" "github.com/grafana/grafana/pkg/setting" diff --git a/pkg/cmd/grafana-server/server.go b/pkg/cmd/grafana-server/server.go index f663e6be895..a1db5cd4b4c 100644 --- a/pkg/cmd/grafana-server/server.go +++ b/pkg/cmd/grafana-server/server.go @@ -28,8 +28,8 @@ import ( // self registering services _ "github.com/grafana/grafana/pkg/extensions" + _ "github.com/grafana/grafana/pkg/infra/metrics" _ "github.com/grafana/grafana/pkg/infra/serverlock" - _ "github.com/grafana/grafana/pkg/metrics" _ "github.com/grafana/grafana/pkg/plugins" _ "github.com/grafana/grafana/pkg/services/alerting" _ "github.com/grafana/grafana/pkg/services/auth" diff --git a/pkg/metrics/graphitebridge/graphite.go b/pkg/infra/metrics/graphitebridge/graphite.go similarity index 100% rename from pkg/metrics/graphitebridge/graphite.go rename to pkg/infra/metrics/graphitebridge/graphite.go diff --git a/pkg/metrics/graphitebridge/graphite_test.go b/pkg/infra/metrics/graphitebridge/graphite_test.go similarity index 100% rename from pkg/metrics/graphitebridge/graphite_test.go rename to pkg/infra/metrics/graphitebridge/graphite_test.go diff --git a/pkg/metrics/metrics.go b/pkg/infra/metrics/metrics.go similarity index 100% rename from pkg/metrics/metrics.go rename to pkg/infra/metrics/metrics.go diff --git a/pkg/metrics/service.go b/pkg/infra/metrics/service.go similarity index 94% rename from pkg/metrics/service.go rename to pkg/infra/metrics/service.go index 44b83187cac..ac1d934e375 100644 --- a/pkg/metrics/service.go +++ b/pkg/infra/metrics/service.go @@ -3,8 +3,8 @@ package metrics import ( "context" + "github.com/grafana/grafana/pkg/infra/metrics/graphitebridge" "github.com/grafana/grafana/pkg/log" - "github.com/grafana/grafana/pkg/metrics/graphitebridge" "github.com/grafana/grafana/pkg/registry" "github.com/grafana/grafana/pkg/setting" ) diff --git a/pkg/metrics/settings.go b/pkg/infra/metrics/settings.go similarity index 96% rename from pkg/metrics/settings.go rename to pkg/infra/metrics/settings.go index 048e4134690..9b4ea4607da 100644 --- a/pkg/metrics/settings.go +++ b/pkg/infra/metrics/settings.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/grafana/grafana/pkg/metrics/graphitebridge" + "github.com/grafana/grafana/pkg/infra/metrics/graphitebridge" "github.com/grafana/grafana/pkg/setting" "github.com/prometheus/client_golang/prometheus" ) diff --git a/pkg/infra/usagestats/usage_stats.go b/pkg/infra/usagestats/usage_stats.go index 9d7501b7765..77951d1c899 100644 --- a/pkg/infra/usagestats/usage_stats.go +++ b/pkg/infra/usagestats/usage_stats.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/setting" diff --git a/pkg/middleware/request_metrics.go b/pkg/middleware/request_metrics.go index f2d71c0a0fe..4ed2c070f84 100644 --- a/pkg/middleware/request_metrics.go +++ b/pkg/middleware/request_metrics.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" "gopkg.in/macaron.v1" ) diff --git a/pkg/services/alerting/eval_handler.go b/pkg/services/alerting/eval_handler.go index aa24efa77cd..097f4bcb2b6 100644 --- a/pkg/services/alerting/eval_handler.go +++ b/pkg/services/alerting/eval_handler.go @@ -5,8 +5,8 @@ import ( "strings" "time" + "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/log" - "github.com/grafana/grafana/pkg/metrics" ) type DefaultEvalHandler struct { diff --git a/pkg/services/alerting/notifier.go b/pkg/services/alerting/notifier.go index 59d459f122e..2ef5ebbade3 100644 --- a/pkg/services/alerting/notifier.go +++ b/pkg/services/alerting/notifier.go @@ -7,8 +7,8 @@ import ( "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/components/imguploader" + "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/log" - "github.com/grafana/grafana/pkg/metrics" "github.com/grafana/grafana/pkg/services/rendering" "github.com/grafana/grafana/pkg/setting" diff --git a/pkg/services/alerting/reader.go b/pkg/services/alerting/reader.go index 2cdbc57b41d..d9f20a21c8e 100644 --- a/pkg/services/alerting/reader.go +++ b/pkg/services/alerting/reader.go @@ -5,8 +5,8 @@ import ( "time" "github.com/grafana/grafana/pkg/bus" + "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/log" - "github.com/grafana/grafana/pkg/metrics" m "github.com/grafana/grafana/pkg/models" ) diff --git a/pkg/services/alerting/result_handler.go b/pkg/services/alerting/result_handler.go index ce12a8a6b96..c8e9e2dc25c 100644 --- a/pkg/services/alerting/result_handler.go +++ b/pkg/services/alerting/result_handler.go @@ -5,8 +5,8 @@ import ( "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/components/simplejson" + "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/log" - "github.com/grafana/grafana/pkg/metrics" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/services/annotations" "github.com/grafana/grafana/pkg/services/rendering" diff --git a/pkg/services/sqlstore/dashboard.go b/pkg/services/sqlstore/dashboard.go index 7ebdbfa65e7..8e1f69d1f6a 100644 --- a/pkg/services/sqlstore/dashboard.go +++ b/pkg/services/sqlstore/dashboard.go @@ -5,7 +5,7 @@ import ( "time" "github.com/grafana/grafana/pkg/bus" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/services/search" "github.com/grafana/grafana/pkg/util" diff --git a/pkg/services/sqlstore/datasource.go b/pkg/services/sqlstore/datasource.go index ccab1106880..1b69cce8c99 100644 --- a/pkg/services/sqlstore/datasource.go +++ b/pkg/services/sqlstore/datasource.go @@ -7,7 +7,7 @@ import ( "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/components/securejsondata" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" m "github.com/grafana/grafana/pkg/models" ) diff --git a/pkg/tsdb/cloudwatch/cloudwatch.go b/pkg/tsdb/cloudwatch/cloudwatch.go index 8d67fe7db8c..278025db75a 100644 --- a/pkg/tsdb/cloudwatch/cloudwatch.go +++ b/pkg/tsdb/cloudwatch/cloudwatch.go @@ -24,7 +24,7 @@ import ( "github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/resourcegroupstaggingapiiface" "github.com/grafana/grafana/pkg/components/null" "github.com/grafana/grafana/pkg/components/simplejson" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" ) type CloudWatchExecutor struct { diff --git a/pkg/tsdb/cloudwatch/metric_find_query.go b/pkg/tsdb/cloudwatch/metric_find_query.go index ddda26dfd24..cb95d39d82d 100644 --- a/pkg/tsdb/cloudwatch/metric_find_query.go +++ b/pkg/tsdb/cloudwatch/metric_find_query.go @@ -17,7 +17,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi" "github.com/grafana/grafana/pkg/components/simplejson" - "github.com/grafana/grafana/pkg/metrics" + "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/tsdb" ) From e76655df43c59f43fc1d4f38ef9170281c20d25f Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Sun, 24 Feb 2019 21:55:17 +0100 Subject: [PATCH 05/16] graph: fixes click after scroll in series override menu Makes changes to dropdown-typeahead2 so that a css class for the button can be passed in. Means it can be used instead of dropdown-typeahead. Switches to using dropdown-typeahead2 for series_overrides directive and for the influxdb, mysql and postgres datasources as it already contains a fix for this issue. This commit also fixes the index property which was set using an incorrectly spelled length property in the series_overrides directive. Closes #15621 --- .../app/core/directives/dropdown_typeahead.ts | 8 +- .../influxdb/partials/query.editor.html | 226 +++++++++----- .../mysql/partials/query.editor.html | 6 +- .../postgres/partials/query.editor.html | 6 +- .../panel/graph/series_overrides_ctrl.ts | 2 +- .../app/plugins/panel/graph/tab_display.html | 294 +++++++++++------- 6 files changed, 356 insertions(+), 186 deletions(-) diff --git a/public/app/core/directives/dropdown_typeahead.ts b/public/app/core/directives/dropdown_typeahead.ts index 8bd2d4a3af6..7456df8de53 100644 --- a/public/app/core/directives/dropdown_typeahead.ts +++ b/public/app/core/directives/dropdown_typeahead.ts @@ -128,7 +128,7 @@ export function dropdownTypeahead2($compile) { ''; const buttonTemplate = - ''; @@ -137,9 +137,15 @@ export function dropdownTypeahead2($compile) { menuItems: '=dropdownTypeahead2', dropdownTypeaheadOnSelect: '&dropdownTypeaheadOnSelect', model: '=ngModel', + buttonTemplateClass: '@', }, link: ($scope, elem, attrs) => { const $input = $(inputTemplate); + + if (!$scope.buttonTemplateClass) { + $scope.buttonTemplateClass = 'gf-form-input'; + } + const $button = $(buttonTemplate); const timeoutId = { blur: null, diff --git a/public/app/plugins/datasource/influxdb/partials/query.editor.html b/public/app/plugins/datasource/influxdb/partials/query.editor.html index 658cf18daee..ba99b396e6e 100644 --- a/public/app/plugins/datasource/influxdb/partials/query.editor.html +++ b/public/app/plugins/datasource/influxdb/partials/query.editor.html @@ -1,19 +1,38 @@ - -
+
- +
- +
-
+
- +
@@ -21,108 +40,154 @@
-
+
+
+
+ -
-
- + + +
- - -
+
+ +
-
- -
+
+ +
-
- -
+
+
+
+
-
-
-
-
+
+
+ +
-
-
- -
+
+ + +
-
- - -
+
+ +
-
- -
+
+
+
+
-
-
-
-
+
+
+ -
-
- + + +
- - -
+
+ +
-
- -
- -
-
-
-
+
+
+
+
- +
-
-
+
+
- +
-
-
+
+
- +
-
-
+
+
- +
@@ -133,7 +198,12 @@
- +
@@ -141,15 +211,21 @@
-
+
- +
- diff --git a/public/app/plugins/datasource/mysql/partials/query.editor.html b/public/app/plugins/datasource/mysql/partials/query.editor.html index 0cb47061a9e..25f33b6a534 100644 --- a/public/app/plugins/datasource/mysql/partials/query.editor.html +++ b/public/app/plugins/datasource/mysql/partials/query.editor.html @@ -45,8 +45,10 @@
diff --git a/public/app/plugins/datasource/postgres/partials/query.editor.html b/public/app/plugins/datasource/postgres/partials/query.editor.html index b5e2b5d87ed..5411427cfe6 100644 --- a/public/app/plugins/datasource/postgres/partials/query.editor.html +++ b/public/app/plugins/datasource/postgres/partials/query.editor.html @@ -45,8 +45,10 @@
diff --git a/public/app/plugins/panel/graph/series_overrides_ctrl.ts b/public/app/plugins/panel/graph/series_overrides_ctrl.ts index 90d61a362ab..fdb8f06c270 100644 --- a/public/app/plugins/panel/graph/series_overrides_ctrl.ts +++ b/public/app/plugins/panel/graph/series_overrides_ctrl.ts @@ -11,7 +11,7 @@ export function SeriesOverridesCtrl($scope, $element, popoverSrv) { const option = { text: name, propertyName: propertyName, - index: $scope.overrideMenu.lenght, + index: $scope.overrideMenu.length, values: values, submenu: _.map(values, value => { return { text: String(value), value: value }; diff --git a/public/app/plugins/panel/graph/tab_display.html b/public/app/plugins/panel/graph/tab_display.html index 976b9bcc940..a6287922cfe 100644 --- a/public/app/plugins/panel/graph/tab_display.html +++ b/public/app/plugins/panel/graph/tab_display.html @@ -1,110 +1,194 @@ +
+
+
Draw Modes
+ + + +
+
+
Mode Options
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+
+
Hover tooltip
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
-
-
-
Draw Modes
- - - -
-
-
Mode Options
-
- -
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
-
-
Hover tooltip
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
+
+
Stacking & Null value
+ + + + +
+ +
+ +
+
+
+
-
-
Stacking & Null value
- - - - -
- -
- -
-
-
-
+
+
+
+ +
+
+ +
+
+ +
-
-
-
- -
-
- -
-
- -
+
+ + +
-
- - -
- -
-
-
- -
- -
-
-
- -
-
+
+
+
+
+ +
+
+
+ +
+
From 9efe7674d6155f2dae5f4ca52a3452f66b9596cc Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Mon, 25 Feb 2019 02:44:36 +0100 Subject: [PATCH 06/16] changelog: adds notes for #14509 and #15179 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fea588259f..dee2adcab4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Unreleased +# 6.0.0 stable (unreleased) + +### Bug Fixes +* **Stackdriver**: fix for float64 bounds for distribution metrics [#14509](https://github.com/grafana/grafana/issues/14509) +* **Stackdriver**: no reducers available for distribution type [#15179](https://github.com/grafana/grafana/issues/15179) + # 6.0.0-beta3 (2019-02-19) ### Minor From 26dcabc2dc6b50abf641c2b20f97d315cce99e16 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Mon, 25 Feb 2019 13:00:18 +0100 Subject: [PATCH 07/16] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dee2adcab4d..2c6aaff5444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ### Bug Fixes * **Stackdriver**: fix for float64 bounds for distribution metrics [#14509](https://github.com/grafana/grafana/issues/14509) * **Stackdriver**: no reducers available for distribution type [#15179](https://github.com/grafana/grafana/issues/15179) +* **Dashboard**: fixes click after scroll in series override menu [#15621](https://github.com/grafana/grafana/issues/15621) +* **MySQL**: fix mysql query using _interval_ms variable throws error [#14507](https://github.com/grafana/grafana/issues/14507) # 6.0.0-beta3 (2019-02-19) From 0c67194b455a176f132e4139d72415741f897d26 Mon Sep 17 00:00:00 2001 From: bergquist Date: Sat, 23 Feb 2019 23:24:27 +0100 Subject: [PATCH 08/16] moves tracing packge into /infra --- pkg/cmd/grafana-server/server.go | 2 +- pkg/{ => infra}/tracing/tracing.go | 0 pkg/{ => infra}/tracing/tracing_test.go | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename pkg/{ => infra}/tracing/tracing.go (100%) rename pkg/{ => infra}/tracing/tracing_test.go (100%) diff --git a/pkg/cmd/grafana-server/server.go b/pkg/cmd/grafana-server/server.go index a1db5cd4b4c..e27db3d874d 100644 --- a/pkg/cmd/grafana-server/server.go +++ b/pkg/cmd/grafana-server/server.go @@ -30,6 +30,7 @@ import ( _ "github.com/grafana/grafana/pkg/extensions" _ "github.com/grafana/grafana/pkg/infra/metrics" _ "github.com/grafana/grafana/pkg/infra/serverlock" + _ "github.com/grafana/grafana/pkg/infra/tracing" _ "github.com/grafana/grafana/pkg/plugins" _ "github.com/grafana/grafana/pkg/services/alerting" _ "github.com/grafana/grafana/pkg/services/auth" @@ -39,7 +40,6 @@ import ( _ "github.com/grafana/grafana/pkg/services/rendering" _ "github.com/grafana/grafana/pkg/services/search" _ "github.com/grafana/grafana/pkg/services/sqlstore" - _ "github.com/grafana/grafana/pkg/tracing" ) func NewGrafanaServer() *GrafanaServerImpl { diff --git a/pkg/tracing/tracing.go b/pkg/infra/tracing/tracing.go similarity index 100% rename from pkg/tracing/tracing.go rename to pkg/infra/tracing/tracing.go diff --git a/pkg/tracing/tracing_test.go b/pkg/infra/tracing/tracing_test.go similarity index 100% rename from pkg/tracing/tracing_test.go rename to pkg/infra/tracing/tracing_test.go From 60fef31748fde5e97f34dc7b01b817282ee46535 Mon Sep 17 00:00:00 2001 From: bergquist Date: Sat, 23 Feb 2019 23:39:05 +0100 Subject: [PATCH 09/16] moves social package to /login ref #14679 --- pkg/api/login_oauth.go | 2 +- pkg/cmd/grafana-server/server.go | 2 +- pkg/infra/usagestats/service.go | 2 +- pkg/{ => login}/social/common.go | 0 pkg/{ => login}/social/generic_oauth.go | 0 pkg/{ => login}/social/github_oauth.go | 0 pkg/{ => login}/social/gitlab_oauth.go | 0 pkg/{ => login}/social/google_oauth.go | 0 pkg/{ => login}/social/grafana_com_oauth.go | 0 pkg/{ => login}/social/social.go | 0 10 files changed, 3 insertions(+), 3 deletions(-) rename pkg/{ => login}/social/common.go (100%) rename pkg/{ => login}/social/generic_oauth.go (100%) rename pkg/{ => login}/social/github_oauth.go (100%) rename pkg/{ => login}/social/gitlab_oauth.go (100%) rename pkg/{ => login}/social/google_oauth.go (100%) rename pkg/{ => login}/social/grafana_com_oauth.go (100%) rename pkg/{ => login}/social/social.go (100%) diff --git a/pkg/api/login_oauth.go b/pkg/api/login_oauth.go index 7d9537b4790..a4c4a064226 100644 --- a/pkg/api/login_oauth.go +++ b/pkg/api/login_oauth.go @@ -19,9 +19,9 @@ import ( "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/log" "github.com/grafana/grafana/pkg/login" + "github.com/grafana/grafana/pkg/login/social" m "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/setting" - "github.com/grafana/grafana/pkg/social" ) var ( diff --git a/pkg/cmd/grafana-server/server.go b/pkg/cmd/grafana-server/server.go index a1db5cd4b4c..b4f0fa3a2d2 100644 --- a/pkg/cmd/grafana-server/server.go +++ b/pkg/cmd/grafana-server/server.go @@ -16,9 +16,9 @@ import ( "github.com/grafana/grafana/pkg/api/routing" "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/login" + "github.com/grafana/grafana/pkg/login/social" "github.com/grafana/grafana/pkg/middleware" "github.com/grafana/grafana/pkg/registry" - "github.com/grafana/grafana/pkg/social" "golang.org/x/sync/errgroup" diff --git a/pkg/infra/usagestats/service.go b/pkg/infra/usagestats/service.go index c2bf0d06349..ccebf6a17f4 100644 --- a/pkg/infra/usagestats/service.go +++ b/pkg/infra/usagestats/service.go @@ -5,8 +5,8 @@ import ( "time" "github.com/grafana/grafana/pkg/bus" + "github.com/grafana/grafana/pkg/login/social" "github.com/grafana/grafana/pkg/services/sqlstore" - "github.com/grafana/grafana/pkg/social" "github.com/grafana/grafana/pkg/log" "github.com/grafana/grafana/pkg/registry" diff --git a/pkg/social/common.go b/pkg/login/social/common.go similarity index 100% rename from pkg/social/common.go rename to pkg/login/social/common.go diff --git a/pkg/social/generic_oauth.go b/pkg/login/social/generic_oauth.go similarity index 100% rename from pkg/social/generic_oauth.go rename to pkg/login/social/generic_oauth.go diff --git a/pkg/social/github_oauth.go b/pkg/login/social/github_oauth.go similarity index 100% rename from pkg/social/github_oauth.go rename to pkg/login/social/github_oauth.go diff --git a/pkg/social/gitlab_oauth.go b/pkg/login/social/gitlab_oauth.go similarity index 100% rename from pkg/social/gitlab_oauth.go rename to pkg/login/social/gitlab_oauth.go diff --git a/pkg/social/google_oauth.go b/pkg/login/social/google_oauth.go similarity index 100% rename from pkg/social/google_oauth.go rename to pkg/login/social/google_oauth.go diff --git a/pkg/social/grafana_com_oauth.go b/pkg/login/social/grafana_com_oauth.go similarity index 100% rename from pkg/social/grafana_com_oauth.go rename to pkg/login/social/grafana_com_oauth.go diff --git a/pkg/social/social.go b/pkg/login/social/social.go similarity index 100% rename from pkg/social/social.go rename to pkg/login/social/social.go From 38a116d0f774d9c486167cd780f44fbec8e22fdd Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Mon, 25 Feb 2019 15:45:35 +0100 Subject: [PATCH 10/16] docs: grafana 6.0 has been released. --- docs/sources/guides/whats-new-in-v6-0.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/sources/guides/whats-new-in-v6-0.md b/docs/sources/guides/whats-new-in-v6-0.md index c7091fd855e..24a32311954 100644 --- a/docs/sources/guides/whats-new-in-v6-0.md +++ b/docs/sources/guides/whats-new-in-v6-0.md @@ -14,8 +14,6 @@ weight = -11 This update to Grafana introduces a new way of exploring your data, support for log data and tons of other features. -Grafana v6.0 is out in **Beta**, [Download Now!](https://grafana.com/grafana/download/beta) - The main highlights are: - [Explore]({{< relref "#explore" >}}) - A new query focused workflow for ad-hoc data exploration and troubleshooting. From e1d27bd79afd1cc76e84bdcfdc3beb8de488de49 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Mon, 25 Feb 2019 16:24:02 +0100 Subject: [PATCH 11/16] Update CHANGELOG.md --- CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c6aaff5444..d67030873c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,4 @@ -# Unreleased - -# 6.0.0 stable (unreleased) +# 6.0.0 stable (2019-02-25) ### Bug Fixes * **Stackdriver**: fix for float64 bounds for distribution metrics [#14509](https://github.com/grafana/grafana/issues/14509) From 3c3e06515e0e91b9319de57ec1021f93482aa3c5 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Mon, 25 Feb 2019 17:09:49 +0100 Subject: [PATCH 12/16] Updated latest.json with 6.0 --- latest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latest.json b/latest.json index dc83446f588..7e69b431a4d 100644 --- a/latest.json +++ b/latest.json @@ -1,4 +1,4 @@ { - "stable": "5.4.3", - "testing": "5.4.3" + "stable": "6.0.0", + "testing": "6.0.0" } From c04395ce3a6e856380d9488c8fed39cc079cb8cc Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Mon, 25 Feb 2019 19:25:47 +0100 Subject: [PATCH 13/16] docs: 6.0 whats new --- docs/sources/guides/whats-new-in-v6-0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/sources/guides/whats-new-in-v6-0.md b/docs/sources/guides/whats-new-in-v6-0.md index 24a32311954..7c61df1c3c4 100644 --- a/docs/sources/guides/whats-new-in-v6-0.md +++ b/docs/sources/guides/whats-new-in-v6-0.md @@ -105,9 +105,9 @@ continue to refine and start using in other panels. ### React Panels & Query Editors A major part of all the work that has gone into Grafana v6.0 has been on the migration to React. This investment -is part of the future proofing of Grafana and it's code base and ecosystem. Starting in v6.0 **Panels** and **Data +is part of the future proofing of Grafana's code base and ecosystem. Starting in v6.0 **Panels** and **Data source** plugins can be written in React using our published `@grafana/ui` sdk library. More information on this -will be shared closer to or just after release. +will be shared soon. {{< docs-imagebox img="/img/docs/v60/react_panels.png" max-width="600px" caption="React Panel" >}}
@@ -120,7 +120,7 @@ To get started read the guide: [Using Google Stackdriver in Grafana](/features/d ## Azure Monitor Datasource -One of the goals of the Grafana v6.0 release is to add support for the three major clouds. Amazon Cloudwatch has been a core datasource for years and Google Stackdriver is also now supported. We developed an external plugin for Azure Monitor last year and for this release the [plugin](https://grafana.com/plugins/grafana-azure-monitor-datasource) is being moved into Grafana to be one of the built-in datasources. For users of the external plugin, Grafana will automatically start using the built-in version. As a core datasource, the Azure Monitor datasource will get alerting support for the official 6.0 release. +One of the goals of the Grafana v6.0 release is to add support for the three major clouds. Amazon Cloudwatch has been a core datasource for years and Google Stackdriver is also now supported. We developed an external plugin for Azure Monitor last year and for this release the [plugin](https://grafana.com/plugins/grafana-azure-monitor-datasource) is being moved into Grafana to be one of the built-in datasources. For users of the external plugin, Grafana will automatically start using the built-in version. As a core datasource, the Azure Monitor datasource is able to get alerting support, in the 6.0 release alerting is supported for the Azure Monitor service, with the rest to follow. The Azure Monitor datasource integrates four Azure services with Grafana - Azure Monitor, Azure Log Analytics, Azure Application Insights and Azure Application Insights Analytics. From 1bffde57e35ece5b64532fc0d34cff685bcc777d Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Tue, 26 Feb 2019 09:22:21 -0800 Subject: [PATCH 14/16] Need this to be available for plugins --- packages/grafana-ui/src/utils/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/grafana-ui/src/utils/index.ts b/packages/grafana-ui/src/utils/index.ts index 52a8535f9e1..c5f4b2c5b1b 100644 --- a/packages/grafana-ui/src/utils/index.ts +++ b/packages/grafana-ui/src/utils/index.ts @@ -2,3 +2,4 @@ export * from './processTimeSeries'; export * from './valueFormats/valueFormats'; export * from './colors'; export * from './namedColorsPalette'; +export { getMappedValue } from './valueMappings'; From 8bdf2111c49e3aa3df1de38cb6810f865594f8cf Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Tue, 26 Feb 2019 11:51:52 -0800 Subject: [PATCH 15/16] Bumping grafana ui version (#15669) grafana/ui 6.0.1-alpha.0 release version bump --- packages/grafana-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grafana-ui/package.json b/packages/grafana-ui/package.json index 2c4db3e30af..6c28c8abbd3 100644 --- a/packages/grafana-ui/package.json +++ b/packages/grafana-ui/package.json @@ -1,6 +1,6 @@ { "name": "@grafana/ui", - "version": "6.0.0-alpha.0", + "version": "6.0.1-alpha.0", "description": "Grafana Components Library", "keywords": [ "typescript", From 539333bb0159d0d7bafc6ccb0c61acd975e15608 Mon Sep 17 00:00:00 2001 From: David Kaltschmidt Date: Tue, 26 Feb 2019 14:21:46 -0800 Subject: [PATCH 16/16] Explore: Enable click on name label - click on the name label in a prometheus table was disabled - it was disabled because every query used to have a metric which is no longer true - this change enables it --- .../app/plugins/datasource/prometheus/result_transformer.ts | 2 +- .../datasource/prometheus/specs/result_transformer.test.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/result_transformer.ts b/public/app/plugins/datasource/prometheus/result_transformer.ts index 3c21e0c3d51..c3fbd7ee1d7 100644 --- a/public/app/plugins/datasource/prometheus/result_transformer.ts +++ b/public/app/plugins/datasource/prometheus/result_transformer.ts @@ -100,7 +100,7 @@ export class ResultTransformer { table.columns.push({ text: 'Time', type: 'time' }); _.each(sortedLabels, (label, labelIndex) => { metricLabels[label] = labelIndex + 1; - table.columns.push({ text: label, filterable: !label.startsWith('__') }); + table.columns.push({ text: label, filterable: true }); }); const valueText = resultCount > 1 || valueWithRefId ? `Value #${refId}` : 'Value'; table.columns.push({ text: valueText }); diff --git a/public/app/plugins/datasource/prometheus/specs/result_transformer.test.ts b/public/app/plugins/datasource/prometheus/specs/result_transformer.test.ts index d7e42237f8a..3c376334187 100644 --- a/public/app/plugins/datasource/prometheus/specs/result_transformer.test.ts +++ b/public/app/plugins/datasource/prometheus/specs/result_transformer.test.ts @@ -66,11 +66,12 @@ describe('Prometheus Result Transformer', () => { ]); expect(table.columns).toMatchObject([ { text: 'Time', type: 'time' }, - { text: '__name__' }, - { text: 'instance' }, + { text: '__name__', filterable: true }, + { text: 'instance', filterable: true }, { text: 'job' }, { text: 'Value' }, ]); + expect(table.columns[4].filterable).toBeUndefined(); }); it('should column title include refId if response count is more than 2', () => {