Skip to content

Commit 8d80812

Browse files
committed
Merge branch 'issue-6566' of https://github.com/benrubson/grafana into benrubson-issue-6566
2 parents 05c5a09 + e71114f commit 8d80812

File tree

80 files changed

+817
-1311
lines changed

Some content is hidden

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

80 files changed

+817
-1311
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
* **Graph Panel**: Bar width if bars was only used in series override, [#6528](https://github.com/grafana/grafana/issues/6528)
66
* **UI/Browser**: Fixed issue with page/view header gradient border not showing in Safari, [#6530](https://github.com/grafana/grafana/issues/6530)
77
* **Cloudwatch**: Fixed cloudwatch datasource requesting to many datapoints, [#6544](https://github.com/grafana/grafana/issues/6544)
8+
* **UX**: Panel Drop zone visible after duplicating panel, and when entering fullscreen/edit view, [#6598](https://github.com/grafana/grafana/issues/6598)
9+
* **Templating**: Newly added variable was not visible directly only after dashboard reload, [#6622](https://github.com/grafana/grafana/issues/6622)
10+
11+
### Enhancements
12+
* **Singlestat**: Support repeated template variables in prefix/postfix [#6595](https://github.com/grafana/grafana/issues/6595)
13+
* **Templating**: Don't persist variable options with refresh option [#6586](https://github.com/grafana/grafana/issues/6586)
14+
* **Alerting**: Add ability to have OR conditions (and mixing AND & OR) [#6579](https://github.com/grafana/grafana/issues/6579)
815

916
# 4.0-beta1 (2016-11-09)
1017

docs/sources/alerting/notifications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ Amazon S3 for this and Webdav. So to set that up you need to configure the
9898
[external image uploader](/installation/configuration/#external-image-storage) in your grafana-server ini
9999
config file.
100100

101-
This is not an optional requirement, you can get slack and email notifications without setting this up.
101+
This is an optional requirement, you can get slack and email notifications without setting this up.
102102

103103

docs/sources/alerting/rules.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ Currently the only condition type that exists is a `Query` condition that allows
5555
specify a query letter, time range and an aggregation function. The letter refers to
5656
a query you already have added in the **Metrics** tab. The result from the query and the aggregation function is
5757
a single value that is then used in the threshold check. The query used in an alert rule cannot
58-
contain any template variables. Currently we only support `AND` operator between conditions.
58+
contain any template variables. Currently we only support `AND` and `OR` operators between conditions and they are executed serially.
59+
For example, we have 3 conditions in the following order:
60+
`condition:A(evaluates to: TRUE) OR condition:B(evaluates to: FALSE) AND condition:C(evaluates to: TRUE)`
61+
so the result will be calculated as ((TRUE OR FALSE) AND TRUE) = TRUE.
5962

6063
We plan to add other condition types in the future, like `Other Alert`, where you can include the state
6164
of another alert in your conditions, and `Time Of Day`.

docs/sources/datasources/plugin_api.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,5 @@ Even though the data source type name is with lowercase `g`, the directive uses
3030
that is how angular directives needs to be named in order to match an element with name `<metric-query-editor-graphite />`.
3131
You also specify the query controller here instead of in the query.editor.html partial like before.
3232

33-
### query.editor.html
34-
35-
This partial needs to be updated, remove the `np-repeat` this is done in the outer partial now,m the query.editor.html
36-
should only render a single query. Take a look at the Graphite or InfluxDB partials for `query.editor.html` for reference.
37-
You should also add a `tight-form-item` with `{{target.refId}}`, all queries needs to be assigned a letter (`refId`).
38-
These query reference letters are going to be utilized in a later feature.
3933

4034

docs/sources/http_api/org.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,34 @@ page_keywords: grafana, admin, http, api, documentation, orgs, organisation
8585
}
8686
}
8787

88+
## Create Organisation
89+
90+
`POST /api/org`
91+
92+
**Example Request**:
93+
94+
POST /api/org HTTP/1.1
95+
Accept: application/json
96+
Content-Type: application/json
97+
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
98+
99+
{
100+
"name":"New Org."
101+
}
102+
103+
104+
**Example Response**:
105+
106+
HTTP/1.1 200
107+
Content-Type: application/json
108+
109+
{
110+
"orgId":"1",
111+
"message":"Organization created"
112+
}
113+
114+
115+
88116
## Update current Organisation
89117

90118
`PUT /api/org`

docs/sources/installation/rpm.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ those options.
141141
- [OpenTSDB]({{< relref "datasources/opentsdb.md" >}})
142142
- [Prometheus]({{< relref "datasources/prometheus.md" >}})
143143

144+
### Server side image rendering
145+
146+
Server side image (png) rendering is a feature that is optional but very useful when sharing visualizations,
147+
for example in alert notifications.
148+
149+
If the image is missing text make sure you have font packages installed.
150+
151+
```
152+
yum install fontconfig
153+
yum install freetype*
154+
yum install urw-fonts
155+
```
144156

145157
## Installing from binary tar file
146158

pkg/api/alerting.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ func AlertTest(c *middleware.Context, dto dtos.AlertTestCommand) Response {
119119
res := backendCmd.Result
120120

121121
dtoRes := &dtos.AlertTestResult{
122-
Firing: res.Firing,
122+
Firing: res.Firing,
123+
ConditionEvals: res.ConditionEvals,
123124
}
124125

125126
if res.Error != nil {

pkg/api/api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,4 +307,5 @@ func Register(r *macaron.Macaron) {
307307

308308
InitAppPluginRoutes(r)
309309

310+
r.NotFound(NotFoundHandler)
310311
}

pkg/api/dtos/alerting.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ type AlertTestCommand struct {
3535
}
3636

3737
type AlertTestResult struct {
38-
Firing bool `json:"firing"`
39-
TimeMs string `json:"timeMs"`
40-
Error string `json:"error,omitempty"`
41-
EvalMatches []*EvalMatch `json:"matches,omitempty"`
42-
Logs []*AlertTestResultLog `json:"logs,omitempty"`
38+
Firing bool `json:"firing"`
39+
ConditionEvals string `json:"conditionEvals"`
40+
TimeMs string `json:"timeMs"`
41+
Error string `json:"error,omitempty"`
42+
EvalMatches []*EvalMatch `json:"matches,omitempty"`
43+
Logs []*AlertTestResultLog `json:"logs,omitempty"`
4344
}
4445

4546
type AlertTestResultLog struct {

pkg/api/login_oauth.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func OAuthLogin(ctx *middleware.Context) {
9696
}
9797
sslcli := &http.Client{Transport: tr}
9898

99-
oauthCtx = context.TODO()
99+
oauthCtx = context.Background()
100100
oauthCtx = context.WithValue(oauthCtx, oauth2.HTTPClient, sslcli)
101101
}
102102

@@ -106,6 +106,8 @@ func OAuthLogin(ctx *middleware.Context) {
106106
ctx.Handle(500, "login.OAuthLogin(NewTransportWithCode)", err)
107107
return
108108
}
109+
// token.TokenType was defaulting to "bearer", which is out of spec, so we explicitly set to "Bearer"
110+
token.TokenType = "Bearer"
109111

110112
ctx.Logger.Debug("OAuthLogin Got token")
111113

0 commit comments

Comments
 (0)