diff --git a/.gitignore b/.gitignore index 1ab7068c96a..08cfb7a2931 100644 --- a/.gitignore +++ b/.gitignore @@ -9,13 +9,12 @@ awsconfig /public/vendor/npm /tmp vendor/phantomjs/phantomjs +vendor/phantomjs/phantomjs.exe docs/AWS_S3_BUCKET docs/GIT_BRANCH -docs/VERSION docs/GITCOMMIT docs/changed-files -docs/changed-files # locally required config files public/css/*.min.css diff --git a/CHANGELOG.md b/CHANGELOG.md index f2e27dade77..fbad5f7f0f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -# 4.4.0 (unreleased) +# 4.4.1 (2017-07-05) + +## Bug Fixes + +* **Migrations**: migration fails where dashboard.created_by is null [#8783](https://github.com/grafana/grafana/issues/8783) + +# 4.4.0 (2017-07-04) ## New Features **Dashboard History**: View dashboard version history, compare any two versions (summary & json diffs), restore to old version. This big feature @@ -10,6 +16,16 @@ Pull Request: [#8472](https://github.com/grafana/grafana/pull/8472) * **Elasticsearch**: Added filter aggregation label [#8420](https://github.com/grafana/grafana/pull/8420), thx [@tianzk](github.com/tianzk) * **Sensu**: Added option for source and handler [#8405](https://github.com/grafana/grafana/pull/8405), thx [@joemiller](github.com/joemiller) * **CSV**: Configurable csv export datetime format [#8058](https://github.com/grafana/grafana/issues/8058), thx [@cederigo](github.com/cederigo) +* **Table Panel**: Column style that preserves formatting/indentation (like pre tag) [#6617](https://github.com/grafana/grafana/issues/6617) +* **DingDing**: Add DingDing Alert Notifier [#8473](https://github.com/grafana/grafana/pull/8473) thx [@jiamliang](https://github.com/jiamliang) + +## Minor Enhancements + +* **Elasticsearch**: Add option for result set size in raw_document [#3426](https://github.com/grafana/grafana/issues/3426) [#8527](https://github.com/grafana/grafana/pull/8527), thx [@mk-dhia](github.com/mk-dhia) + +## Bug Fixes + +* **Graph**: Bug fix for negative values in histogram mode [#8628](https://github.com/grafana/grafana/issues/8628) # 4.3.2 (2017-05-31) diff --git a/README.md b/README.md index 9d2aabebbf3..41f777d5dec 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB. - [What's New in Grafana 4.1](http://docs.grafana.org/guides/whats-new-in-v4-1/) - [What's New in Grafana 4.2](http://docs.grafana.org/guides/whats-new-in-v4-2/) - [What's New in Grafana 4.3](http://docs.grafana.org/guides/whats-new-in-v4-3/) +- [What's New in Grafana 4.4](http://docs.grafana.org/guides/whats-new-in-v4-4/) ## Features diff --git a/appveyor.yml b/appveyor.yml index 303c3abca9e..9f8e9a26622 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,6 +32,7 @@ build_script: - grunt release - go run build.go sha-dist - cp dist/* . + - go test -v ./pkg/... artifacts: - path: grafana-*windows-*.* diff --git a/build.go b/build.go index f60a53e5ddb..a1d1d3012ab 100644 --- a/build.go +++ b/build.go @@ -95,7 +95,9 @@ func main() { case "package": grunt(gruntBuildArg("release")...) - createLinuxPackages() + if runtime.GOOS != "windows" { + createLinuxPackages() + } case "pkg-rpm": grunt(gruntBuildArg("release")...) @@ -345,7 +347,11 @@ func ChangeWorkingDir(dir string) { } func grunt(params ...string) { - runPrint("./node_modules/.bin/grunt", params...) + if runtime.GOOS == "windows" { + runPrint(`.\node_modules\.bin\grunt`, params...) + } else { + runPrint("./node_modules/.bin/grunt", params...) + } } func gruntBuildArg(task string) []string { diff --git a/docs/sources/alerting/notifications.md b/docs/sources/alerting/notifications.md index cd1316eb479..3119390b275 100644 --- a/docs/sources/alerting/notifications.md +++ b/docs/sources/alerting/notifications.md @@ -112,6 +112,8 @@ Grafana also supports the following Notification Channels: - LINE +- DingDing + # Enable images in notifications {#external-image-store} Grafana can render the panel associated with the alert rule and include that in the notification. Most Notification Channels require that this image be publicly accessable (Slack and PagerDuty for example). In order to include images in alert notifications, Grafana can upload the image to an image store. It currently supports diff --git a/docs/sources/features/datasources/influxdb.md b/docs/sources/features/datasources/influxdb.md index 2837363e145..39a22085d93 100644 --- a/docs/sources/features/datasources/influxdb.md +++ b/docs/sources/features/datasources/influxdb.md @@ -88,8 +88,8 @@ You can switch to raw query mode by clicking hamburger icon and then `Switch edi - $m = replaced with measurement name - $measurement = replaced with measurement name - $col = replaced with column name -- $tag_hostname = replaced with the value of the hostname tag -- You can also use [[tag_hostname]] pattern replacement syntax +- $tag_exampletag = replaced with the value of the `exampletag` tag. To use your tag as an alias in the ALIAS BY field then the tag must be used to group by in the query. +- You can also use [[tag_hostname]] pattern replacement syntax. For example, in the ALIAS BY field using this text `Host: [[tag_hostname]]` would substitute in the `hostname` tag value for each legend value and an example legend value would be: `Host: server1`. ### Table query / raw data diff --git a/docs/sources/features/datasources/prometheus.md b/docs/sources/features/datasources/prometheus.md index 4b5c3f115e8..ed5d752ab94 100644 --- a/docs/sources/features/datasources/prometheus.md +++ b/docs/sources/features/datasources/prometheus.md @@ -46,7 +46,8 @@ Name | Description *Query expression* | Prometheus query expression, check out the [Prometheus documentation](http://prometheus.io/docs/querying/basics/). *Legend format* | Controls the name of the time series, using name or pattern. For example `{{hostname}}` will be replaced with label value for the label `hostname`. *Min step* | Set a lower limit for the Prometheus step option. Step controls how big the jumps are when the Prometheus query engine performs range queries. Sadly there is no official prometheus documentation to link to for this very important option. -*Resolution* | Controls the step option. Small steps create high-resolution graphs but can be slow over larger time ranges, lowering the resolution can speed things up. `1/2` will try to set step option to generate 1 data point for every other pixel. A value of `1/10` will try to set step option so there is a data point every 10 pixels.*Metric lookup* | Search for metric names in this input field. +*Resolution* | Controls the step option. Small steps create high-resolution graphs but can be slow over larger time ranges, lowering the resolution can speed things up. `1/2` will try to set step option to generate 1 data point for every other pixel. A value of `1/10` will try to set step option so there is a data point every 10 pixels. +*Metric lookup* | Search for metric names in this input field. *Format as* | **(New in v4.3)** Switch between Table & Time series. Table format will only work in the Table panel. ## Templating diff --git a/docs/sources/guides/whats-new-in-v4-4.md b/docs/sources/guides/whats-new-in-v4-4.md new file mode 100644 index 00000000000..e99f3ea3719 --- /dev/null +++ b/docs/sources/guides/whats-new-in-v4-4.md @@ -0,0 +1,50 @@ ++++ +title = "What's New in Grafana v4.4" +description = "Feature & improvement highlights for Grafana v4.4" +keywords = ["grafana", "new", "documentation", "4.4.0"] +type = "docs" +[menu.docs] +name = "Version 4.4" +identifier = "v4.4" +parent = "whatsnew" +weight = -3 ++++ + +## What's New in Grafana v4.4 + +Grafana v4.4 is now [available for download](https://grafana.com/grafana/download/4.4.0). + +**Highlights**: + +- Dashboard History - version control for dashboards. + +## New Features + +**Dashboard History**: View dashboard version history, compare any two versions (summary & json diffs), restore to old version. This big feature +was contributed by **Walmart Labs**. Big thanks to them for this massive contribution! +Initial feature request: [#4638](https://github.com/grafana/grafana/issues/4638) +Pull Request: [#8472](https://github.com/grafana/grafana/pull/8472) + +## Enhancements +* **Elasticsearch**: Added filter aggregation label [#8420](https://github.com/grafana/grafana/pull/8420), thx [@tianzk](github.com/tianzk) +* **Sensu**: Added option for source and handler [#8405](https://github.com/grafana/grafana/pull/8405), thx [@joemiller](github.com/joemiller) +* **CSV**: Configurable csv export datetime format [#8058](https://github.com/grafana/grafana/issues/8058), thx [@cederigo](github.com/cederigo) +* **Table Panel**: Column style that preserves formatting/indentation (like pre tag) [#6617](https://github.com/grafana/grafana/issues/6617) +* **DingDing**: Add DingDing Alert Notifier [#8473](https://github.com/grafana/grafana/pull/8473) thx [@jiamliang](https://github.com/jiamliang) + +## Minor Enhancements + +* **Elasticsearch**: Add option for result set size in raw_document [#3426](https://github.com/grafana/grafana/issues/3426) [#8527](https://github.com/grafana/grafana/pull/8527), thx [@mk-dhia](github.com/mk-dhia) + +## Bug Fixes + +* **Graph**: Bug fix for negative values in histogram mode [#8628](https://github.com/grafana/grafana/issues/8628) + +## Download + +Head to the [v4.4 download page](https://grafana.com/grafana/download) for download links & instructions. + +## Thanks + +A big thanks to all the Grafana users who contribute by submitting PRs, bug reports, helping out on our [community site](https://community.grafana.com/) and providing feedback! + diff --git a/docs/sources/http_api/dashboard_versions.md b/docs/sources/http_api/dashboard_versions.md new file mode 100644 index 00000000000..3d0ec27a3a3 --- /dev/null +++ b/docs/sources/http_api/dashboard_versions.md @@ -0,0 +1,321 @@ ++++ +title = "Dashboard Versions HTTP API " +description = "Grafana Dashboard Versions HTTP API" +keywords = ["grafana", "http", "documentation", "api", "dashboard", "versions"] +aliases = ["/http_api/dashboardversions/"] +type = "docs" +[menu.docs] +name = "Dashboard Versions" +parent = "http_api" ++++ + +# Dashboard Versions + +## Get all dashboard versions + +Query parameters: + +- **limit** - Maximum number of results to return +- **start** - Version to start from when returning queries + +`GET /api/dashboards/id/:dashboardId/versions` + +Gets all existing dashboard versions for the dashboard with the given `dashboardId`. + +**Example request for getting all dashboard versions**: + +```http +GET /api/dashboards/id/1/versions?limit=2?start=0 HTTP/1.1 +Accept: application/json +Content-Type: application/json +Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk +``` + +**Example Response** + +```http +HTTP/1.1 200 OK +Content-Type: application/json; charset=UTF-8 +Content-Length: 428 + +[ + { + "id": 2, + "dashboardId": 1, + "parentVersion": 1, + "restoredFrom": 0, + "version": 2, + "created": "2017-06-08T17:24:33-04:00", + "createdBy": "admin", + "message": "Updated panel title" + }, + { + "id": 1, + "dashboardId": 1, + "parentVersion": 0, + "restoredFrom": 0, + "version": 1, + "created": "2017-06-08T17:23:33-04:00", + "createdBy": "admin", + "message": "Initial save" + } +] +``` + +Status Codes: + +- **200** - Ok +- **400** - Errors +- **401** - Unauthorized +- **404** - Dashboard version not found + +## Get dashboard version + +`GET /api/dashboards/id/:dashboardId/versions/:id` + +Get the dashboard version with the given id, for the dashboard with the given id. + +**Example request for getting a dashboard version**: + +```http +GET /api/dashboards/id/1/versions/1 HTTP/1.1 +Accept: application/json +Content-Type: application/json +Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk +``` + +**Example response**: + +```http +HTTP/1.1 200 OK +Content-Type: application/json; charset=UTF-8 +Content-Length: 1300 + +{ + "id": 1, + "dashboardId": 1, + "parentVersion": 0, + "restoredFrom": 0, + "version": 1, + "created": "2017-04-26T17:18:38-04:00", + "message": "Initial save", + "data": { + "annotations": { + "list": [ + + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "hideControls": false, + "id": 1, + "links": [ + + ], + "rows": [ + { + "collapse": false, + "height": "250px", + "panels": [ + + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" + } + ], + "schemaVersion": 14, + "style": "dark", + "tags": [ + + ], + "templating": { + "list": [ + + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "test", + "version": 1 + }, + "createdBy": "admin" +} +``` + +Status Codes: + +- **200** - Ok +- **401** - Unauthorized +- **404** - Dashboard version not found + +## Restore dashboard + +`POST /api/dashboards/id/:dashboardId/restore` + +Restores a dashboard to a given dashboard version. + +**Example request for restoring a dashboard version**: + +```http +POST /api/dashboards/id/1/restore +Accept: application/json +Content-Type: application/json +Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + +{ + "version": 1 +} +``` + +JSON body schema: + +- **version** - The dashboard version to restore to + +**Example response**: + +```http +HTTP/1.1 200 OK +Content-Type: application/json; charset=UTF-8 +Content-Length: 67 + +{ + "slug": "my-dashboard", + "status": "success", + "version": 3 +} +``` + +JSON response body schema: + +- **slug** - the URL friendly slug of the dashboard's title +- **status** - whether the restoration was successful or not +- **version** - the new dashboard version, following the restoration + +Status codes: + +- **200** - OK +- **401** - Unauthorized +- **404** - Not found (dashboard not found or dashboard version not found) +- **500** - Internal server error (indicates issue retrieving dashboard tags from database) + +**Example error response** + +```http +HTTP/1.1 404 Not Found +Content-Type: application/json; charset=UTF-8 +Content-Length: 46 + +{ + "message": "Dashboard version not found" +} +``` + +JSON response body schema: + +- **message** - Message explaining the reason for the request failure. + +## Compare dashboard versions + +`POST /api/dashboards/calculate-diff` + +Compares two dashboard versions by calculating the JSON diff of them. + +**Example request**: + +```http +POST /api/dashboards/calculate-diff HTTP/1.1 +Accept: text/html +Content-Type: application/json +Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + +{ + "base": { + "dashboardId": 1, + "version": 1 + }, + "new": { + "dashboardId": 1, + "version": 2 + }, + "diffType": "json" +} +``` + +JSON body schema: + +- **base** - an object representing the base dashboard version +- **new** - an object representing the new dashboard version +- **diffType** - the type of diff to return. Can be "json" or "basic". + +**Example response (JSON diff)**: + +```http +HTTP/1.1 200 OK +Content-Type: text/html; charset=UTF-8 + +
+ +
+``` + +The response is a textual respresentation of the diff, with the dashboard values being in JSON, similar to the diffs seen on sites like GitHub or GitLab. + +Status Codes: + +- **200** - Ok +- **400** - Bad request (invalid JSON sent) +- **401** - Unauthorized +- **404** - Not found + +**Example response (basic diff)**: + +```http +HTTP/1.1 200 OK +Content-Type: text/html; charset=UTF-8 + +