diff --git a/.gitignore b/.gitignore
index 0ac42cbcb4b..3aa23b45149 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
node_modules
+npm-debug.log
coverage/
.aws-config.json
awsconfig
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 81b315d6323..8a6f780faf1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,18 @@
-# 2.6.0 (unreleased)
+# 2.6.0 (2015-12-14)
+
+### New Features
+* **Elasticsearch**: Support for pipeline aggregations Moving average and derivative, closes [#2715](https://github.com/grafana/grafana/issues/2715)
+* **Elasticsearch**: Support for inline script and missing options for metrics, closes [#3500](https://github.com/grafana/grafana/issues/3500)
+* **Syslog**: Support for syslog logging, closes [#3161](https://github.com/grafana/grafana/pull/3161)
+* **Timepicker**: Always show refresh button even with refresh rate, closes [#3498](https://github.com/grafana/grafana/pull/3498)
+* **Login**: Make it possible to change the login hint on the login page, closes [#2571](https://github.com/grafana/grafana/pull/2571)
+
+### Bug Fixes
+* **metric editors**: Fix for clicking typeahead auto dropdown option, fixes [#3428](https://github.com/grafana/grafana/issues/3428)
+* **influxdb**: Fixed issue showing Group By label only on first query, fixes [#3453](https://github.com/grafana/grafana/issues/3453)
+* **logging**: Add more verbose info logging for http reqeusts, closes [#3405](https://github.com/grafana/grafana/pull/3405)
+
+# 2.6.0-Beta1 (2015-12-04)
### New Table Panel
* **table**: New powerful and flexible table panel, closes [#215](https://github.com/grafana/grafana/issues/215)
@@ -6,9 +20,9 @@
### Enhancements
* **CloudWatch**: Support for multiple AWS Credentials, closes [#3053](https://github.com/grafana/grafana/issues/3053), [#3080](https://github.com/grafana/grafana/issues/3080)
* **Elasticsearch**: Support for dynamic daily indices for annotations, closes [#3061](https://github.com/grafana/grafana/issues/3061)
+* **Elasticsearch**: Support for setting min_doc_count for date histogram, closes [#3416](https://github.com/grafana/grafana/issues/3416)
* **Graph Panel**: Option to hide series with all zeroes from legend and tooltip, closes [#1381](https://github.com/grafana/grafana/issues/1381), [#3336](https://github.com/grafana/grafana/issues/3336)
-
### Bug Fixes
* **cloudwatch**: fix for handling of period for long time ranges, fixes [#3086](https://github.com/grafana/grafana/issues/3086)
* **dashboard**: fix for collapse row by clicking on row title, fixes [#3065](https://github.com/grafana/grafana/issues/3065)
@@ -16,6 +30,9 @@
* **graph**: layout fix for color picker when right side legend was enabled, fixes [#3093](https://github.com/grafana/grafana/issues/3093)
* **elasticsearch**: disabling elastic query (via eye) caused error, fixes [#3300](https://github.com/grafana/grafana/issues/3300)
+### Breaking changes
+* **elasticsearch**: Manual json edited queries are not supported any more (They very barely worked in 2.5)
+
# 2.5 (2015-10-28)
**New Feature: Mix data sources**
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index ee9d78e1470..73c38fffec0 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -20,53 +20,53 @@
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws",
- "Comment": "v0.10.4-18-gce51895",
- "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
+ "Comment": "v1.0.0",
+ "Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/endpoints",
- "Comment": "v0.10.4-18-gce51895",
- "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
+ "Comment": "v1.0.0",
+ "Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/ec2query",
- "Comment": "v0.10.4-18-gce51895",
- "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
+ "Comment": "v1.0.0",
+ "Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query",
- "Comment": "v0.10.4-18-gce51895",
- "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
+ "Comment": "v1.0.0",
+ "Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest",
- "Comment": "v0.10.4-18-gce51895",
- "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
+ "Comment": "v1.0.0",
+ "Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil",
- "Comment": "v0.10.4-18-gce51895",
- "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
+ "Comment": "v1.0.0",
+ "Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/signer/v4",
- "Comment": "v0.10.4-18-gce51895",
- "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
+ "Comment": "v1.0.0",
+ "Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/waiter",
- "Comment": "v0.10.4-18-gce51895",
- "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
+ "Comment": "v1.0.0",
+ "Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/cloudwatch",
- "Comment": "v0.10.4-18-gce51895",
- "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
+ "Comment": "v1.0.0",
+ "Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/ec2",
- "Comment": "v0.10.4-18-gce51895",
- "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7"
+ "Comment": "v1.0.0",
+ "Rev": "abb928e07c4108683d6b4d0b6ca08fe6bc0eee5f"
},
{
"ImportPath": "github.com/davecgh/go-spew/spew",
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go
index 8c0dc2d8d24..4d2a01e8c41 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go
@@ -13,11 +13,11 @@ var indexRe = regexp.MustCompile(`(.+)\[(-?\d+)?\]$`)
// rValuesAtPath returns a slice of values found in value v. The values
// in v are explored recursively so all nested values are collected.
-func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool) []reflect.Value {
+func rValuesAtPath(v interface{}, path string, createPath, caseSensitive, nilTerm bool) []reflect.Value {
pathparts := strings.Split(path, "||")
if len(pathparts) > 1 {
for _, pathpart := range pathparts {
- vals := rValuesAtPath(v, pathpart, create, caseSensitive)
+ vals := rValuesAtPath(v, pathpart, createPath, caseSensitive, nilTerm)
if len(vals) > 0 {
return vals
}
@@ -76,7 +76,16 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool)
return false
})
- if create && value.Kind() == reflect.Ptr && value.IsNil() {
+ if nilTerm && value.Kind() == reflect.Ptr && len(components[1:]) == 0 {
+ if !value.IsNil() {
+ value.Set(reflect.Zero(value.Type()))
+ }
+ return []reflect.Value{value}
+ }
+
+ if createPath && value.Kind() == reflect.Ptr && value.IsNil() {
+ // TODO if the value is the terminus it should not be created
+ // if the value to be set to its position is nil.
value.Set(reflect.New(value.Type().Elem()))
value = value.Elem()
} else {
@@ -84,7 +93,7 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool)
}
if value.Kind() == reflect.Slice || value.Kind() == reflect.Map {
- if !create && value.IsNil() {
+ if !createPath && value.IsNil() {
value = reflect.ValueOf(nil)
}
}
@@ -116,7 +125,7 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool)
// pull out index
i := int(*index)
if i >= value.Len() { // check out of bounds
- if create {
+ if createPath {
// TODO resize slice
} else {
continue
@@ -127,7 +136,7 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool)
value = reflect.Indirect(value.Index(i))
if value.Kind() == reflect.Slice || value.Kind() == reflect.Map {
- if !create && value.IsNil() {
+ if !createPath && value.IsNil() {
value = reflect.ValueOf(nil)
}
}
@@ -176,8 +185,11 @@ func ValuesAtPath(i interface{}, path string) ([]interface{}, error) {
// SetValueAtPath sets a value at the case insensitive lexical path inside
// of a structure.
func SetValueAtPath(i interface{}, path string, v interface{}) {
- if rvals := rValuesAtPath(i, path, true, false); rvals != nil {
+ if rvals := rValuesAtPath(i, path, true, false, v == nil); rvals != nil {
for _, rval := range rvals {
+ if rval.Kind() == reflect.Ptr && rval.IsNil() {
+ continue
+ }
setValue(rval, v)
}
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go
index 378a4864848..b2225566fa3 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go
@@ -105,4 +105,38 @@ func TestSetValueAtPathSuccess(t *testing.T) {
assert.Equal(t, "test0", s2.B.B.C)
awsutil.SetValueAtPath(&s2, "A", []Struct{{}})
assert.Equal(t, []Struct{{}}, s2.A)
+
+ str := "foo"
+
+ s3 := Struct{}
+ awsutil.SetValueAtPath(&s3, "b.b.c", str)
+ assert.Equal(t, "foo", s3.B.B.C)
+
+ s3 = Struct{B: &Struct{B: &Struct{C: str}}}
+ awsutil.SetValueAtPath(&s3, "b.b.c", nil)
+ assert.Equal(t, "", s3.B.B.C)
+
+ s3 = Struct{}
+ awsutil.SetValueAtPath(&s3, "b.b.c", nil)
+ assert.Equal(t, "", s3.B.B.C)
+
+ s3 = Struct{}
+ awsutil.SetValueAtPath(&s3, "b.b.c", &str)
+ assert.Equal(t, "foo", s3.B.B.C)
+
+ var s4 struct{ Name *string }
+ awsutil.SetValueAtPath(&s4, "Name", str)
+ assert.Equal(t, str, *s4.Name)
+
+ s4 = struct{ Name *string }{}
+ awsutil.SetValueAtPath(&s4, "Name", nil)
+ assert.Equal(t, (*string)(nil), s4.Name)
+
+ s4 = struct{ Name *string }{Name: &str}
+ awsutil.SetValueAtPath(&s4, "Name", nil)
+ assert.Equal(t, (*string)(nil), s4.Name)
+
+ s4 = struct{ Name *string }{}
+ awsutil.SetValueAtPath(&s4, "Name", &str)
+ assert.Equal(t, str, *s4.Name)
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/client.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/client.go
index 63ab805b9c4..e639ce040d7 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/client.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/client.go
@@ -41,11 +41,20 @@ func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, op
Handlers: handlers,
}
- maxRetries := aws.IntValue(cfg.MaxRetries)
- if cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries {
- maxRetries = 3
+ switch retryer, ok := cfg.Retryer.(request.Retryer); {
+ case ok:
+ svc.Retryer = retryer
+ case cfg.Retryer != nil && cfg.Logger != nil:
+ s := fmt.Sprintf("WARNING: %T does not implement request.Retryer; using DefaultRetryer instead", cfg.Retryer)
+ cfg.Logger.Log(s)
+ fallthrough
+ default:
+ maxRetries := aws.IntValue(cfg.MaxRetries)
+ if cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries {
+ maxRetries = 3
+ }
+ svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries}
}
- svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries}
svc.AddDebugHandlers()
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go
index f157f8b3b5a..75fcc8284b9 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go
@@ -12,6 +12,9 @@ import (
// is nil also.
const UseServiceDefaultRetries = -1
+// RequestRetryer is an alias for a type that implements the request.Retryer interface.
+type RequestRetryer interface{}
+
// A Config provides service configuration for service clients. By default,
// all clients will use the {defaults.DefaultConfig} structure.
type Config struct {
@@ -59,6 +62,21 @@ type Config struct {
// configuration.
MaxRetries *int
+ // Retryer guides how HTTP requests should be retried in case of recoverable failures.
+ //
+ // When nil or the value does not implement the request.Retryer interface,
+ // the request.DefaultRetryer will be used.
+ //
+ // When both Retryer and MaxRetries are non-nil, the former is used and
+ // the latter ignored.
+ //
+ // To set the Retryer field in a type-safe manner and with chaining, use
+ // the request.WithRetryer helper function:
+ //
+ // cfg := request.WithRetryer(aws.NewConfig(), myRetryer)
+ //
+ Retryer RequestRetryer
+
// Disables semantic parameter validation, which validates input for missing
// required fields and/or other semantic request input errors.
DisableParamValidation *bool
@@ -217,6 +235,10 @@ func mergeInConfig(dst *Config, other *Config) {
dst.MaxRetries = other.MaxRetries
}
+ if other.Retryer != nil {
+ dst.Retryer = other.Retryer
+ }
+
if other.DisableParamValidation != nil {
dst.DisableParamValidation = other.DisableParamValidation
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
index b19fbd70b4a..2939ec473f2 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
@@ -44,12 +44,19 @@ func (r *Request) nextPageTokens() []interface{} {
}
tokens := []interface{}{}
+ tokenAdded := false
for _, outToken := range r.Operation.OutputTokens {
v, _ := awsutil.ValuesAtPath(r.Data, outToken)
if len(v) > 0 {
tokens = append(tokens, v[0])
+ tokenAdded = true
+ } else {
+ tokens = append(tokens, nil)
}
}
+ if !tokenAdded {
+ return nil
+ }
return tokens
}
@@ -85,9 +92,10 @@ func (r *Request) NextPage() *Request {
// return true to keep iterating or false to stop.
func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error {
for page := r; page != nil; page = page.NextPage() {
- page.Send()
- shouldContinue := fn(page.Data, !page.HasNextPage())
- if page.Error != nil || !shouldContinue {
+ if err := page.Send(); err != nil {
+ return err
+ }
+ if getNextPage := fn(page.Data, !page.HasNextPage()); !getNextPage {
return page.Error
}
}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go
index a9863eaf97f..95a8d99fbe6 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go
@@ -9,6 +9,7 @@ import (
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/awstesting/unit"
"github.com/aws/aws-sdk-go/service/dynamodb"
+ "github.com/aws/aws-sdk-go/service/route53"
"github.com/aws/aws-sdk-go/service/s3"
)
@@ -314,7 +315,69 @@ func TestPaginationTruncation(t *testing.T) {
assert.Equal(t, []string{"Key1", "Key2"}, results)
assert.Nil(t, err)
+}
+func TestPaginationNilToken(t *testing.T) {
+ client := route53.New(unit.Session)
+
+ reqNum := 0
+ resps := []*route53.ListResourceRecordSetsOutput{
+ {
+ ResourceRecordSets: []*route53.ResourceRecordSet{
+ {Name: aws.String("first.example.com.")},
+ },
+ IsTruncated: aws.Bool(true),
+ NextRecordName: aws.String("second.example.com."),
+ NextRecordType: aws.String("MX"),
+ NextRecordIdentifier: aws.String("second"),
+ MaxItems: aws.String("1"),
+ },
+ {
+ ResourceRecordSets: []*route53.ResourceRecordSet{
+ {Name: aws.String("second.example.com.")},
+ },
+ IsTruncated: aws.Bool(true),
+ NextRecordName: aws.String("third.example.com."),
+ NextRecordType: aws.String("MX"),
+ MaxItems: aws.String("1"),
+ },
+ {
+ ResourceRecordSets: []*route53.ResourceRecordSet{
+ {Name: aws.String("third.example.com.")},
+ },
+ IsTruncated: aws.Bool(false),
+ MaxItems: aws.String("1"),
+ },
+ }
+ client.Handlers.Send.Clear() // mock sending
+ client.Handlers.Unmarshal.Clear()
+ client.Handlers.UnmarshalMeta.Clear()
+ client.Handlers.ValidateResponse.Clear()
+
+ idents := []string{}
+ client.Handlers.Build.PushBack(func(r *request.Request) {
+ p := r.Params.(*route53.ListResourceRecordSetsInput)
+ idents = append(idents, aws.StringValue(p.StartRecordIdentifier))
+
+ })
+ client.Handlers.Unmarshal.PushBack(func(r *request.Request) {
+ r.Data = resps[reqNum]
+ reqNum++
+ })
+
+ params := &route53.ListResourceRecordSetsInput{
+ HostedZoneId: aws.String("id-zone"),
+ }
+
+ results := []string{}
+ err := client.ListResourceRecordSetsPages(params, func(p *route53.ListResourceRecordSetsOutput, last bool) bool {
+ results = append(results, *p.ResourceRecordSets[0].Name)
+ return true
+ })
+
+ assert.NoError(t, err)
+ assert.Equal(t, []string{"", "second", ""}, idents)
+ assert.Equal(t, []string{"first.example.com.", "second.example.com.", "third.example.com."}, results)
}
// Benchmarks
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go
index b06143b8358..ab6fff5ac84 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go
@@ -3,6 +3,7 @@ package request
import (
"time"
+ "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
)
@@ -15,6 +16,13 @@ type Retryer interface {
MaxRetries() int
}
+// WithRetryer sets a config Retryer value to the given Config returning it
+// for chaining.
+func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config {
+ cfg.Retryer = retryer
+ return cfg
+}
+
// retryableCodes is a collection of service response codes which are retry-able
// without any further action.
var retryableCodes = map[string]struct{}{
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go
index f4741adfb44..eec3baa1f05 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go
@@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
-const SDKVersion = "0.10.4"
+const SDKVersion = "1.0.0"
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go
index 335af91dc61..e5fb13666ab 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go
@@ -5,6 +5,7 @@ import (
"reflect"
"time"
+ "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
@@ -47,52 +48,74 @@ func (w *Waiter) Wait() error {
res := method.Call([]reflect.Value{in})
req := res[0].Interface().(*request.Request)
req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Waiter"))
- if err := req.Send(); err != nil {
- return err
- }
+ err := req.Send()
for _, a := range w.Acceptors {
+ if err != nil && a.Matcher != "error" {
+ // Only matcher error is valid if there is a request error
+ continue
+ }
+
result := false
+ var vals []interface{}
switch a.Matcher {
- case "pathAll":
- if vals, _ := awsutil.ValuesAtPath(req.Data, a.Argument); req.Error == nil && vals != nil {
- result = true
- for _, val := range vals {
- if !awsutil.DeepEqual(val, a.Expected) {
- result = false
- break
- }
+ case "pathAll", "path":
+ // Require all matches to be equal for result to match
+ vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument)
+ result = true
+ for _, val := range vals {
+ if !awsutil.DeepEqual(val, a.Expected) {
+ result = false
+ break
}
}
case "pathAny":
- if vals, _ := awsutil.ValuesAtPath(req.Data, a.Argument); req.Error == nil && vals != nil {
- for _, val := range vals {
- if awsutil.DeepEqual(val, a.Expected) {
- result = true
- break
- }
+ // Only a single match needs to equal for the result to match
+ vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument)
+ for _, val := range vals {
+ if awsutil.DeepEqual(val, a.Expected) {
+ result = true
+ break
}
}
case "status":
s := a.Expected.(int)
result = s == req.HTTPResponse.StatusCode
+ case "error":
+ if aerr, ok := err.(awserr.Error); ok {
+ result = aerr.Code() == a.Expected.(string)
+ }
+ case "pathList":
+ // ignored matcher
+ default:
+ logf(client, "WARNING: Waiter for %s encountered unexpected matcher: %s",
+ w.Config.Operation, a.Matcher)
}
- if result {
- switch a.State {
- case "success":
- return nil // waiter completed
- case "failure":
- if req.Error == nil {
- return awserr.New("ResourceNotReady",
- fmt.Sprintf("failed waiting for successful resource state"), nil)
- }
- return req.Error // waiter failed
- case "retry":
- // do nothing, just retry
- }
- break
+ if !result {
+ // If there was no matching result found there is nothing more to do
+ // for this response, retry the request.
+ continue
}
+
+ switch a.State {
+ case "success":
+ // waiter completed
+ return nil
+ case "failure":
+ // Waiter failure state triggered
+ return awserr.New("ResourceNotReady",
+ fmt.Sprintf("failed waiting for successful resource state"), err)
+ case "retry":
+ // clear the error and retry the operation
+ err = nil
+ default:
+ logf(client, "WARNING: Waiter for %s encountered unexpected state: %s",
+ w.Config.Operation, a.State)
+ }
+ }
+ if err != nil {
+ return err
}
time.Sleep(time.Second * time.Duration(w.Delay))
@@ -101,3 +124,13 @@ func (w *Waiter) Wait() error {
return awserr.New("ResourceNotReady",
fmt.Sprintf("exceeded %d wait attempts", w.MaxAttempts), nil)
}
+
+func logf(client reflect.Value, msg string, args ...interface{}) {
+ cfgVal := client.FieldByName("Config")
+ if !cfgVal.IsValid() {
+ return
+ }
+ if cfg, ok := cfgVal.Interface().(*aws.Config); ok && cfg.Logger != nil {
+ cfg.Logger.Log(fmt.Sprintf(msg, args...))
+ }
+}
diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter_test.go
index 58267295b11..d545f35370f 100644
--- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter_test.go
+++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter_test.go
@@ -1,6 +1,9 @@
package waiter_test
import (
+ "bytes"
+ "io/ioutil"
+ "net/http"
"testing"
"github.com/stretchr/testify/assert"
@@ -41,22 +44,7 @@ func (c *mockClient) MockRequest(input *MockInput) (*request.Request, *MockOutpu
return req, output
}
-var mockAcceptors = []waiter.WaitAcceptor{
- {
- State: "success",
- Matcher: "pathAll",
- Argument: "States[].State",
- Expected: "running",
- },
- {
- State: "failure",
- Matcher: "pathAny",
- Argument: "States[].State",
- Expected: "stopping",
- },
-}
-
-func TestWaiter(t *testing.T) {
+func TestWaiterPathAll(t *testing.T) {
svc := &mockClient{Client: awstesting.NewClient(&aws.Config{
Region: aws.String("mock-region"),
})}
@@ -73,13 +61,13 @@ func TestWaiter(t *testing.T) {
{State: aws.String("pending")},
},
},
- { // Request 1
+ { // Request 2
States: []*MockState{
{State: aws.String("running")},
{State: aws.String("pending")},
},
},
- { // Request 1
+ { // Request 3
States: []*MockState{
{State: aws.String("running")},
{State: aws.String("running")},
@@ -104,7 +92,83 @@ func TestWaiter(t *testing.T) {
Operation: "Mock",
Delay: 0,
MaxAttempts: 10,
- Acceptors: mockAcceptors,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "States[].State",
+ Expected: "running",
+ },
+ },
+ }
+ w := waiter.Waiter{
+ Client: svc,
+ Input: &MockInput{},
+ Config: waiterCfg,
+ }
+
+ err := w.Wait()
+ assert.NoError(t, err)
+ assert.Equal(t, 3, numBuiltReq)
+ assert.Equal(t, 3, reqNum)
+}
+
+func TestWaiterPath(t *testing.T) {
+ svc := &mockClient{Client: awstesting.NewClient(&aws.Config{
+ Region: aws.String("mock-region"),
+ })}
+ svc.Handlers.Send.Clear() // mock sending
+ svc.Handlers.Unmarshal.Clear()
+ svc.Handlers.UnmarshalMeta.Clear()
+ svc.Handlers.ValidateResponse.Clear()
+
+ reqNum := 0
+ resps := []*MockOutput{
+ { // Request 1
+ States: []*MockState{
+ {State: aws.String("pending")},
+ {State: aws.String("pending")},
+ },
+ },
+ { // Request 2
+ States: []*MockState{
+ {State: aws.String("running")},
+ {State: aws.String("pending")},
+ },
+ },
+ { // Request 3
+ States: []*MockState{
+ {State: aws.String("running")},
+ {State: aws.String("running")},
+ },
+ },
+ }
+
+ numBuiltReq := 0
+ svc.Handlers.Build.PushBack(func(r *request.Request) {
+ numBuiltReq++
+ })
+ svc.Handlers.Unmarshal.PushBack(func(r *request.Request) {
+ if reqNum >= len(resps) {
+ assert.Fail(t, "too many polling requests made")
+ return
+ }
+ r.Data = resps[reqNum]
+ reqNum++
+ })
+
+ waiterCfg := waiter.Config{
+ Operation: "Mock",
+ Delay: 0,
+ MaxAttempts: 10,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "path",
+ Argument: "States[].State",
+ Expected: "running",
+ },
+ },
}
w := waiter.Waiter{
Client: svc,
@@ -135,13 +199,13 @@ func TestWaiterFailure(t *testing.T) {
{State: aws.String("pending")},
},
},
- { // Request 1
+ { // Request 2
States: []*MockState{
{State: aws.String("running")},
{State: aws.String("pending")},
},
},
- { // Request 1
+ { // Request 3
States: []*MockState{
{State: aws.String("running")},
{State: aws.String("stopping")},
@@ -166,7 +230,20 @@ func TestWaiterFailure(t *testing.T) {
Operation: "Mock",
Delay: 0,
MaxAttempts: 10,
- Acceptors: mockAcceptors,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "States[].State",
+ Expected: "running",
+ },
+ {
+ State: "failure",
+ Matcher: "pathAny",
+ Argument: "States[].State",
+ Expected: "stopping",
+ },
+ },
}
w := waiter.Waiter{
Client: svc,
@@ -181,3 +258,134 @@ func TestWaiterFailure(t *testing.T) {
assert.Equal(t, 3, numBuiltReq)
assert.Equal(t, 3, reqNum)
}
+
+func TestWaiterError(t *testing.T) {
+ svc := &mockClient{Client: awstesting.NewClient(&aws.Config{
+ Region: aws.String("mock-region"),
+ })}
+ svc.Handlers.Send.Clear() // mock sending
+ svc.Handlers.Unmarshal.Clear()
+ svc.Handlers.UnmarshalMeta.Clear()
+ svc.Handlers.ValidateResponse.Clear()
+
+ reqNum := 0
+ resps := []*MockOutput{
+ { // Request 1
+ States: []*MockState{
+ {State: aws.String("pending")},
+ {State: aws.String("pending")},
+ },
+ },
+ { // Request 2, error case
+ },
+ { // Request 3
+ States: []*MockState{
+ {State: aws.String("running")},
+ {State: aws.String("running")},
+ },
+ },
+ }
+
+ numBuiltReq := 0
+ svc.Handlers.Build.PushBack(func(r *request.Request) {
+ numBuiltReq++
+ })
+ svc.Handlers.Send.PushBack(func(r *request.Request) {
+ if reqNum == 1 {
+ r.Error = awserr.New("MockException", "mock exception message", nil)
+ r.HTTPResponse = &http.Response{
+ StatusCode: 400,
+ Status: http.StatusText(400),
+ Body: ioutil.NopCloser(bytes.NewReader([]byte{})),
+ }
+ reqNum++
+ }
+ })
+ svc.Handlers.Unmarshal.PushBack(func(r *request.Request) {
+ if reqNum >= len(resps) {
+ assert.Fail(t, "too many polling requests made")
+ return
+ }
+ r.Data = resps[reqNum]
+ reqNum++
+ })
+
+ waiterCfg := waiter.Config{
+ Operation: "Mock",
+ Delay: 0,
+ MaxAttempts: 10,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "pathAll",
+ Argument: "States[].State",
+ Expected: "running",
+ },
+ {
+ State: "retry",
+ Matcher: "error",
+ Argument: "",
+ Expected: "MockException",
+ },
+ },
+ }
+ w := waiter.Waiter{
+ Client: svc,
+ Input: &MockInput{},
+ Config: waiterCfg,
+ }
+
+ err := w.Wait()
+ assert.NoError(t, err)
+ assert.Equal(t, 3, numBuiltReq)
+ assert.Equal(t, 3, reqNum)
+}
+
+func TestWaiterStatus(t *testing.T) {
+ svc := &mockClient{Client: awstesting.NewClient(&aws.Config{
+ Region: aws.String("mock-region"),
+ })}
+ svc.Handlers.Send.Clear() // mock sending
+ svc.Handlers.Unmarshal.Clear()
+ svc.Handlers.UnmarshalMeta.Clear()
+ svc.Handlers.ValidateResponse.Clear()
+
+ reqNum := 0
+ svc.Handlers.Build.PushBack(func(r *request.Request) {
+ reqNum++
+ })
+ svc.Handlers.Send.PushBack(func(r *request.Request) {
+ code := 200
+ if reqNum == 3 {
+ code = 404
+ }
+ r.HTTPResponse = &http.Response{
+ StatusCode: code,
+ Status: http.StatusText(code),
+ Body: ioutil.NopCloser(bytes.NewReader([]byte{})),
+ }
+ })
+
+ waiterCfg := waiter.Config{
+ Operation: "Mock",
+ Delay: 0,
+ MaxAttempts: 10,
+ Acceptors: []waiter.WaitAcceptor{
+ {
+ State: "success",
+ Matcher: "status",
+ Argument: "",
+ Expected: 404,
+ },
+ },
+ }
+ w := waiter.Waiter{
+ Client: svc,
+ Input: &MockInput{},
+ Config: waiterCfg,
+ }
+
+ err := w.Wait()
+ assert.NoError(t, err)
+ assert.Equal(t, 3, reqNum)
+}
diff --git a/README.md b/README.md
index 99854966938..3886c32a971 100644
--- a/README.md
+++ b/README.md
@@ -90,7 +90,7 @@ Replace X.Y.Z by actual version number.
cd $GOPATH/src/github.com/grafana/grafana
go run build.go setup (only needed once to install godep)
godep restore (will pull down all golang lib dependencies in your current GOPATH)
-godep go run build.go build
+go run build.go build
```
### Building frontend assets
diff --git a/appveyor.yml b/appveyor.yml
index 993f8f2882c..83506312912 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -5,7 +5,7 @@ os: Windows Server 2012 R2
clone_folder: c:\gopath\src\github.com\grafana\grafana
environment:
- nodejs_version: "0.12.2"
+ nodejs_version: "4"
GOPATH: c:\gopath
install:
diff --git a/build.go b/build.go
index 4a345c5fc73..fcd7289cd6a 100644
--- a/build.go
+++ b/build.go
@@ -76,6 +76,14 @@ func main() {
grunt("release")
createLinuxPackages()
+ case "pkg-rpm":
+ grunt("release")
+ createRpmPackages()
+
+ case "pkg-deb":
+ grunt("release")
+ createDebPackages()
+
case "latest":
makeLatestDistCopies()
@@ -147,7 +155,7 @@ type linuxPackageOptions struct {
depends []string
}
-func createLinuxPackages() {
+func createDebPackages() {
createPackage(linuxPackageOptions{
packageType: "deb",
homeDir: "/usr/share/grafana",
@@ -167,7 +175,9 @@ func createLinuxPackages() {
depends: []string{"adduser", "libfontconfig"},
})
+}
+func createRpmPackages() {
createPackage(linuxPackageOptions{
packageType: "rpm",
homeDir: "/usr/share/grafana",
@@ -189,6 +199,11 @@ func createLinuxPackages() {
})
}
+func createLinuxPackages() {
+ createDebPackages()
+ createRpmPackages()
+}
+
func createPackage(options linuxPackageOptions) {
packageRoot, _ := ioutil.TempDir("", "grafana-linux-pack")
@@ -315,6 +330,8 @@ func build(pkg string, tags []string) {
args = append(args, "-o", binary)
args = append(args, pkg)
setBuildEnv()
+
+ runPrint("go", "version")
runPrint("go", args...)
// Create an md5 checksum of the binary, to be included in the archive for
diff --git a/conf/defaults.ini b/conf/defaults.ini
index 8b2b34f3fbc..3350954a150 100644
--- a/conf/defaults.ini
+++ b/conf/defaults.ini
@@ -142,6 +142,9 @@ auto_assign_org_role = Viewer
# Require email validation before sign up completes
verify_email_enabled = false
+# Background text for the user field on the login page
+login_hint = email or username
+
#################################### Anonymous Auth ##########################
[auth.anonymous]
# enable anonymous access
@@ -245,6 +248,18 @@ daily_rotate = true
# Expired days of log file(delete after max days), default is 7
max_days = 7
+[log.syslog]
+level =
+# Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used.
+network =
+address =
+
+# Syslog facility. user, daemon and local0 through local7 are valid.
+facility =
+
+# Syslog tag. By default, the process' argv[0] is used.
+tag =
+
#################################### AMPQ Event Publisher ##########################
[event_publisher]
enabled = false
diff --git a/conf/sample.ini b/conf/sample.ini
index e8550c66c1a..df092cda5ed 100644
--- a/conf/sample.ini
+++ b/conf/sample.ini
@@ -134,6 +134,9 @@
# Default role new users will be automatically assigned (if disabled above is set to true)
;auto_assign_org_role = Viewer
+# Background text for the user field on the login page
+;login_hint = email or username
+
#################################### Anonymous Auth ##########################
[auth.anonymous]
# enable anonymous access
diff --git a/docs/VERSION b/docs/VERSION
index 437459cd94c..e70b4523ae7 100644
--- a/docs/VERSION
+++ b/docs/VERSION
@@ -1 +1 @@
-2.5.0
+2.6.0
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index f965e34c5bd..7bca7e2f01f 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -45,6 +45,7 @@ pages:
- ['guides/basic_concepts.md', 'User Guides', 'Basic Concepts']
- ['guides/gettingstarted.md', 'User Guides', 'Getting Started']
+- ['guides/whats-new-in-v2-6.md', 'User Guides', "What's New in Grafana v2.6"]
- ['guides/whats-new-in-v2-5.md', 'User Guides', "What's New in Grafana v2.5"]
- ['guides/whats-new-in-v2-1.md', 'User Guides', "What's New in Grafana v2.1"]
- ['guides/whats-new-in-v2.md', 'User Guides', "What's New in Grafana v2.0"]
@@ -52,13 +53,14 @@ pages:
- ['reference/graph.md', 'Reference', 'Graph Panel']
- ['reference/singlestat.md', 'Reference', 'Singlestat Panel']
+- ['reference/table_panel.md', 'Reference', 'Table Panel']
- ['reference/dashlist.md', 'Reference', 'Dashboard List Panel']
- ['reference/sharing.md', 'Reference', 'Sharing']
- ['reference/annotations.md', 'Reference', 'Annotations']
-- ['reference/timerange.md', 'Reference', 'Time Range Controls']
-- ['reference/search.md', 'Reference', 'Dashboard Search']
-- ['reference/templating.md', 'Reference', 'Templated Dashboards']
-- ['reference/scripting.md', 'Reference', 'Scripted Dashboards']
+- ['reference/timerange.md', 'Reference', 'Time Range']
+- ['reference/search.md', 'Reference', 'Search']
+- ['reference/templating.md', 'Reference', 'Templating']
+- ['reference/scripting.md', 'Reference', 'Scripting']
- ['reference/playlist.md', 'Reference', 'Playlist']
- ['reference/export_import.md', 'Reference', 'Import & Export']
- ['reference/admin.md', 'Reference', 'Administration']
diff --git a/docs/sources/datasources/cloudwatch.md b/docs/sources/datasources/cloudwatch.md
index 012da9d843a..4d87c4a0743 100644
--- a/docs/sources/datasources/cloudwatch.md
+++ b/docs/sources/datasources/cloudwatch.md
@@ -63,15 +63,10 @@ Name | Description
`namespaces()` | Returns a list of namespaces CloudWatch support.
`metrics(namespace)` | Returns a list of metrics in the namespace.
`dimension_keys(namespace)` | Returns a list of dimension keys in the namespace.
-`dimension_values(region, namespace, metric)` | Returns a list of dimension values matching the specified `region`, `namespace` and `metric`.
+`dimension_values(region, namespace, metric, dimension_key)` | Returns a list of dimension values matching the specified `region`, `namespace`, `metric` and `dimension_key`.
For details about the metrics CloudWatch provides, please refer to the [CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html).
-If you want to filter dimension values by other dimension key/value pair, you can specify optional parameter like this.
-```sql
-dimension_values(region, namespace, metric, dim_key1=dim_val1,dim_key2=dim_val2,...)
-```
-

## Cost
diff --git a/docs/sources/datasources/elasticsearch.md b/docs/sources/datasources/elasticsearch.md
index 76b0040ecd3..de9ada2bf58 100644
--- a/docs/sources/datasources/elasticsearch.md
+++ b/docs/sources/datasources/elasticsearch.md
@@ -53,6 +53,35 @@ a time pattern for the index name or a wildcard.
The Elasticsearch query editor allows you to select multiple metrics and group by multiple terms or filters. Use the plus and minus icons to the right to add / remove
metrics or group bys. Some metrics and group by have options, click the option text to expand the the row to view and edit metric or group by options.
+## Pipeline metrics
+
+If you have Elasticsearch 2.x and Grafana 2.6 or above then you can use pipeline metric aggregations like
+**Moving Average** and **Derivative**. Elasticsearch pipeline metrics require another metric to be based on. Use the eye icon next to the metric
+to hide metrics from appearing in the graph. This is useful for metrics you only have in the query to be used
+in a pipeline metric.
+
+
+
+## Templating
+
+The Elasticsearch datasource supports two types of queries you can use to fill template variables with values.
+
+### Possible values for a field
+
+```json
+{"find": "terms", "field": "@hostname"}
+```
+
+### Fields filtered by type
+```json
+{"find": "fields", "type": "string"}
+```
+
+### Multi format / All format
+Use lucene format.
+
+
+
## Annotations
TODO
diff --git a/docs/sources/datasources/influxdb.md b/docs/sources/datasources/influxdb.md
index e57d5a63fbc..da8ca08f549 100644
--- a/docs/sources/datasources/influxdb.md
+++ b/docs/sources/datasources/influxdb.md
@@ -38,29 +38,47 @@ Password | Database user's password
> Direct access is still supported because in some cases it may be useful to access a Data Source directly depending on the use case and topology of Grafana, the user, and the Data Source.
-## InfluxDB 0.9.x
+## Query Editor
-
+
You find the InfluxDB editor in the metrics tab in Graph or Singlestat panel's edit mode. You enter edit mode by clicking the
panel title, then edit. The editor allows you to select metrics and tags.
-### Editor tag filters
+### Filter data (WHERE)
To add a tag filter click the plus icon to the right of the `WHERE` condition. You can remove tag filters by clicking on
the tag key and select `--remove tag filter--`.
-### Regex matching
+**Regex matching**
+
You can type in regex patterns for metric names or tag filter values, be sure to wrap the regex pattern in forward slashes (`/`). Grafana
will automatically adjust the filter tag condition to use the InfluxDB regex match condition operator (`=~`).
-### Editor group by
-To group by a tag click the plus icon after the `GROUP BY ($interval)` text. Pick a tag from the dropdown that appears.
-You can remove the group by by clicking on the tag and then select `--remove group by--` from the dropdown.
+### Field & Aggregation functions
+In the `SELECT` row you can specify what fields and functions you want to use. If you have a
+group by time you need an aggregation function. Some functions like derivative require an aggregation function.
-### Editor RAW Query
-You can switch to raw query mode by pressing the pen icon.
+The editor tries simplify and unify this part of the query. For example:
+
-> If you use Raw Query be sure your query at minimum have `WHERE $timeFilter` clause and ends with `order by asc`.
+The above will generate the following InfluxDB `SELECT` clause:
+
+```sql
+SELECT derivative(mean("value"), 10s) /10 AS "REQ/s" FROM ....
+```
+
+#### Select multiple fields
+Use the plus button and select Field > field to add another SELECT clause. You can also
+specify an asterix `*` to select all fields.
+
+### Group By
+To group by a tag click the plus icon at the end of the GROUP BY row. Pick a tag from the dropdown that appears.
+You can remove the group by by clicking on the `tag` and then click on the x icon.
+
+### Text Editor Mode (RAW)
+You can switch to raw query mode by clicking hamburger icon and then `Switch editor mode`.
+
+> If you use Raw Query be sure your query at minimum have `WHERE $timeFilter`
> Also please always have a group by time and an aggregation function, otherwise InfluxDB can easily return hundreds of thousands
> of data points that will hang the browser.
@@ -72,7 +90,15 @@ You can switch to raw query mode by pressing the pen icon.
- $tag_hostname = replaced with the value of the hostname tag
- You can also use [[tag_hostname]] pattern replacement syntax
-### Templating
+### Table query / raw data
+
+
+
+You can remove the group by time by clicking on the `time` part and then the `x` icon. You can
+change the option `Format As` to `Table` if you want to show raw data in the `Table` panel.
+
+
+## Templating
You can create a template variable in Grafana and have that variable filled with values from any InfluxDB metric exploration query.
You can then use this variable in your InfluxDB metric queries.
@@ -93,7 +119,7 @@ SHOW TAG VALUES WITH KEY = "hostname" WHERE region =~ /$region/

-### Annotations
+## Annotations
Annotations allows you to overlay rich event information on top of graphs.
An example query:
@@ -102,10 +128,4 @@ An example query:
SELECT title, description from events WHERE $timeFilter order asc
```
-### InfluxDB 0.8.x
-
-
-
-
-
diff --git a/docs/sources/guides/whats-new-in-v2-6.md b/docs/sources/guides/whats-new-in-v2-6.md
new file mode 100644
index 00000000000..de1ac6d488b
--- /dev/null
+++ b/docs/sources/guides/whats-new-in-v2-6.md
@@ -0,0 +1,124 @@
+---
+page_title: What's New in Grafana v2.6
+page_description: What's new in Grafana v2.6
+page_keywords: grafana, new, changes, features, documentation, table
+---
+
+# What's new in Grafana v2.6
+
+## Release highlights
+The release includes a new Table panel, a new InfluxDB query editor, support for Elasticsearch Pipeline Metrics and
+support for multiple Cloudwatch credentials.
+
+## Table Panel
+
+
+The new table panel is very flexible, supporting both multiple modes for time series as well as for
+table, annotation and raw JSON data. It also provides date formating and value formating and coloring options.
+
+### Time series to rows
+
+In the most simple mode you can turn time series to rows. This means you get a `Time`, `Metric` and a `Value` column.
+Where `Metric` is the name of the time series.
+
+
+
+### Table Transform
+Above you see the options tab for the **Table Panel**. The most important option is the `To Table Transform`.
+This option controls how the result of the metric/data query is turned into a table.
+
+### Column Styles
+The column styles allow you control how dates and numbers are formatted.
+
+### Time series to columns
+This transform allows you to take multiple time series and group them by time. Which will result in a `Time` column
+and a column for each time series.
+
+
+
+In the screenshot above you can see how the same time series query as in the previous example can be transformed into
+a different table by changing the `To Table Transform` to `Time series to columns`.
+
+### Time series to aggregations
+This transform works very similar to the legend values in the Graph panel. Each series gets its own row. In the Options
+tab you can select which aggregations you want using the plus button the Columns section.
+
+
+
+You have to think about how accurate the aggregations will be. It depends on what aggregation is used in the time series query,
+how many data points are fetched, etc. The time series aggregations are calculated by Grafana after aggregation is performed
+by the time series database.
+
+### Raw logs queries
+
+If you want to show documents from Elasticsearch pick `Raw Document` as the first metric.
+
+
+
+This in combination with the `JSON Data` table transform will allow you to pick which fields in the document
+you want to show in the table.
+
+
+
+### Elasticsearch aggregations
+
+You can also make Elasticsearch aggregation queries without a `Date Histogram`. This allows you to
+use Elasticsearch metric aggregations to get accurate aggregations for the selected time range.
+
+
+
+### Annotations
+
+The table can also show any annotations you have enabled in the dashboard.
+
+
+
+## The New InfluxDB Editor
+The new InfluxDB editor is a lot more flexible and powerful. It supports nested functions, like `derivative`.
+It also uses the same technique as the Graphite query editor in that it presents nested functions as chain of function
+transformations. It tries to simplify and unify the complicated nature of InfluxDB's query language.
+
+
+
+In the `SELECT` row you can specify what fields and functions you want to use. If you have a
+group by time you need an aggregation function. Some functions like derivative require an aggregation function.
+
+The editor tries simplify and unify this part of the query. For example:
+
+
+The above will generate the following InfluxDB `SELECT` clause:
+
+```sql
+SELECT derivative(mean("value"), 10s) /10 AS "REQ/s" FROM ....
+```
+
+### Select multiple fields
+Use the plus button and select Field > field to add another SELECT clause. You can also
+specify an asterix `*` to select all fields.
+
+### Group By
+To group by a tag click the plus icon at the end of the GROUP BY row. Pick a tag from the dropdown that appears.
+You can remove the group by by clicking on the `tag` and then click on the x icon.
+
+The new editor also allows you to remove group by time and select `raw` table data. Which is very useful
+in combination with the new Table panel to show raw log data stored in InfluxDB.
+
+
+
+## Pipeline metrics
+
+If you have Elasticsearch 2.x and Grafana 2.6 or above then you can use pipeline metric aggregations like
+**Moving Average** and **Derivative**. Elasticsearch pipeline metrics require another metric to be based on. Use the eye icon next to the metric
+to hide metrics from appearing in the graph. This is useful for metrics you only have in the query to be used
+in a pipeline metric.
+
+
+
+## Changelog
+For a detailed list and link to github issues for everything included in the 2.6 release please
+view the [CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md) file.
+
+- - -
+
+Download Grafana 2.6 now
+
diff --git a/docs/sources/installation/debian.md b/docs/sources/installation/debian.md
index 4a734ac4400..ec6e30b35f1 100644
--- a/docs/sources/installation/debian.md
+++ b/docs/sources/installation/debian.md
@@ -10,13 +10,13 @@ page_keywords: grafana, installation, debian, ubuntu, guide
Description | Download
------------ | -------------
-.deb for Debian-based Linux | [grafana_2.5.0_amd64.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_2.5.0_amd64.deb)
+.deb for Debian-based Linux | [grafana_2.6.0_amd64.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_2.6.0_amd64.deb)
## Install
- $ wget https://grafanarel.s3.amazonaws.com/builds/grafana_2.5.0_amd64.deb
+ $ wget https://grafanarel.s3.amazonaws.com/builds/grafana_2.6.0_amd64.deb
$ sudo apt-get install -y adduser libfontconfig
- $ sudo dpkg -i grafana_2.5.0_amd64.deb
+ $ sudo dpkg -i grafana_2.6.0_amd64.deb
## APT Repository
diff --git a/docs/sources/installation/rpm.md b/docs/sources/installation/rpm.md
index 464faa09b9d..ec4f648e44b 100644
--- a/docs/sources/installation/rpm.md
+++ b/docs/sources/installation/rpm.md
@@ -10,24 +10,24 @@ page_keywords: grafana, installation, centos, fedora, opensuse, redhat, guide
Description | Download
------------ | -------------
-.RPM for CentOS / Fedora / OpenSuse / Redhat Linux | [grafana-2.5.0-1.x86_64.rpm](https://grafanarel.s3.amazonaws.com/builds/grafana-2.5.0-1.x86_64.rpm)
+.RPM for CentOS / Fedora / OpenSuse / Redhat Linux | [grafana-2.6.0-1.x86_64.rpm](https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0-1.x86_64.rpm)
## Install from package file
You can install Grafana using Yum directly.
- $ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-2.5.0-1.x86_64.rpm
+ $ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0-1.x86_64.rpm
Or install manually using `rpm`.
#### On CentOS / Fedora / Redhat:
$ sudo yum install initscripts fontconfig
- $ sudo rpm -Uvh grafana-2.5.0-1.x86_64.rpm
+ $ sudo rpm -Uvh grafana-2.6.0-1.x86_64.rpm
#### On OpenSuse:
- $ sudo rpm -i --nodeps grafana-2.5.0-1.x86_64.rpm
+ $ sudo rpm -i --nodeps grafana-2.6.0-1.x86_64.rpm
## Install via YUM Repository
diff --git a/docs/sources/reference/table_panel.md b/docs/sources/reference/table_panel.md
new file mode 100644
index 00000000000..381d16186a9
--- /dev/null
+++ b/docs/sources/reference/table_panel.md
@@ -0,0 +1,86 @@
+----
+page_title: Table Panel
+page_description: Table Panel Reference
+page_keywords: grafana, table, panel, documentation
+---
+
+# Table Panel
+
+
+
+The new table panel is very flexible, supporting both multiple modes for time series as well as for
+table, annotation and raw JSON data. It also provides date formating and value formating and coloring options.
+
+To view table panels in action and test different configurations with sample data, check out the [Table Panel Showcase in the Grafana Playground](http://play.grafana.org/dashboard/db/table-panel-showcase).
+
+## Options overview
+
+The table panel has many ways to manipulate your data for optimal presentation.
+
+
+
+1. `Data`: Control how your query is transformed into a table.
+2. `Table Display`: Table display options.
+3. `Column Styles`: Column value formating and display options.
+
+## Data to Table
+
+
+
+The data section contains the **To Table Transform (1)**. This is the primary option for how your data/metric
+query should be transformed into a table format. The **Columns (2)** option allows you to select what columns
+you want in the table. Only applicable for some transforms.
+
+### Time series to rows
+
+
+
+In the most simple mode you can turn time series to rows. This means you get a `Time`, `Metric` and a `Value` column. Where `Metric` is the name of the time series.
+
+### Time series to columns
+
+
+
+This transform allows you to take multiple time series and group them by time. Which will result in the primary column being `Time` and a column for each time series.
+
+### Time series aggregations
+
+
+This table transformation will lay out your table into rows by metric, allowing columns of `Avg`, `Min`, `Max`, `Total`, `Current` and `Count`. More than one column can be added.
+
+### Annotations
+
+
+If you have annotations enabled in the dashboard you can have the table show them. If you configure this
+mode then any queries you have in the metrics tab will be ignored.
+
+### JSON Data
+
+
+If you have an Elasticsearch **Raw Document** query or an Elasticsearch query without a `date histogram` use this
+transform mode and pick the columns using the **Columns** section.
+
+
+
+## Table Display
+
+
+
+1. `Pagination (Page Size)`: The table display fields allow you to control The `Pagination` (page size) is the threshold at which the table rows will be broken into pages. For example, if your table had 95 records with a pagination value of 10, your table would be split across 9 pages.
+2. `Scroll`: The `scroll bar` checkbox toggles the ability to scroll within the panel, when unchecked, the panel height will grow to display all rows.
+3. `Font Size`: The `font size` field allows you to increase or decrease the size for the panel, relative to the default font size.
+
+
+## Column Styles
+
+The column styles allow you control how dates and numbers are formatted.
+
+
+
+1. `Name or regex`: The Name or Regex field controls what columns the rule should be applied to. The regex or name filter will be matched against the column name not against column values.
+2. `Type`: The three supported types of types are `Number`, `String` and `Date`.
+3. `Format`: Specify date format. Only available when `Type` is set to `Date`.
+4. `Coloring` and `Thresholds`: Specify color mode and thresholds limits.
+5. `Unit` and `Decimals`: Specify unit and decimal precision for numbers.
+6. `Add column style rule`: Add new column rule.
+
diff --git a/docs/sources/versions.html_fragment b/docs/sources/versions.html_fragment
index 3733641ac79..d699cc6b6ac 100644
--- a/docs/sources/versions.html_fragment
+++ b/docs/sources/versions.html_fragment
@@ -1,3 +1,4 @@
+
Version v2.6
Version v2.5
Version v2.1
Version v2.0
diff --git a/package.json b/package.json
index 75136e48f1a..f23ede64e26 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"company": "Coding Instinct AB"
},
"name": "grafana",
- "version": "2.6.0-pre1",
+ "version": "3.0.0-pre1",
"repository": {
"type": "git",
"url": "http://github.com/torkelo/grafana.git"
diff --git a/packaging/publish/publish.sh b/packaging/publish/publish.sh
index abccf74aa4b..1d039ae1028 100755
--- a/packaging/publish/publish.sh
+++ b/packaging/publish/publish.sh
@@ -1,6 +1,6 @@
#! /usr/bin/env bash
-version=2.5.0
+version=2.6.0
wget https://grafanarel.s3.amazonaws.com/builds/grafana_${version}_amd64.deb
diff --git a/pkg/api/cloudwatch/cloudwatch.go b/pkg/api/cloudwatch/cloudwatch.go
index f4cde0ebd6a..d5abe4958ea 100644
--- a/pkg/api/cloudwatch/cloudwatch.go
+++ b/pkg/api/cloudwatch/cloudwatch.go
@@ -7,6 +7,7 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
@@ -119,7 +120,15 @@ func handleListMetrics(req *cwRequest, c *middleware.Context) {
Dimensions: reqParam.Parameters.Dimensions,
}
- resp, err := svc.ListMetrics(params)
+ var resp cloudwatch.ListMetricsOutput
+ err := svc.ListMetricsPages(params,
+ func(page *cloudwatch.ListMetricsOutput, lastPage bool) bool {
+ metrics, _ := awsutil.ValuesAtPath(page, "Metrics")
+ for _, metric := range metrics {
+ resp.Metrics = append(resp.Metrics, metric.(*cloudwatch.Metric))
+ }
+ return !lastPage
+ })
if err != nil {
c.JsonApiErr(500, "Unable to call AWS API", err)
return
@@ -160,7 +169,15 @@ func handleDescribeInstances(req *cwRequest, c *middleware.Context) {
params.InstanceIds = reqParam.Parameters.InstanceIds
}
- resp, err := svc.DescribeInstances(params)
+ var resp ec2.DescribeInstancesOutput
+ err := svc.DescribeInstancesPages(params,
+ func(page *ec2.DescribeInstancesOutput, lastPage bool) bool {
+ reservations, _ := awsutil.ValuesAtPath(page, "Reservations")
+ for _, reservation := range reservations {
+ resp.Reservations = append(resp.Reservations, reservation.(*ec2.Reservation))
+ }
+ return !lastPage
+ })
if err != nil {
c.JsonApiErr(500, "Unable to call AWS API", err)
return
diff --git a/pkg/api/cloudwatch/metrics.go b/pkg/api/cloudwatch/metrics.go
index 40cf974298d..e3255eccf7e 100644
--- a/pkg/api/cloudwatch/metrics.go
+++ b/pkg/api/cloudwatch/metrics.go
@@ -15,31 +15,47 @@ func init() {
metricsMap = map[string][]string{
"AWS/AutoScaling": {"GroupMinSize", "GroupMaxSize", "GroupDesiredCapacity", "GroupInServiceInstances", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"},
"AWS/Billing": {"EstimatedCharges"},
- "AWS/EC2": {"CPUCreditUsage", "CPUCreditBalance", "CPUUtilization", "DiskReadOps", "DiskWriteOps", "DiskReadBytes", "DiskWriteBytes", "NetworkIn", "NetworkOut", "StatusCheckFailed", "StatusCheckFailed_Instance", "StatusCheckFailed_System"},
- "AWS/ECS": {"CPUUtilization", "MemoryUtilization"},
"AWS/CloudFront": {"Requests", "BytesDownloaded", "BytesUploaded", "TotalErrorRate", "4xxErrorRate", "5xxErrorRate"},
"AWS/CloudSearch": {"SuccessfulRequests", "SearchableDocuments", "IndexUtilization", "Partitions"},
"AWS/DynamoDB": {"ConditionalCheckFailedRequests", "ConsumedReadCapacityUnits", "ConsumedWriteCapacityUnits", "OnlineIndexConsumedWriteCapacity", "OnlineIndexPercentageProgress", "OnlineIndexThrottleEvents", "ProvisionedReadCapacityUnits", "ProvisionedWriteCapacityUnits", "ReadThrottleEvents", "ReturnedItemCount", "SuccessfulRequestLatency", "SystemErrors", "ThrottledRequests", "UserErrors", "WriteThrottleEvents"},
+ "AWS/ECS": {"CPUUtilization", "MemoryUtilization"},
"AWS/ElastiCache": {
- "CPUUtilization", "SwapUsage", "FreeableMemory", "NetworkBytesIn", "NetworkBytesOut",
+ "CPUUtilization", "FreeableMemory", "NetworkBytesIn", "NetworkBytesOut", "SwapUsage",
"BytesUsedForCacheItems", "BytesReadIntoMemcached", "BytesWrittenOutFromMemcached", "CasBadval", "CasHits", "CasMisses", "CmdFlush", "CmdGet", "CmdSet", "CurrConnections", "CurrItems", "DecrHits", "DecrMisses", "DeleteHits", "DeleteMisses", "Evictions", "GetHits", "GetMisses", "IncrHits", "IncrMisses", "Reclaimed",
- "CurrConnections", "Evictions", "Reclaimed", "NewConnections", "BytesUsedForCache", "CacheHits", "CacheMisses", "ReplicationLag", "GetTypeCmds", "SetTypeCmds", "KeyBasedCmds", "StringBasedCmds", "HashBasedCmds", "ListBasedCmds", "SetBasedCmds", "SortedSetBasedCmds", "CurrItems",
+ "BytesUsedForHash", "CmdConfigGet", "CmdConfigSet", "CmdTouch", "CurrConfig", "EvictedUnfetched", "ExpiredUnfetched", "SlabsMoved", "TouchHits", "TouchMisses",
+ "NewConnections", "NewItems", "UnusedMemory",
+ "BytesUsedForCache", "CacheHits", "CacheMisses", "CurrConnections", "Evictions", "HyperLogLogBasedCmds", "NewConnections", "Reclaimed", "ReplicationBytes", "ReplicationLag", "SaveInProgress",
+ "CurrItems", "GetTypeCmds", "HashBasedCmds", "KeyBasedCmds", "ListBasedCmds", "SetBasedCmds", "SetTypeCmds", "SortedSetBasedCmds", "StringBasedCmds",
},
- "AWS/EBS": {"VolumeReadBytes", "VolumeWriteBytes", "VolumeReadOps", "VolumeWriteOps", "VolumeTotalReadTime", "VolumeTotalWriteTime", "VolumeIdleTime", "VolumeQueueLength", "VolumeThroughputPercentage", "VolumeConsumedReadWriteOps"},
- "AWS/ELB": {"HealthyHostCount", "UnHealthyHostCount", "RequestCount", "Latency", "HTTPCode_ELB_4XX", "HTTPCode_ELB_5XX", "HTTPCode_Backend_2XX", "HTTPCode_Backend_3XX", "HTTPCode_Backend_4XX", "HTTPCode_Backend_5XX", "BackendConnectionErrors", "SurgeQueueLength", "SpilloverCount"},
- "AWS/ElasticMapReduce": {"CoreNodesPending", "CoreNodesRunning", "HBaseBackupFailed", "HBaseMostRecentBackupDuration", "HBaseTimeSinceLastSuccessfulBackup", "HDFSBytesRead", "HDFSBytesWritten", "HDFSUtilization", "IsIdle", "JobsFailed", "JobsRunning", "LiveDataNodes", "LiveTaskTrackers", "MapSlotsOpen", "MissingBlocks", "ReduceSlotsOpen", "RemainingMapTasks", "RemainingMapTasksPerSlot", "RemainingReduceTasks", "RunningMapTasks", "RunningReduceTasks", "S3BytesRead", "S3BytesWritten", "TaskNodesPending", "TaskNodesRunning", "TotalLoad"},
- "AWS/Kinesis": {"PutRecord.Bytes", "PutRecord.Latency", "PutRecord.Success", "PutRecords.Bytes", "PutRecords.Latency", "PutRecords.Records", "PutRecords.Success", "IncomingBytes", "IncomingRecords", "GetRecords.Bytes", "GetRecords.IteratorAgeMilliseconds", "GetRecords.Latency", "GetRecords.Success"},
- "AWS/ML": {"PredictCount", "PredictFailureCount"},
- "AWS/OpsWorks": {"cpu_idle", "cpu_nice", "cpu_system", "cpu_user", "cpu_waitio", "load_1", "load_5", "load_15", "memory_buffers", "memory_cached", "memory_free", "memory_swap", "memory_total", "memory_used", "procs"},
- "AWS/Redshift": {"CPUUtilization", "DatabaseConnections", "HealthStatus", "MaintenanceMode", "NetworkReceiveThroughput", "NetworkTransmitThroughput", "PercentageDiskSpaceUsed", "ReadIOPS", "ReadLatency", "ReadThroughput", "WriteIOPS", "WriteLatency", "WriteThroughput"},
- "AWS/RDS": {"BinLogDiskUsage", "CPUUtilization", "DatabaseConnections", "DiskQueueDepth", "FreeableMemory", "FreeStorageSpace", "ReplicaLag", "SwapUsage", "ReadIOPS", "WriteIOPS", "ReadLatency", "WriteLatency", "ReadThroughput", "WriteThroughput", "NetworkReceiveThroughput", "NetworkTransmitThroughput"},
- "AWS/Route53": {"HealthCheckStatus", "HealthCheckPercentageHealthy"},
- "AWS/SNS": {"NumberOfMessagesPublished", "PublishSize", "NumberOfNotificationsDelivered", "NumberOfNotificationsFailed"},
- "AWS/SQS": {"NumberOfMessagesSent", "SentMessageSize", "NumberOfMessagesReceived", "NumberOfEmptyReceives", "NumberOfMessagesDeleted", "ApproximateNumberOfMessagesDelayed", "ApproximateNumberOfMessagesVisible", "ApproximateNumberOfMessagesNotVisible"},
- "AWS/S3": {"BucketSizeBytes", "NumberOfObjects"},
- "AWS/SWF": {"DecisionTaskScheduleToStartTime", "DecisionTaskStartToCloseTime", "DecisionTasksCompleted", "StartedDecisionTasksTimedOutOnClose", "WorkflowStartToCloseTime", "WorkflowsCanceled", "WorkflowsCompleted", "WorkflowsContinuedAsNew", "WorkflowsFailed", "WorkflowsTerminated", "WorkflowsTimedOut"},
- "AWS/StorageGateway": {"CacheHitPercent", "CachePercentUsed", "CachePercentDirty", "CloudBytesDownloaded", "CloudDownloadLatency", "CloudBytesUploaded", "UploadBufferFree", "UploadBufferPercentUsed", "UploadBufferUsed", "QueuedWrites", "ReadBytes", "ReadTime", "TotalCacheSize", "WriteBytes", "WriteTime", "WorkingStorageFree", "WorkingStoragePercentUsed", "WorkingStorageUsed", "CacheHitPercent", "CachePercentUsed", "CachePercentDirty", "ReadBytes", "ReadTime", "WriteBytes", "WriteTime", "QueuedWrites"},
- "AWS/WorkSpaces": {"Available", "Unhealthy", "ConnectionAttempt", "ConnectionSuccess", "ConnectionFailure", "SessionLaunchTime", "InSessionLatency", "SessionDisconnect"},
+ "AWS/EBS": {"VolumeReadBytes", "VolumeWriteBytes", "VolumeReadOps", "VolumeWriteOps", "VolumeTotalReadTime", "VolumeTotalWriteTime", "VolumeIdleTime", "VolumeQueueLength", "VolumeThroughputPercentage", "VolumeConsumedReadWriteOps"},
+ "AWS/EC2": {"CPUCreditUsage", "CPUCreditBalance", "CPUUtilization", "DiskReadOps", "DiskWriteOps", "DiskReadBytes", "DiskWriteBytes", "NetworkIn", "NetworkOut", "StatusCheckFailed", "StatusCheckFailed_Instance", "StatusCheckFailed_System"},
+ "AWS/ELB": {"HealthyHostCount", "UnHealthyHostCount", "RequestCount", "Latency", "HTTPCode_ELB_4XX", "HTTPCode_ELB_5XX", "HTTPCode_Backend_2XX", "HTTPCode_Backend_3XX", "HTTPCode_Backend_4XX", "HTTPCode_Backend_5XX", "BackendConnectionErrors", "SurgeQueueLength", "SpilloverCount"},
+ "AWS/ElasticMapReduce": {"IsIdle", "JobsRunning", "JobsFailed",
+ "MapTasksRunning", "MapTasksRemaining", "MapSlotsOpen", "RemainingMapTasksPerSlot", "ReduceTasksRunning", "ReduceTasksRemaining", "ReduceSlotsOpen",
+ "CoreNodesRunning", "CoreNodesPending", "LiveDataNodes", "TaskNodesRunning", "TaskNodesPending", "LiveTaskTrackers",
+ "S3BytesWritten", "S3BytesRead", "HDFSUtilization", "HDFSBytesRead", "HDFSBytesWritten", "MissingBlocks", "TotalLoad",
+ "BackupFailed", "MostRecentBackupDuration", "TimeSinceLastSuccessfulBackup",
+ "IsIdle", "ContainerAllocated", "ContainerReserved", "ContainerPending", "AppsCompleted", "AppsFailed", "AppsKilled", "AppsPending", "AppsRunning", "AppsSubmitted",
+ "CoreNodesRunning", "CoreNodesPending", "LiveDataNodes", "MRTotalNodes", "MRActiveNodes", "MRLostNodes", "MRUnhealthyNodes", "MRDecommissionedNodes", "MRRebootedNodes",
+ "S3BytesWritten", "S3BytesRead", "HDFSUtilization", "HDFSBytesRead", "HDFSBytesWritten", "MissingBlocks", "CorruptBlocks", "TotalLoad", "MemoryTotalMB", "MemoryReservedMB", "MemoryAvailableMB", "MemoryAllocatedMB", "PendingDeletionBlocks", "UnderReplicatedBlocks", "DfsPendingReplicationBlocks", "CapacityRemainingGB",
+ "HbaseBackupFailed", "MostRecentBackupDuration", "TimeSinceLastSuccessfulBackup"},
+ "AWS/ES": {"ClusterStatus.green", "ClusterStatus.yellow", "ClusterStatus.red", "Nodes", "SearchableDocuments", "DeletedDocuments", "CPUUtilization", "FreeStorageSpace", "JVMMemoryPressure", "AutomatedSnapshotFailure", "MasterCPUUtilization", "MasterFreeStorageSpace", "MasterJVMMemoryPressure", "ReadLatency", "WriteLatency", "ReadThroughput", "WriteThroughput", "DiskQueueLength", "ReadIOPS", "WriteIOPS"},
+ "AWS/Kinesis": {"PutRecord.Bytes", "PutRecord.Latency", "PutRecord.Success", "PutRecords.Bytes", "PutRecords.Latency", "PutRecords.Records", "PutRecords.Success", "IncomingBytes", "IncomingRecords", "GetRecords.Bytes", "GetRecords.IteratorAgeMilliseconds", "GetRecords.Latency", "GetRecords.Success"},
+ "AWS/Lambda": {"Invocations", "Errors", "Duration", "Throttles"},
+ "AWS/ML": {"PredictCount", "PredictFailureCount"},
+ "AWS/OpsWorks": {"cpu_idle", "cpu_nice", "cpu_system", "cpu_user", "cpu_waitio", "load_1", "load_5", "load_15", "memory_buffers", "memory_cached", "memory_free", "memory_swap", "memory_total", "memory_used", "procs"},
+ "AWS/Redshift": {"CPUUtilization", "DatabaseConnections", "HealthStatus", "MaintenanceMode", "NetworkReceiveThroughput", "NetworkTransmitThroughput", "PercentageDiskSpaceUsed", "ReadIOPS", "ReadLatency", "ReadThroughput", "WriteIOPS", "WriteLatency", "WriteThroughput"},
+ "AWS/RDS": {"BinLogDiskUsage", "CPUUtilization", "CPUCreditUsage", "CPUCreditBalance", "DatabaseConnections", "DiskQueueDepth", "FreeableMemory", "FreeStorageSpace", "ReplicaLag", "SwapUsage", "ReadIOPS", "WriteIOPS", "ReadLatency", "WriteLatency", "ReadThroughput", "WriteThroughput", "NetworkReceiveThroughput", "NetworkTransmitThroughput"},
+ "AWS/Route53": {"HealthCheckStatus", "HealthCheckPercentageHealthy"},
+ "AWS/SNS": {"NumberOfMessagesPublished", "PublishSize", "NumberOfNotificationsDelivered", "NumberOfNotificationsFailed"},
+ "AWS/SQS": {"NumberOfMessagesSent", "SentMessageSize", "NumberOfMessagesReceived", "NumberOfEmptyReceives", "NumberOfMessagesDeleted", "ApproximateNumberOfMessagesDelayed", "ApproximateNumberOfMessagesVisible", "ApproximateNumberOfMessagesNotVisible"},
+ "AWS/S3": {"BucketSizeBytes", "NumberOfObjects"},
+ "AWS/SWF": {"DecisionTaskScheduleToStartTime", "DecisionTaskStartToCloseTime", "DecisionTasksCompleted", "StartedDecisionTasksTimedOutOnClose", "WorkflowStartToCloseTime", "WorkflowsCanceled", "WorkflowsCompleted", "WorkflowsContinuedAsNew", "WorkflowsFailed", "WorkflowsTerminated", "WorkflowsTimedOut",
+ "ActivityTaskScheduleToCloseTime", "ActivityTaskScheduleToStartTime", "ActivityTaskStartToCloseTime", "ActivityTasksCanceled", "ActivityTasksCompleted", "ActivityTasksFailed", "ScheduledActivityTasksTimedOutOnClose", "ScheduledActivityTasksTimedOutOnStart", "StartedActivityTasksTimedOutOnClose", "StartedActivityTasksTimedOutOnHeartbeat"},
+ "AWS/StorageGateway": {"CacheHitPercent", "CachePercentUsed", "CachePercentDirty", "CloudBytesDownloaded", "CloudDownloadLatency", "CloudBytesUploaded", "UploadBufferFree", "UploadBufferPercentUsed", "UploadBufferUsed", "QueuedWrites", "ReadBytes", "ReadTime", "TotalCacheSize", "WriteBytes", "WriteTime", "TimeSinceLastRecoveryPoint", "WorkingStorageFree", "WorkingStoragePercentUsed", "WorkingStorageUsed",
+ "CacheHitPercent", "CachePercentUsed", "CachePercentDirty", "ReadBytes", "ReadTime", "WriteBytes", "WriteTime", "QueuedWrites"},
+ "AWS/WAF": {"AllowedRequests", "BlockedRequests", "CountedRequests"},
+ "AWS/WorkSpaces": {"Available", "Unhealthy", "ConnectionAttempt", "ConnectionSuccess", "ConnectionFailure", "SessionLaunchTime", "InSessionLatency", "SessionDisconnect"},
}
dimensionsMap = map[string][]string{
"AWS/AutoScaling": {"AutoScalingGroupName"},
@@ -47,13 +63,15 @@ func init() {
"AWS/CloudFront": {"DistributionId", "Region"},
"AWS/CloudSearch": {},
"AWS/DynamoDB": {"TableName", "GlobalSecondaryIndexName", "Operation"},
+ "AWS/ECS": {"ClusterName", "ServiceName"},
"AWS/ElastiCache": {"CacheClusterId", "CacheNodeId"},
"AWS/EBS": {"VolumeId"},
"AWS/EC2": {"AutoScalingGroupName", "ImageId", "InstanceId", "InstanceType"},
- "AWS/ECS": {"ClusterName", "ServiceName"},
"AWS/ELB": {"LoadBalancerName", "AvailabilityZone"},
- "AWS/ElasticMapReduce": {"ClusterId", "JobId"},
+ "AWS/ElasticMapReduce": {"ClusterId", "JobFlowId", "JobId"},
+ "AWS/ES": {},
"AWS/Kinesis": {"StreamName"},
+ "AWS/Lambda": {"FunctionName"},
"AWS/ML": {"MLModelId", "RequestMode"},
"AWS/OpsWorks": {"StackId", "LayerId", "InstanceId"},
"AWS/Redshift": {"NodeID", "ClusterIdentifier"},
@@ -62,8 +80,9 @@ func init() {
"AWS/SNS": {"Application", "Platform", "TopicName"},
"AWS/SQS": {"QueueName"},
"AWS/S3": {"BucketName", "StorageType"},
- "AWS/SWF": {"Domain", "ActivityTypeName", "ActivityTypeVersion"},
+ "AWS/SWF": {"Domain", "WorkflowTypeName", "WorkflowTypeVersion", "ActivityTypeName", "ActivityTypeVersion"},
"AWS/StorageGateway": {"GatewayId", "GatewayName", "VolumeId"},
+ "AWS/WAF": {"Rule", "WebACL"},
"AWS/WorkSpaces": {"DirectoryId", "WorkspaceId"},
}
}
@@ -113,6 +132,7 @@ func handleGetMetrics(req *cwRequest, c *middleware.Context) {
c.JsonApiErr(404, "Unable to find namespace "+reqParam.Parameters.Namespace, nil)
return
}
+ sort.Sort(sort.StringSlice(namespaceMetrics))
result := []interface{}{}
for _, name := range namespaceMetrics {
@@ -136,6 +156,7 @@ func handleGetDimensions(req *cwRequest, c *middleware.Context) {
c.JsonApiErr(404, "Unable to find dimension "+reqParam.Parameters.Namespace, nil)
return
}
+ sort.Sort(sort.StringSlice(dimensionValues))
result := []interface{}{}
for _, name := range dimensionValues {
diff --git a/pkg/api/datasources.go b/pkg/api/datasources.go
index c6081af50ad..1ac241c69bf 100644
--- a/pkg/api/datasources.go
+++ b/pkg/api/datasources.go
@@ -65,6 +65,7 @@ func GetDataSourceById(c *middleware.Context) Response {
BasicAuth: ds.BasicAuth,
BasicAuthUser: ds.BasicAuthUser,
BasicAuthPassword: ds.BasicAuthPassword,
+ WithCredentials: ds.WithCredentials,
IsDefault: ds.IsDefault,
JsonData: ds.JsonData,
})
diff --git a/pkg/api/dtos/models.go b/pkg/api/dtos/models.go
index 7af4c84f56d..50db279b25b 100644
--- a/pkg/api/dtos/models.go
+++ b/pkg/api/dtos/models.go
@@ -61,6 +61,7 @@ type DataSource struct {
BasicAuth bool `json:"basicAuth"`
BasicAuthUser string `json:"basicAuthUser"`
BasicAuthPassword string `json:"basicAuthPassword"`
+ WithCredentials bool `json:"withCredentials"`
IsDefault bool `json:"isDefault"`
JsonData map[string]interface{} `json:"jsonData"`
}
diff --git a/pkg/api/frontendsettings.go b/pkg/api/frontendsettings.go
index a6b27327dfd..db916764888 100644
--- a/pkg/api/frontendsettings.go
+++ b/pkg/api/frontendsettings.go
@@ -69,6 +69,9 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
if ds.BasicAuth {
dsMap["basicAuth"] = util.GetBasicAuthHeader(ds.BasicAuthUser, ds.BasicAuthPassword)
}
+ if ds.WithCredentials {
+ dsMap["withCredentials"] = ds.WithCredentials
+ }
if ds.Type == m.DS_INFLUXDB_08 {
dsMap["username"] = ds.User
diff --git a/pkg/api/login.go b/pkg/api/login.go
index d7856ebbaad..d0aace4235c 100644
--- a/pkg/api/login.go
+++ b/pkg/api/login.go
@@ -28,6 +28,7 @@ func LoginView(c *middleware.Context) {
viewData.Settings["googleAuthEnabled"] = setting.OAuthService.Google
viewData.Settings["githubAuthEnabled"] = setting.OAuthService.GitHub
viewData.Settings["disableUserSignUp"] = !setting.AllowUserSignUp
+ viewData.Settings["loginHint"] = setting.LoginHint
if !tryLoginUsingRememberCookie(c) {
c.HTML(200, VIEW_INDEX, viewData)
diff --git a/pkg/log/syslog.go b/pkg/log/syslog.go
new file mode 100644
index 00000000000..bc1780056e8
--- /dev/null
+++ b/pkg/log/syslog.go
@@ -0,0 +1,95 @@
+//+build !windows,!nacl,!plan9
+
+package log
+
+import (
+ "encoding/json"
+ "errors"
+ "log/syslog"
+)
+
+type SyslogWriter struct {
+ syslog *syslog.Writer
+ Network string `json:"network"`
+ Address string `json:"address"`
+ Facility string `json:"facility"`
+ Tag string `json:"tag"`
+}
+
+func NewSyslog() LoggerInterface {
+ return new(SyslogWriter)
+}
+
+func (sw *SyslogWriter) Init(config string) error {
+ if err := json.Unmarshal([]byte(config), sw); err != nil {
+ return err
+ }
+
+ prio, err := parseFacility(sw.Facility)
+ if err != nil {
+ return err
+ }
+
+ w, err := syslog.Dial(sw.Network, sw.Address, prio, sw.Tag)
+ if err != nil {
+ return err
+ }
+
+ sw.syslog = w
+ return nil
+}
+
+func (sw *SyslogWriter) WriteMsg(msg string, skip, level int) error {
+ var err error
+
+ switch level {
+ case TRACE, DEBUG:
+ err = sw.syslog.Debug(msg)
+ case INFO:
+ err = sw.syslog.Info(msg)
+ case WARN:
+ err = sw.syslog.Warning(msg)
+ case ERROR:
+ err = sw.syslog.Err(msg)
+ case CRITICAL:
+ err = sw.syslog.Crit(msg)
+ case FATAL:
+ err = sw.syslog.Alert(msg)
+ default:
+ err = errors.New("invalid syslog level")
+ }
+
+ return err
+}
+
+func (sw *SyslogWriter) Destroy() {
+ sw.syslog.Close()
+}
+
+func (sw *SyslogWriter) Flush() {}
+
+var facilities = map[string]syslog.Priority{
+ "user": syslog.LOG_USER,
+ "daemon": syslog.LOG_DAEMON,
+ "local0": syslog.LOG_LOCAL0,
+ "local1": syslog.LOG_LOCAL1,
+ "local2": syslog.LOG_LOCAL2,
+ "local3": syslog.LOG_LOCAL3,
+ "local4": syslog.LOG_LOCAL4,
+ "local5": syslog.LOG_LOCAL5,
+ "local6": syslog.LOG_LOCAL6,
+ "local7": syslog.LOG_LOCAL7,
+}
+
+func parseFacility(facility string) (syslog.Priority, error) {
+ prio, ok := facilities[facility]
+ if !ok {
+ return syslog.LOG_LOCAL0, errors.New("invalid syslog facility")
+ }
+
+ return prio, nil
+}
+
+func init() {
+ Register("syslog", NewSyslog)
+}
diff --git a/pkg/middleware/logger.go b/pkg/middleware/logger.go
index eb5c7b8dde4..38262de573d 100644
--- a/pkg/middleware/logger.go
+++ b/pkg/middleware/logger.go
@@ -32,7 +32,12 @@ func Logger() macaron.Handler {
rw := res.(macaron.ResponseWriter)
c.Next()
- content := fmt.Sprintf("Completed %s %v %s in %v", req.URL.Path, rw.Status(), http.StatusText(rw.Status()), time.Since(start))
+ uname := c.GetCookie(setting.CookieUserName)
+ if len(uname) == 0 {
+ uname = "-"
+ }
+
+ content := fmt.Sprintf("Completed %s %s \"%s %s %s\" %v %s %d bytes in %dus", c.RemoteAddr(), uname, req.Method, req.URL.Path, req.Proto, rw.Status(), http.StatusText(rw.Status()), rw.Size(), time.Since(start)/time.Microsecond)
switch rw.Status() {
case 200, 304:
diff --git a/pkg/models/datasource.go b/pkg/models/datasource.go
index 38273598ab1..88abd03c319 100644
--- a/pkg/models/datasource.go
+++ b/pkg/models/datasource.go
@@ -40,6 +40,7 @@ type DataSource struct {
BasicAuth bool
BasicAuthUser string
BasicAuthPassword string
+ WithCredentials bool
IsDefault bool
JsonData map[string]interface{}
@@ -83,6 +84,7 @@ type AddDataSourceCommand struct {
BasicAuth bool `json:"basicAuth"`
BasicAuthUser string `json:"basicAuthUser"`
BasicAuthPassword string `json:"basicAuthPassword"`
+ WithCredentials bool `json:"withCredentials"`
IsDefault bool `json:"isDefault"`
JsonData map[string]interface{} `json:"jsonData"`
@@ -103,6 +105,7 @@ type UpdateDataSourceCommand struct {
BasicAuth bool `json:"basicAuth"`
BasicAuthUser string `json:"basicAuthUser"`
BasicAuthPassword string `json:"basicAuthPassword"`
+ WithCredentials bool `json:"withCredentials"`
IsDefault bool `json:"isDefault"`
JsonData map[string]interface{} `json:"jsonData"`
diff --git a/pkg/services/sqlstore/datasource.go b/pkg/services/sqlstore/datasource.go
index ebb2ad977b1..4e1292afaa6 100644
--- a/pkg/services/sqlstore/datasource.go
+++ b/pkg/services/sqlstore/datasource.go
@@ -114,12 +114,14 @@ func UpdateDataSource(cmd *m.UpdateDataSourceCommand) error {
BasicAuth: cmd.BasicAuth,
BasicAuthUser: cmd.BasicAuthUser,
BasicAuthPassword: cmd.BasicAuthPassword,
+ WithCredentials: cmd.WithCredentials,
JsonData: cmd.JsonData,
Updated: time.Now(),
}
sess.UseBool("is_default")
sess.UseBool("basic_auth")
+ sess.UseBool("with_credentials")
_, err := sess.Where("id=? and org_id=?", ds.Id, ds.OrgId).Update(ds)
if err != nil {
diff --git a/pkg/services/sqlstore/migrations/datasource_mig.go b/pkg/services/sqlstore/migrations/datasource_mig.go
index 4f046b1f8e9..90f7dac85e6 100644
--- a/pkg/services/sqlstore/migrations/datasource_mig.go
+++ b/pkg/services/sqlstore/migrations/datasource_mig.go
@@ -96,4 +96,9 @@ func addDataSourceMigration(mg *Migrator) {
}))
mg.AddMigration("Drop old table data_source_v1 #2", NewDropTableMigration("data_source_v1"))
+
+ // add column to activate withCredentials option
+ mg.AddMigration("Add column with_credentials", NewAddColumnMigration(tableV2, &Column{
+ Name: "with_credentials", Type: DB_Bool, Nullable: false, Default: "0",
+ }))
}
diff --git a/pkg/services/sqlstore/migrator/column.go b/pkg/services/sqlstore/migrator/column.go
index db2db6dea04..11d6a1b8b08 100644
--- a/pkg/services/sqlstore/migrator/column.go
+++ b/pkg/services/sqlstore/migrator/column.go
@@ -55,7 +55,7 @@ func (col *Column) StringNoPk(d Dialect) string {
}
if col.Default != "" {
- sql += "DEFAULT " + col.Default + " "
+ sql += "DEFAULT " + d.Default(col) + " "
}
return sql
diff --git a/pkg/services/sqlstore/migrator/dialect.go b/pkg/services/sqlstore/migrator/dialect.go
index f2fffbb16b3..0c94eb82234 100644
--- a/pkg/services/sqlstore/migrator/dialect.go
+++ b/pkg/services/sqlstore/migrator/dialect.go
@@ -17,10 +17,11 @@ type Dialect interface {
SqlType(col *Column) string
SupportEngine() bool
LikeStr() string
+ Default(col *Column) string
CreateIndexSql(tableName string, index *Index) string
CreateTableSql(table *Table) string
- AddColumnSql(tableName string, Col *Column) string
+ AddColumnSql(tableName string, col *Column) string
CopyTableData(sourceTable string, targetTable string, sourceCols []string, targetCols []string) string
DropTable(tableName string) string
DropIndexSql(tableName string, index *Index) string
@@ -71,6 +72,10 @@ func (b *BaseDialect) EqStr() string {
return "="
}
+func (b *BaseDialect) Default(col *Column) string {
+ return col.Default
+}
+
func (b *BaseDialect) CreateTableSql(table *Table) string {
var sql string
sql = "CREATE TABLE IF NOT EXISTS "
diff --git a/pkg/services/sqlstore/migrator/migrations.go b/pkg/services/sqlstore/migrator/migrations.go
index a65c7ec7e81..7d97abb6bb9 100644
--- a/pkg/services/sqlstore/migrator/migrations.go
+++ b/pkg/services/sqlstore/migrator/migrations.go
@@ -64,6 +64,10 @@ type AddColumnMigration struct {
column *Column
}
+func NewAddColumnMigration(table Table, col *Column) *AddColumnMigration {
+ return &AddColumnMigration{tableName: table.Name, column: col}
+}
+
func (m *AddColumnMigration) Table(tableName string) *AddColumnMigration {
m.tableName = tableName
return m
diff --git a/pkg/services/sqlstore/migrator/postgres_dialect.go b/pkg/services/sqlstore/migrator/postgres_dialect.go
index 3ab13f49b49..826a00a1410 100644
--- a/pkg/services/sqlstore/migrator/postgres_dialect.go
+++ b/pkg/services/sqlstore/migrator/postgres_dialect.go
@@ -36,6 +36,17 @@ func (db *Postgres) AutoIncrStr() string {
return ""
}
+func (b *Postgres) Default(col *Column) string {
+ if col.Type == DB_Bool {
+ if col.Default == "0" {
+ return "FALSE"
+ } else {
+ return "TRUE"
+ }
+ }
+ return col.Default
+}
+
func (db *Postgres) SqlType(c *Column) string {
var res string
switch t := c.Type; t {
diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go
index d796d401da2..3edb5777da9 100644
--- a/pkg/setting/setting.go
+++ b/pkg/setting/setting.go
@@ -82,6 +82,7 @@ var (
AutoAssignOrg bool
AutoAssignOrgRole string
VerifyEmailEnabled bool
+ LoginHint string
// Http auth
AdminUser string
@@ -174,6 +175,9 @@ func applyEnvVariableOverrides() {
if len(envValue) > 0 {
key.SetValue(envValue)
+ if strings.Contains(envKey, "PASSWORD") {
+ envValue = "*********"
+ }
appliedEnvOverrides = append(appliedEnvOverrides, fmt.Sprintf("%s=%s", envKey, envValue))
}
}
@@ -188,6 +192,9 @@ func applyCommandLineDefaultProperties(props map[string]string) {
value, exists := props[keyString]
if exists {
key.SetValue(value)
+ if strings.Contains(keyString, "password") {
+ value = "*********"
+ }
appliedCommandLineProperties = append(appliedCommandLineProperties, fmt.Sprintf("%s=%s", keyString, value))
}
}
@@ -428,6 +435,7 @@ func NewConfigContext(args *CommandLineArgs) error {
AutoAssignOrg = users.Key("auto_assign_org").MustBool(true)
AutoAssignOrgRole = users.Key("auto_assign_org_role").In("Editor", []string{"Editor", "Admin", "Read Only Editor", "Viewer"})
VerifyEmailEnabled = users.Key("verify_email_enabled").MustBool(false)
+ LoginHint = users.Key("login_hint").String()
// anonymous access
AnonymousEnabled = Cfg.Section("auth.anonymous").Key("enabled").MustBool(false)
@@ -565,6 +573,14 @@ func initLogging(args *CommandLineArgs) {
"driver": sec.Key("driver").String(),
"conn": sec.Key("conn").String(),
}
+ case "syslog":
+ LogConfigs[i] = util.DynMap{
+ "level": level,
+ "network": sec.Key("network").MustString(""),
+ "address": sec.Key("address").MustString(""),
+ "facility": sec.Key("facility").MustString("local7"),
+ "tag": sec.Key("tag").MustString(""),
+ }
}
cfgJsonBytes, _ := json.Marshal(LogConfigs[i])
diff --git a/public/app/core/controllers/login_ctrl.js b/public/app/core/controllers/login_ctrl.js
index 22cb2c6f04b..df58112e871 100644
--- a/public/app/core/controllers/login_ctrl.js
+++ b/public/app/core/controllers/login_ctrl.js
@@ -18,6 +18,7 @@ function (angular, coreModule, config) {
$scope.googleAuthEnabled = config.googleAuthEnabled;
$scope.githubAuthEnabled = config.githubAuthEnabled;
$scope.disableUserSignUp = config.disableUserSignUp;
+ $scope.loginHint = config.loginHint;
$scope.loginMode = true;
$scope.submitBtnText = 'Log in';
diff --git a/public/app/core/directives/metric_segment.js b/public/app/core/directives/metric_segment.js
index 1d07544bb2d..bf7f7309b2b 100644
--- a/public/app/core/directives/metric_segment.js
+++ b/public/app/core/directives/metric_segment.js
@@ -55,8 +55,8 @@ function (_, $, coreModule) {
});
};
- $scope.switchToLink = function() {
- if (linkMode) { return; }
+ $scope.switchToLink = function(fromClick) {
+ if (linkMode && !fromClick) { return; }
clearTimeout(cancelBlur);
cancelBlur = null;
@@ -69,7 +69,7 @@ function (_, $, coreModule) {
$scope.inputBlur = function() {
// happens long before the click event on the typeahead options
// need to have long delay because the blur
- cancelBlur = setTimeout($scope.switchToLink, 100);
+ cancelBlur = setTimeout($scope.switchToLink, 200);
};
$scope.source = function(query, callback) {
@@ -100,7 +100,7 @@ function (_, $, coreModule) {
}
$input.val(value);
- $scope.switchToLink();
+ $scope.switchToLink(true);
return value;
};
diff --git a/public/app/core/directives/value_select_dropdown.js b/public/app/core/directives/value_select_dropdown.js
index 4f5076abd2f..873174c6fc6 100644
--- a/public/app/core/directives/value_select_dropdown.js
+++ b/public/app/core/directives/value_select_dropdown.js
@@ -156,7 +156,7 @@ function (angular, _, coreModule) {
vm.selectionsChanged = function(commitChange) {
vm.selectedValues = _.filter(vm.options, {selected: true});
- if (vm.selectedValues.length > 1 && vm.selectedValues.length !== vm.options.length) {
+ if (vm.selectedValues.length > 1) {
if (vm.selectedValues[0].text === 'All') {
vm.selectedValues[0].selected = false;
vm.selectedValues = vm.selectedValues.slice(1, vm.selectedValues.length);
diff --git a/public/app/core/routes/all.js b/public/app/core/routes/all.js
index fd029a27939..218310382d9 100644
--- a/public/app/core/routes/all.js
+++ b/public/app/core/routes/all.js
@@ -141,6 +141,9 @@ define([
controller: 'PluginEditCtrl',
resolve: loadOrgBundle,
})
+ .when('/global-alerts', {
+ templateUrl: 'app/features/dashboard/partials/globalAlerts.html',
+ })
.otherwise({
templateUrl: 'app/partials/error.html',
controller: 'ErrorCtrl'
diff --git a/public/app/core/table_model.ts b/public/app/core/table_model.ts
new file mode 100644
index 00000000000..7eb8d5ad92a
--- /dev/null
+++ b/public/app/core/table_model.ts
@@ -0,0 +1,39 @@
+
+class TableModel {
+ columns: any[];
+ rows: any[];
+ type: string;
+
+ constructor() {
+ this.columns = [];
+ this.rows = [];
+ this.type = 'table';
+ }
+
+ sort(options) {
+ if (options.col === null || this.columns.length <= options.col) {
+ return;
+ }
+
+ this.rows.sort(function(a, b) {
+ a = a[options.col];
+ b = b[options.col];
+ if (a < b) {
+ return -1;
+ }
+ if (a > b) {
+ return 1;
+ }
+ return 0;
+ });
+
+ this.columns[options.col].sort = true;
+
+ if (options.desc) {
+ this.rows.reverse();
+ this.columns[options.col].desc = true;
+ }
+ }
+}
+
+export = TableModel;
diff --git a/public/app/core/utils/rangeutil.ts b/public/app/core/utils/rangeutil.ts
index 9e44a50c81f..535dda7833e 100644
--- a/public/app/core/utils/rangeutil.ts
+++ b/public/app/core/utils/rangeutil.ts
@@ -17,9 +17,9 @@ var spans = {
var rangeOptions = [
{ from: 'now/d', to: 'now/d', display: 'Today', section: 2 },
- { from: 'now/d', to: 'now', display: 'The day so far', section: 2 },
+ { from: 'now/d', to: 'now', display: 'Today so far', section: 2 },
{ from: 'now/w', to: 'now/w', display: 'This week', section: 2 },
- { from: 'now/w', to: 'now', display: 'Week to date', section: 2 },
+ { from: 'now/w', to: 'now', display: 'This week so far', section: 2 },
{ from: 'now/M', to: 'now/M', display: 'This month', section: 2 },
{ from: 'now/y', to: 'now/y', display: 'This year', section: 2 },
diff --git a/public/app/features/admin/partials/orgs.html b/public/app/features/admin/partials/orgs.html
index 573c0799c68..01d2483c7a7 100644
--- a/public/app/features/admin/partials/orgs.html
+++ b/public/app/features/admin/partials/orgs.html
@@ -4,33 +4,35 @@
-
-
+
+
Organizations
-
-
-
- | Id |
- Name |
- |
-
-
- | {{org.id}} |
- {{org.name}} |
-
-
-
- Edit
-
-
-
-
-
- |
-
+
-
diff --git a/public/app/features/admin/partials/users.html b/public/app/features/admin/partials/users.html
index 6f8365e75dd..c7839b755e0 100644
--- a/public/app/features/admin/partials/users.html
+++ b/public/app/features/admin/partials/users.html
@@ -5,38 +5,42 @@
-
-
+
+
Users
-
-
- | Id |
- Name |
- Login |
- Email |
- Grafana Admin |
- |
-
-
- | {{user.id}} |
- {{user.name}} |
- {{user.login}} |
- {{user.email}} |
- {{user.isAdmin}} |
-
-
-
- Edit
-
-
-
-
-
- |
-
+
diff --git a/public/app/features/dashboard/partials/globalAlerts.html b/public/app/features/dashboard/partials/globalAlerts.html
new file mode 100644
index 00000000000..a849f50ffdd
--- /dev/null
+++ b/public/app/features/dashboard/partials/globalAlerts.html
@@ -0,0 +1,282 @@
+
+
+
+
+
+
+
Global alerts
+
+
+
+
+ -
+
+
+
+ -
+
+
+
+ -
+
+
+
+ -
+
+
+
+ -
+
+
+
+
+
+
diff --git a/public/app/features/dashboard/timeSrv.js b/public/app/features/dashboard/timeSrv.js
index 691bfd07904..62d7b8c591e 100644
--- a/public/app/features/dashboard/timeSrv.js
+++ b/public/app/features/dashboard/timeSrv.js
@@ -47,8 +47,9 @@ define([
if (value.length === 15) {
return moment.utc(value, 'YYYYMMDDTHHmmss');
}
- var epoch = parseInt(value);
- if (!_.isNaN(epoch)) {
+
+ if (!isNaN(value)) {
+ var epoch = parseInt(value);
return moment(epoch);
}
diff --git a/public/app/features/dashboard/timepicker/timepicker.html b/public/app/features/dashboard/timepicker/timepicker.html
index ce976e2cc3d..66093110700 100644
--- a/public/app/features/dashboard/timepicker/timepicker.html
+++ b/public/app/features/dashboard/timepicker/timepicker.html
@@ -16,14 +16,12 @@
-
-
Refresh every {{ctrl.dashboard.refresh}}
-