Skip to content

Commit dddbe62

Browse files
committed
Merge branch 'master' into react-panels-step1
2 parents ae7a1bc + 5c95a01 commit dddbe62

File tree

99 files changed

+1500
-2252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1500
-2252
lines changed

.bra.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ init_cmds = [
44
["./bin/grafana-server", "cfg:app_mode=development"]
55
]
66
watch_all = true
7+
follow_symlinks = true
78
watch_dirs = [
89
"$WORKDIR/pkg",
910
"$WORKDIR/public/views",

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ jobs:
170170
- scripts/*.sh
171171
- scripts/publish
172172
- scripts/build/release_publisher/release_publisher
173+
- scripts/build/publish.sh
173174

174175
build:
175176
docker:

CHANGELOG.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,37 @@
22

33
### New Features
44

5+
* **Alerting**: Option to disable OK alert notifications [#12330](https://github.com/grafana/grafana/issues/12330) & [#6696](https://github.com/grafana/grafana/issues/6696), thx [@davewat](https://github.com/davewat)
56
* **Postgres/MySQL/MSSQL**: Adds support for configuration of max open/idle connections and connection max lifetime. Also, panels with multiple SQL queries will now be executed concurrently [#11711](https://github.com/grafana/grafana/issues/11711), thx [@connection-reset](https://github.com/connection-reset)
7+
* **MSSQL**: Add encrypt setting to allow configuration of how data sent between client and server are encrypted [#13629](https://github.com/grafana/grafana/issues/13629), thx [@ramiro](https://github.com/ramiro)
8+
* **MySQL**: Support connecting thru Unix socket for MySQL datasource [#12342](https://github.com/grafana/grafana/issues/12342), thx [@Yukinoshita-Yukino](https://github.com/Yukinoshita-Yukino)
69

710
### Minor
811

9-
* **Datasource Proxy**: Keep trailing slash for datasource proxy requests [#13326](https://github.com/grafana/grafana/pull/13326), thx [@ryantxu](https://github.com/ryantxu)
10-
* **Elasticsearch**: Fix no limit size in terms aggregation for alerting queries [#13172](https://github.com/grafana/grafana/issues/13172), thx [@Yukinoshita-Yukino](https://github.com/Yukinoshita-Yukino)
12+
* **Cloudwatch**: Show all available CloudWatch regions [#12308](https://github.com/grafana/grafana/issues/12308), thx [@mtanda](https://github.com/mtanda)
1113
* **Units**: New clock time format, to format ms or second values as for example `01h:59m`, [#13635](https://github.com/grafana/grafana/issues/13635), thx [@franciscocpg](https://github.com/franciscocpg)
14+
* **Datasource Proxy**: Keep trailing slash for datasource proxy requests [#13326](https://github.com/grafana/grafana/pull/13326), thx [@ryantxu](https://github.com/ryantxu)
1215

1316
### Breaking changes
1417

1518
* Postgres/MySQL/MSSQL datasources now per default uses `max open connections` = `unlimited` (earlier 10), `max idle connections` = `2` (earlier 10) and `connection max lifetime` = `4` hours (earlier unlimited)
1619

17-
# 5.3.1 (unreleased)
20+
# 5.3.2 (unreleased)
21+
22+
* **Postgres**: Fix template variables error [#13692](https://github.com/grafana/grafana/issues/13692), thx [@svenklemm](https://github.com/svenklemm)
23+
* **Cloudwatch**: Fix service panic because of race conditions [#13674](https://github.com/grafana/grafana/issues/13674), thx [@mtanda](https://github.com/mtanda)
24+
25+
# 5.3.1 (2018-10-16)
1826

1927
* **Render**: Fix PhantomJS render of graph panel when legend displayed as table to the right [#13616](https://github.com/grafana/grafana/issues/13616)
2028
* **Stackdriver**: Filter option disappears after removing initial filter [#13607](https://github.com/grafana/grafana/issues/13607)
29+
* **Elasticsearch**: Fix no limit size in terms aggregation for alerting queries [#13172](https://github.com/grafana/grafana/issues/13172), thx [@Yukinoshita-Yukino](https://github.com/Yukinoshita-Yukino)
30+
* **InfluxDB**: Fix for annotation issue that caused text to be shown twice [#13553](https://github.com/grafana/grafana/issues/13553)
31+
* **Variables**: Fix nesting variables leads to exception and missing refresh [#13628](https://github.com/grafana/grafana/issues/13628)
32+
* **Variables**: Prometheus: Single letter labels are not supported [#13641](https://github.com/grafana/grafana/issues/13641), thx [@olshansky](https://github.com/olshansky)
33+
* **Graph**: Fix graph time formatting for Last 24h ranges [#13650](https://github.com/grafana/grafana/issues/13650)
34+
* **Playlist**: Fix cannot add dashboards with long names to playlist [#13464](https://github.com/grafana/grafana/issues/13464), thx [@neufeldtech](https://github.com/neufeldtech)
35+
* **HTTP API**: Fix /api/org/users so that query and limit querystrings works
2136

2237
# 5.3.0 (2018-10-10)
2338

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ the latest master builds [here](https://grafana.com/grafana/download)
2424

2525
### Dependencies
2626

27-
- Go 1.11
27+
- Go (Latest Stable)
2828
- NodeJS LTS
2929

3030
### Building the backend
@@ -69,15 +69,27 @@ bra run
6969

7070
Open grafana in your browser (default: `http://localhost:3000`) and login with admin user (default: `user/pass = admin/admin`).
7171

72-
### Building a docker image (on linux/amd64)
72+
### Building a Docker image
7373

74-
This builds a docker image from your local sources:
74+
There are two different ways to build a Grafana docker image. If you're machine is setup for Grafana development and you run linux/amd64 you can build just the image. Otherwise, there is the option to build Grafana completely within Docker.
75+
76+
Run the image you have built using: `docker run --rm -p 3000:3000 grafana/grafana:dev`
77+
78+
#### Building on linux/amd64 (fast)
7579

7680
1. Build the frontend `go run build.go build-frontend`
7781
2. Build the docker image `make build-docker-dev`
7882

7983
The resulting image will be tagged as `grafana/grafana:dev`
8084

85+
#### Building anywhere (slower)
86+
87+
Choose this option to build on platforms other than linux/amd64 and/or not have to setup the Grafana development environment.
88+
89+
1. `make build-docker-full` or `docker build -t grafana/grafana:dev .`
90+
91+
The resulting image will be tagged as `grafana/grafana:dev`
92+
8193
### Dev config
8294

8395
Create a custom.ini in the conf directory to override default configuration options.
@@ -113,18 +125,6 @@ GRAFANA_TEST_DB=mysql go test ./pkg/...
113125
GRAFANA_TEST_DB=postgres go test ./pkg/...
114126
```
115127

116-
## Building custom docker image
117-
118-
You can build a custom image using Docker, which doesn't require installing any dependencies besides docker itself.
119-
```bash
120-
git clone https://github.com/grafana/grafana
121-
cd grafana
122-
docker build -t grafana:dev .
123-
docker run -d --name=grafana -p 3000:3000 grafana:dev
124-
```
125-
126-
Open grafana in your browser (default: `http://localhost:3000`) and login with admin user (default: `user/pass = admin/admin`).
127-
128128
## Contribute
129129

130130
If you have any idea for an improvement or found a bug, do not hesitate to open an issue.
@@ -138,5 +138,5 @@ plugin development.
138138

139139
## License
140140

141-
Grafana is distributed under Apache 2.0 License.
141+
Grafana is distributed under [Apache 2.0 License](https://github.com/grafana/grafana/blob/master/LICENSE.md).
142142

UPGRADING_DEPENDENCIES.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Guide to Upgrading Dependencies
2+
3+
Upgrading Go or Node.js requires making changes in many different files. See below for a list and explanation for each.
4+
5+
## Go
6+
7+
- CircleCi
8+
- `grafana/build-container`
9+
- Appveyor
10+
- Dockerfile
11+
12+
## Node.js
13+
14+
- CircleCI
15+
- `grafana/build-container`
16+
- Appveyor
17+
- Dockerfile
18+
19+
## Go Dependencies
20+
21+
Updated using `dep`.
22+
23+
- `Gopkg.toml`
24+
- `Gopkg.lock`
25+
26+
## Node.js Dependencies
27+
28+
Updated using `yarn`.
29+
30+
- `package.json`
31+
32+
## Where to make changes
33+
34+
### CircleCI
35+
36+
Our builds run on CircleCI through our build script.
37+
38+
#### Files
39+
40+
- `.circleci/config.yml`.
41+
42+
#### Dependencies
43+
44+
- nodejs
45+
- golang
46+
- grafana/build-container (our custom docker build container)
47+
48+
### grafana/build-container
49+
50+
The main build step (in CircleCI) is built using a custom build container that comes pre-baked with some of the neccesary dependencies.
51+
52+
Link: [grafana-build-container](https://github.com/grafana/grafana-build-container)
53+
54+
#### Dependencies
55+
56+
- fpm
57+
- nodejs
58+
- golang
59+
- crosscompiling (several compilers)
60+
61+
### Appveyor
62+
63+
Master and release builds trigger test runs on Appveyors build environment so that tests will run on Windows.
64+
65+
#### Files:
66+
67+
- `appveyor.yml`
68+
69+
#### Dependencies
70+
71+
- nodejs
72+
- golang
73+
74+
### Dockerfile
75+
76+
There is a Docker build for Grafana in the root of the project that allows anyone to build Grafana just using Docker.
77+
78+
#### Files
79+
80+
- `Dockerfile`
81+
82+
#### Dependencies
83+
84+
- nodejs
85+
- golang
86+
87+
### Local developer environments
88+
89+
Please send out a notice in the grafana-dev slack channel when updating Go or Node.js to make it easier for everyone to update their local developer environments.

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ os: Windows Server 2012 R2
55
clone_folder: c:\gopath\src\github.com\grafana\grafana
66

77
environment:
8-
nodejs_version: "6"
8+
nodejs_version: "8"
99
GOPATH: C:\gopath
1010
GOVERSION: 1.11
1111

docs/sources/administration/provisioning.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,17 @@ Since not all datasources have the same configuration settings we only have the
156156
| tlsSkipVerify | boolean | *All* | Controls whether a client verifies the server's certificate chain and host name. |
157157
| graphiteVersion | string | Graphite | Graphite version |
158158
| timeInterval | string | Prometheus, Elasticsearch, InfluxDB, MySQL, PostgreSQL & MSSQL | Lowest interval/step value that should be used for this data source |
159-
| esVersion | number | Elastic | Elasticsearch version as a number (2/5/56) |
160-
| timeField | string | Elastic | Which field that should be used as timestamp |
161-
| interval | string | Elastic | Index date time format |
159+
| esVersion | number | Elasticsearch | Elasticsearch version as a number (2/5/56) |
160+
| timeField | string | Elasticsearch | Which field that should be used as timestamp |
161+
| interval | string | Elasticsearch | Index date time format |
162162
| authType | string | Cloudwatch | Auth provider. keys/credentials/arn |
163163
| assumeRoleArn | string | Cloudwatch | ARN of Assume Role |
164164
| defaultRegion | string | Cloudwatch | AWS region |
165165
| customMetricsNamespaces | string | Cloudwatch | Namespaces of Custom Metrics |
166166
| tsdbVersion | string | OpenTSDB | Version |
167167
| tsdbResolution | string | OpenTSDB | Resolution |
168168
| sslmode | string | PostgreSQL | SSLmode. 'disable', 'require', 'verify-ca' or 'verify-full' |
169+
| encrypt | string | MSSQL | Connection SSL encryption handling. 'disable', 'false' or 'true' |
169170
| postgresVersion | number | PostgreSQL | Postgres version as a number (903/904/905/906/1000) meaning v9.3, v9.4, ..., v10 |
170171
| timescaledb | boolean | PostgreSQL | Enable usage of TimescaleDB extension |
171172
| maxOpenConns | number | MySQL, PostgreSQL & MSSQL | Maximum number of open connections to the database (Grafana v5.4+) |

docs/sources/alerting/notifications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Example json body:
128128

129129
In DingTalk PC Client:
130130

131-
1. Click "more" icon on left bottom of the panel.
131+
1. Click "more" icon on upper right of the panel.
132132

133133
2. Click "Robot Manage" item in the pop menu, there will be a new panel call "Robot Manage".
134134

docs/sources/features/datasources/cloudwatch.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Checkout AWS docs on [IAM Roles](http://docs.aws.amazon.com/AWSEC2/latest/UserGu
4646
## IAM Policies
4747

4848
Grafana needs permissions granted via IAM to be able to read CloudWatch metrics
49-
and EC2 tags/instances. You can attach these permissions to IAM roles and
49+
and EC2 tags/instances/regions. You can attach these permissions to IAM roles and
5050
utilize Grafana's built-in support for assuming roles.
5151

5252
Here is a minimal policy example:
@@ -65,11 +65,12 @@ Here is a minimal policy example:
6565
"Resource": "*"
6666
},
6767
{
68-
"Sid": "AllowReadingTagsFromEC2",
68+
"Sid": "AllowReadingTagsInstancesRegionsFromEC2",
6969
"Effect": "Allow",
7070
"Action": [
7171
"ec2:DescribeTags",
72-
"ec2:DescribeInstances"
72+
"ec2:DescribeInstances",
73+
"ec2:DescribeRegions"
7374
],
7475
"Resource": "*"
7576
}

docs/sources/features/datasources/mssql.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Name | Description
3232
*Database* | Name of your MSSQL database.
3333
*User* | Database user's login/username
3434
*Password* | Database user's password
35+
*Encrypt* | This option determines whether or to which extent a secure SSL TCP/IP connection will be negotiated with the server, default `false` (Grafana v5.4+).
3536
*Max open* | The maximum number of open connections to the database, default `unlimited` (Grafana v5.4+).
3637
*Max idle* | The maximum number of connections in the idle connection pool, default `2` (Grafana v5.4+).
3738
*Max lifetime* | The maximum amount of time in seconds a connection may be reused, default `14400`/4 hours (Grafana v5.4+).
@@ -72,8 +73,8 @@ Make sure the user does not get any unwanted privileges from the public role.
7273

7374
### Known Issues
7475

75-
MSSQL 2008 and 2008 R2 engine cannot handle login records when SSL encryption is not disabled. Due to this you may receive an `Login error: EOF` error when trying to create your datasource.
76-
To fix MSSQL 2008 R2 issue, install MSSQL 2008 R2 Service Pack 2. To fix MSSQL 2008 issue, install Microsoft MSSQL 2008 Service Pack 3 and Cumulative update package 3 for MSSQL 2008 SP3.
76+
If you're using an older version of Microsoft SQL Server like 2008 and 2008R2 you may need to disable encryption to be able to connect.
77+
If possible, we recommend you to use the latest service pack available for optimal compatibility.
7778

7879
## Query Editor
7980

docs/sources/installation/docker.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ docker run \
8787

8888
## Building a custom Grafana image with pre-installed plugins
8989

90-
In the [grafana-docker](https://github.com/grafana/grafana-docker/) there is a folder called `custom/` which includes a `Dockerfile` that can be used to build a custom Grafana image. It accepts `GRAFANA_VERSION` and `GF_INSTALL_PLUGINS` as build arguments.
90+
In the [grafana-docker](https://github.com/grafana/grafana/tree/master/packaging/docker) there is a folder called `custom/` which includes a `Dockerfile` that can be used to build a custom Grafana image. It accepts `GRAFANA_VERSION` and `GF_INSTALL_PLUGINS` as build arguments.
9191

9292
Example of how to build and run:
9393
```bash
@@ -103,6 +103,21 @@ docker run \
103103
grafana:latest-with-plugins
104104
```
105105

106+
## Installing Plugins from other sources
107+
108+
> Only available in Grafana v5.3.1+
109+
110+
It's possible to install plugins from custom url:s by specifying the url like this: `GF_INSTALL_PLUGINS=<url to plugin zip>;<plugin name>`
111+
112+
```bash
113+
docker run \
114+
-d \
115+
-p 3000:3000 \
116+
--name=grafana \
117+
-e "GF_INSTALL_PLUGINS=http://plugin-domain.com/my-custom-plugin.zip;custom-plugin" \
118+
grafana/grafana
119+
```
120+
106121
## Configuring AWS Credentials for CloudWatch Support
107122

108123
```bash

docs/sources/project/building_from_source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dev environment. Grafana ships with its own required backend server; also comple
1313

1414
## Dependencies
1515

16-
- [Go 1.11](https://golang.org/dl/)
16+
- [Go (Latest Stable)](https://golang.org/dl/)
1717
- [Git](https://git-scm.com/downloads)
1818
- [NodeJS LTS](https://nodejs.org/download/)
1919
- node-gyp is the Node.js native addon build tool and it requires extra dependencies: python 2.7, make and GCC. These are already installed for most Linux distros and MacOS. See the Building On Windows section or the [node-gyp installation instructions](https://github.com/nodejs/node-gyp#installation) for more details.

latest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"stable": "5.3.0",
3-
"testing": "5.3.0"
2+
"stable": "5.3.1",
3+
"testing": "5.3.1"
44
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
"react-redux": "^5.0.7",
161161
"react-select": "2.1.0",
162162
"react-sizeme": "^2.3.6",
163+
"react-table": "^6.8.6",
163164
"react-transition-group": "^2.2.1",
164165
"redux": "^4.0.0",
165166
"redux-logger": "^3.0.6",

pkg/api/api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,13 @@ func (hs *HTTPServer) registerRoutes() {
234234
datasourceRoute.Get("/", Wrap(GetDataSources))
235235
datasourceRoute.Post("/", quota("data_source"), bind(m.AddDataSourceCommand{}), Wrap(AddDataSource))
236236
datasourceRoute.Put("/:id", bind(m.UpdateDataSourceCommand{}), Wrap(UpdateDataSource))
237-
datasourceRoute.Delete("/:id", Wrap(DeleteDataSourceByID))
237+
datasourceRoute.Delete("/:id", Wrap(DeleteDataSourceById))
238238
datasourceRoute.Delete("/name/:name", Wrap(DeleteDataSourceByName))
239-
datasourceRoute.Get("/:id", Wrap(GetDataSourceByID))
239+
datasourceRoute.Get("/:id", Wrap(GetDataSourceById))
240240
datasourceRoute.Get("/name/:name", Wrap(GetDataSourceByName))
241241
}, reqOrgAdmin)
242242

243-
apiRoute.Get("/datasources/id/:name", Wrap(GetDataSourceIDByName), reqSignedIn)
243+
apiRoute.Get("/datasources/id/:name", Wrap(GetDataSourceIdByName), reqSignedIn)
244244

245245
apiRoute.Get("/plugins", Wrap(GetPluginList))
246246
apiRoute.Get("/plugins/:pluginId/settings", Wrap(GetPluginSettingByID))

pkg/api/dashboard.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"path"
88

9+
"github.com/grafana/grafana/pkg/services/alerting"
910
"github.com/grafana/grafana/pkg/services/dashboards"
1011

1112
"github.com/grafana/grafana/pkg/api/dtos"
@@ -251,8 +252,8 @@ func PostDashboard(c *m.ReqContext, cmd m.SaveDashboardCommand) Response {
251252
return Error(403, err.Error(), err)
252253
}
253254

254-
if err == m.ErrDashboardContainsInvalidAlertData {
255-
return Error(500, "Invalid alert data. Cannot save dashboard", err)
255+
if validationErr, ok := err.(alerting.ValidationError); ok {
256+
return Error(422, validationErr.Error(), nil)
256257
}
257258

258259
if err != nil {

0 commit comments

Comments
 (0)