Compare commits

...

12 Commits

Author SHA1 Message Date
Torkel Ödegaard
03346b6f6f Build: updated version to 6.1.0 2019-04-03 10:08:03 +02:00
Mitsuhiro Tanda
9a575f93ad Fix: Cloudwatch fix for dimension value (#16356)
Fixes autocomplete suggestion after changing dimension key

Fixes #15984

(cherry picked from commit 58eb74660d)
2019-04-03 09:57:28 +02:00
Torkel Ödegaard
21957ad515 Fix: Autoprefixer is now working (#16351)
The autoprefixer not working broke the phantomjs backend png rendering

Fixes #16345

(cherry picked from commit 2e59166daa)
2019-04-03 09:57:16 +02:00
Leonard Gram
bd93aad63d build: Fix for renamed package for armv6.
(cherry picked from commit b48c18a1c5)
2019-04-03 09:57:07 +02:00
Torkel Ödegaard
8ae5980c23 Fix: Graphite query ast to string fix (#16297)
Fixes #16291

(cherry picked from commit 74ae756d02)
2019-04-03 09:56:55 +02:00
Torkel Ödegaard
eb38581dc1 Fix: Template query editor this bind exception fix (#16299)
Also fixes the default 100% width of inputs.
Fixes #16298

(cherry picked from commit 5c3a0a624a)
2019-04-03 09:56:43 +02:00
Marcus Efraimsson
be217d8c0e Fix: Alerting Notification channel http api fixes (#16288)
Fix so that uid can be changed when updating notification
channels through the http api.
Update documentation

(cherry picked from commit 79b86466fd)
2019-04-03 09:56:11 +02:00
Floyd May
dfbc3bfb1f InfluxDB: Fix tag names with periods in alerting (#16255)
Updates regex to match tag names with periods when generating
series names in alerting evaluation (backend).

Fixes #9148

(cherry picked from commit 33d1d427bc)
2019-04-03 09:56:01 +02:00
Torkel Ödegaard
a6c8cd7f3a Automation: Updates to yarn cli cherrypick & changelog tasks (#16357)
* Automation: Updated cherrypick task to show merge sha

* Fixed changelog milestone filtering

(cherry picked from commit 5aea77fc95)
2019-04-03 09:55:19 +02:00
Daniel Lee
56e4032db3 Chore: docs whats new article for the 6.1 release (#16251)
(cherry picked from commit 0e2d279e3a)
2019-03-27 13:49:01 +01:00
Daniel Lee
944e526eb9 release 6.1.0-beta1 2019-03-27 12:06:23 +01:00
Daniel Lee
0d6db7e6b8 Chore: scripts update publish script before 6.1 release
(cherry picked from commit cbe2543717894ace2a8347859bff22dfbbf57a73)
2019-03-27 12:02:59 +01:00
21 changed files with 154 additions and 44 deletions

4
.browserslistrc Normal file
View File

@@ -0,0 +1,4 @@
>1%,
Chrome > 20
last 4 versions,
Firefox ESR

View File

@@ -361,6 +361,7 @@ func createPackage(options linuxPackageOptions) {
fmt.Printf("pkgArch is set to '%s', generated arch is '%s'\n", pkgArch, options.packageArch)
if pkgArch == "armv6" {
name += "-rpi"
args = append(args, "--replaces", "grafana")
}
args = append(args, "--name", name)

View File

@@ -0,0 +1,55 @@
+++
title = "What's New in Grafana v6.1"
description = "Feature & improvement highlights for Grafana v6.1"
keywords = ["grafana", "new", "documentation", "6.1"]
type = "docs"
[menu.docs]
name = "Version 6.1"
identifier = "v6.1"
parent = "whatsnew"
weight = -12
+++
# What's New in Grafana v6.1
## Highlights
### Ad hoc Filtering for Prometheus
{{< imgbox max-width="30%" img="/img/docs/v61/prometheus-ad-hoc.gif" caption="Ad-hoc filters variable for Prometheus" >}}
The ad hoc filter feature allows you to create new key/value filters on the fly with autocomplete for both key and values. The filter condition is then automatically applied to all queries on the dashboard. This makes it easier to explore your data in a dashboard without changing queries and without having to add new template variables.
Other timeseries databases with label-based query languages have had this feature for a while. Recently Prometheus added support for fetching label names from their API and thanks to [Mitsuhiro Tanda](https://github.com/mtanda) implementing it in Grafana, the Prometheus datasource finally supports ad hoc filtering.
Support for fetching a list of label names was released in Prometheus v2.6.0 so that is a requirement for this feature to work in Grafana.
### Permissions: Editors can own dashboards, folders and teams they create
When the dashboard folders feature and permissions system was released in Grafana 5.0, users with the editor role were not allowed to administrate dashboards, folders or teams. In the 6.1 release, we have added a config option so that by default editors are admins for any Dashboard, Folder or Team they create.
This feature also adds a new Team permission that can be assigned to any user with the editor or viewer role and lets that user add other users to the Team.
We believe that this is more in line with the Grafana philosophy, as it will allow teams to be more self-organizing. This option will be made permanent if it gets positive feedback from the community so let us know what you think in the [issue on GitHub](https://github.com/grafana/grafana/issues/15590).
To turn this feature on add the following [config option](/installation/configuration/#editors-can-admin) to your Grafana ini file in the `users` section and then restart the Grafana server:
```ini
[users]
editors_can_admin = true
```
### Minor Features and Fixes
This release contains a lot of small features and fixes:
- A new keyboard shortcut `d l` toggles all Graph legends in a dashboard.
- A small bug fix for Elasticsearch - template variables in the alias field now work properly.
- Some new capabilities have been added for datasource plugins that will be of interest to plugin authors:
- a new oauth pass-through option.
- it is now possible to add user details to requests sent to the dataproxy.
- Heatmap and Explore fixes.
Checkout the [CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md) file for a complete list of new features, changes, and bug fixes.
A huge thanks to our community for all the reported issues, bug fixes and feedback.

View File

@@ -152,6 +152,7 @@ Content-Type: application/json
PUT /api/alert-notifications/1 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
@@ -170,7 +171,7 @@ Content-Type: application/json
Deletes an existing notification channel identified by uid.
**Example Request**:
**Example Request**:
```http
DELETE /api/alert-notifications/uid/team-a-email-notifier HTTP/1.1
Accept: application/json
@@ -198,6 +199,7 @@ Content-Type: application/json
DELETE /api/alert-notifications/1 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example Response**:
@@ -217,7 +219,7 @@ Content-Type: application/json
**Example Request**:
**Example Request**:
```http
POST /api/alert-notifications/test HTTP/1.1
Accept: application/json
Content-Type: application/json
@@ -247,7 +249,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
{
"id": 1,
"uid": "cIBgcSjkk",
"uid": "new-alert-notification", // optional
"name": "new alert notification", //Required
"type": "email", //Required
"isDefault": false,
@@ -267,7 +269,7 @@ Content-Type: application/json
{
"id": 1,
"uid": "cIBgcSjkk",
"uid": "new-alert-notification",
"name": "new alert notification",
"type": "email",
"isDefault": false,

View File

@@ -5,7 +5,7 @@
"company": "Grafana Labs"
},
"name": "grafana",
"version": "6.1.0-pre",
"version": "6.1.0",
"repository": {
"type": "git",
"url": "http://github.com/grafana/grafana.git"

View File

@@ -72,7 +72,7 @@ export class Input extends PureComponent<Props> {
const inputElementProps = this.populateEventPropsWithStatus(restProps, validationEvents);
return (
<div>
<div style={{ flexGrow: 1 }}>
<input {...inputElementProps} className={inputClassName} />
{error && !hideErrorMessage && <span>{error}</span>}
</div>

View File

@@ -1,7 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Input renders correctly 1`] = `
<div>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<input
className="gf-form-input"
/>

View File

@@ -465,7 +465,13 @@ exports[`Render should render with base threshold 1`] = `
type="text"
value="Base"
>
<div>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<input
className="gf-form-input"
readOnly={true}

View File

@@ -54,6 +54,7 @@ type CreateAlertNotificationCommand struct {
type UpdateAlertNotificationCommand struct {
Id int64 `json:"id" binding:"Required"`
Uid string `json:"uid"`
Name string `json:"name" binding:"Required"`
Type string `json:"type" binding:"Required"`
SendReminder bool `json:"sendReminder"`
@@ -68,6 +69,7 @@ type UpdateAlertNotificationCommand struct {
type UpdateAlertNotificationWithUidCommand struct {
Uid string `json:"-"`
NewUid string `json:"uid"`
Name string `json:"name" binding:"Required"`
Type string `json:"type" binding:"Required"`
SendReminder bool `json:"sendReminder"`

View File

@@ -317,6 +317,10 @@ func UpdateAlertNotification(cmd *m.UpdateAlertNotificationCommand) error {
current.SendReminder = cmd.SendReminder
current.DisableResolveMessage = cmd.DisableResolveMessage
if cmd.Uid != "" {
current.Uid = cmd.Uid
}
if current.SendReminder {
if cmd.Frequency == "" {
return m.ErrNotificationFrequencyNotFound
@@ -356,8 +360,13 @@ func UpdateAlertNotificationWithUid(cmd *m.UpdateAlertNotificationWithUidCommand
return fmt.Errorf("Cannot update, alert notification uid %s doesn't exist", cmd.Uid)
}
if cmd.NewUid == "" {
cmd.NewUid = cmd.Uid
}
updateNotification := &m.UpdateAlertNotificationCommand{
Id: current.Id,
Uid: cmd.NewUid,
Name: cmd.Name,
Type: cmd.Type,
SendReminder: cmd.SendReminder,

View File

@@ -18,7 +18,7 @@ var (
)
func init() {
legendFormat = regexp.MustCompile(`\[\[(\w+?)*\]\]*|\$\s*(\w+?)*`)
legendFormat = regexp.MustCompile(`\[\[(\w+)(\.\w+)*\]\]*|\$\s*(\w+?)*`)
}
func (rp *ResponseParser) Parse(response *Response, query *Query) *tsdb.QueryResult {

View File

@@ -75,7 +75,10 @@ func TestInfluxdbResponseParser(t *testing.T) {
{
Name: "cpu.upc",
Columns: []string{"time", "mean", "sum"},
Tags: map[string]string{"datacenter": "America"},
Tags: map[string]string{
"datacenter": "America",
"dc.region.name": "Northeast",
},
Values: [][]interface{}{
{json.Number("111"), json.Number("222"), json.Number("333")},
},
@@ -159,6 +162,13 @@ func TestInfluxdbResponseParser(t *testing.T) {
So(result.Series[0].Name, ShouldEqual, "alias America")
})
Convey("tag alias with periods", func() {
query := &Query{Alias: "alias [[tag_dc.region.name]]"}
result := parser.Parse(response, query)
So(result.Series[0].Name, ShouldEqual, "alias Northeast")
})
})
})
})

View File

@@ -8,13 +8,13 @@ export default class DefaultVariableQueryEditor extends PureComponent<VariableQu
this.state = { value: props.query };
}
handleChange(event) {
this.setState({ value: event.target.value });
}
onChange = (event: React.FormEvent<HTMLInputElement>) => {
this.setState({ value: event.currentTarget.value });
};
handleBlur(event) {
this.props.onChange(event.target.value, event.target.value);
}
onBlur = (event: React.FormEvent<HTMLInputElement>) => {
this.props.onChange(event.currentTarget.value, event.currentTarget.value);
};
render() {
return (
@@ -24,8 +24,8 @@ export default class DefaultVariableQueryEditor extends PureComponent<VariableQu
type="text"
className="gf-form-input"
value={this.state.value}
onChange={this.handleChange}
onBlur={this.handleBlur}
onChange={this.onChange}
onBlur={this.onBlur}
placeholder="metric name or tags query"
required
/>

View File

@@ -112,6 +112,7 @@ export class CloudWatchQueryParameterCtrl {
query = $scope.datasource.getDimensionKeys($scope.target.namespace, $scope.target.region);
} else if (segment.type === 'value') {
const dimensionKey = $scope.dimSegments[$index - 2].value;
delete target.dimensions[dimensionKey];
query = $scope.datasource.getDimensionValues(
target.region,
target.namespace,

View File

@@ -19,6 +19,7 @@ export default class GraphiteQuery {
this.datasource = datasource;
this.target = target;
this.templateSrv = templateSrv;
this.scopedVars = scopedVars;
this.parseTarget();
this.removeTagValue = '-- remove tag --';
@@ -162,7 +163,9 @@ export default class GraphiteQuery {
updateModelTarget(targets) {
const wrapFunction = (target: string, func: any) => {
return func.render(target, this.templateSrv.replace);
return func.render(target, (value: string) => {
return this.templateSrv.replace(value, this.scopedVars);
});
};
if (!this.target.textEditor) {

View File

@@ -398,7 +398,13 @@ Array [
>
Alias By
</label>
<div>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<input
className="gf-form-input gf-form-input width-24"
onChange={[Function]}
@@ -426,7 +432,13 @@ Array [
>
Project
</span>
<div>
<div
style={
Object {
"flexGrow": 1,
}
}
>
<input
className="gf-form-input gf-form-input width-15"
disabled={true}

View File

@@ -6,8 +6,8 @@ EXTRA_OPTS="$@"
# Right now we hack this in into the publish script.
# Eventually we might want to keep a list of all previous releases somewhere.
_releaseNoteUrl="https://community.grafana.com/t/release-notes-v6-0-x/14010"
_whatsNewUrl="http://docs.grafana.org/guides/whats-new-in-v6-0/"
_releaseNoteUrl="https://community.grafana.com/t/release-notes-v6-1-x/15772"
_whatsNewUrl="http://docs.grafana.org/guides/whats-new-in-v6-1/"
./scripts/build/release_publisher/release_publisher \
--wn ${_whatsNewUrl} \

View File

@@ -14,21 +14,21 @@ const changelogTaskRunner: TaskRunner<ChangelogOptions> = async ({ milestone })
timeout: 10000,
});
if (!/^\d+$/.test(milestone)) {
console.log('Use milestone number not title, find number in milestone url');
return;
}
const res = await client.get('/issues', {
params: {
state: 'closed',
per_page: 100,
labels: 'add to changelog',
milestone: milestone,
},
});
const issues = res.data.filter(item => {
if (!item.milestone) {
console.log('Item missing milestone', item.number);
return false;
}
return item.milestone.title === milestone;
});
const issues = res.data;
const bugs = _.sortBy(
issues.filter(item => {

View File

@@ -27,13 +27,10 @@ const cherryPickRunner: TaskRunner<CherryPickOptions> = async () => {
continue;
}
console.log(item.number + ' closed_at ' + item.closed_at + ' ' + item.html_url);
console.log(`${item.title} (${item.number}) closed_at ${item.closed_at}`);
console.log(`\tURL: ${item.closed_at} ${item.html_url}`);
const issueDetails = await client.get(item.pull_request.url);
const commits = await client.get(issueDetails.data.commits_url);
for (const commit of commits.data) {
console.log(commit.commit.message + ' sha: ' + commit.sha);
}
console.log(`\tMerge sha: ${issueDetails.data.merge_commit_sha}`);
}
};

View File

@@ -1,7 +1,9 @@
module.exports = {
plugins: {
'autoprefixer': {},
'postcss-reporter': {},
'postcss-browser-reporter': {},
}
}
module.exports = () => {
return {
plugins: {
autoprefixer: {},
'postcss-reporter': {},
'postcss-browser-reporter': {},
}
};
};

View File

@@ -19,7 +19,7 @@ module.exports = function(options) {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap,
config: { path: __dirname + '/postcss.config.js' },
config: { path: __dirname },
},
},
{