diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fea588259f..d67030873c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -# 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) +* **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) diff --git a/docs/sources/guides/whats-new-in-v6-0.md b/docs/sources/guides/whats-new-in-v6-0.md index c7091fd855e..7c61df1c3c4 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. @@ -107,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" >}}
@@ -122,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. 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" } 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", 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'; 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..a4c4a064226 100644 --- a/pkg/api/login_oauth.go +++ b/pkg/api/login_oauth.go @@ -16,12 +16,12 @@ 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" + "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/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..b454b362d90 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" @@ -28,8 +28,9 @@ 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/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/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/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 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/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/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 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" ) 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"` } 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/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 @@ - + 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/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', () => { 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
{ 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
- - - - -
- -
- -
-
-
-
+
+
+
+ +
+
+ +
+
+ +
-
-
-
- -
-
- -
-
- -
+
+ + +
-
- - -
- -
-
-
- -
- -
-
-
- -
-
+
+
+
+
+ +
+
+
+ +
+