Merge pull request #3233 from influxdata/bugfix/hostlist-customdb
Allow for use of custom Retention Policy when querying for hosts from Host List page & Host pagespull/10616/head
commit
2467f4258b
|
@ -1,6 +1,7 @@
|
|||
## v1.5.0.0 [unreleased]
|
||||
|
||||
### Features
|
||||
1. [#3233](https://github.com/influxdata/chronograf/pull/3233): Add default retention policy field as option in source configuration for use in querying hosts from Host List page & Host pages
|
||||
|
||||
### UI Improvements
|
||||
1. [#3204](https://github.com/influxdata/chronograf/pull/3204): Notify user when a dashboard cell is added, removed, or cloned
|
||||
|
|
|
@ -46,6 +46,7 @@ func MarshalSource(s chronograf.Source) ([]byte, error) {
|
|||
Telegraf: s.Telegraf,
|
||||
Organization: s.Organization,
|
||||
Role: s.Role,
|
||||
DefaultRP: s.DefaultRP,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -69,6 +70,7 @@ func UnmarshalSource(data []byte, s *chronograf.Source) error {
|
|||
s.Telegraf = pb.Telegraf
|
||||
s.Organization = pb.Organization
|
||||
s.Role = pb.Role
|
||||
s.DefaultRP = pb.DefaultRP
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@ type Source struct {
|
|||
SharedSecret string `protobuf:"bytes,11,opt,name=SharedSecret,proto3" json:"SharedSecret,omitempty"`
|
||||
Organization string `protobuf:"bytes,12,opt,name=Organization,proto3" json:"Organization,omitempty"`
|
||||
Role string `protobuf:"bytes,13,opt,name=Role,proto3" json:"Role,omitempty"`
|
||||
DefaultRP string `protobuf:"bytes,14,opt,name=DefaultRP,proto3" json:"DefaultRP,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Source) Reset() { *m = Source{} }
|
||||
|
@ -163,6 +164,13 @@ func (m *Source) GetRole() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (m *Source) GetDefaultRP() string {
|
||||
if m != nil {
|
||||
return m.DefaultRP
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Dashboard struct {
|
||||
ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
|
||||
|
@ -1330,105 +1338,105 @@ func init() {
|
|||
func init() { proto.RegisterFile("internal.proto", fileDescriptorInternal) }
|
||||
|
||||
var fileDescriptorInternal = []byte{
|
||||
// 1586 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x5f, 0x8f, 0xdb, 0x44,
|
||||
0x10, 0x97, 0x93, 0x38, 0x89, 0x27, 0xd7, 0xe3, 0x64, 0x4e, 0xad, 0x29, 0x12, 0x0a, 0x16, 0x7f,
|
||||
0xc2, 0x9f, 0x1e, 0x55, 0x2a, 0xa4, 0xaa, 0x82, 0x4a, 0xb9, 0x0b, 0x2d, 0x47, 0xaf, 0xbd, 0xeb,
|
||||
0xe6, 0xee, 0x78, 0x42, 0xd5, 0x26, 0x99, 0x24, 0x56, 0x1d, 0xdb, 0xac, 0xed, 0xbb, 0x98, 0x8f,
|
||||
0xc0, 0x87, 0x40, 0x42, 0x82, 0x2f, 0x80, 0x78, 0xe1, 0x89, 0x77, 0x3e, 0x08, 0x5f, 0x01, 0x1e,
|
||||
0xd1, 0xec, 0xae, 0x1d, 0xe7, 0x92, 0x56, 0x45, 0x42, 0xbc, 0xed, 0x6f, 0x66, 0x3c, 0xbb, 0xf3,
|
||||
0x7f, 0x0c, 0xdb, 0x5e, 0x90, 0xa0, 0x08, 0xb8, 0xbf, 0x17, 0x89, 0x30, 0x09, 0xed, 0x66, 0x8e,
|
||||
0xdd, 0x3f, 0x2b, 0x50, 0x1f, 0x84, 0xa9, 0x18, 0xa1, 0xbd, 0x0d, 0x95, 0xc3, 0xbe, 0x63, 0xb4,
|
||||
0x8d, 0x4e, 0x95, 0x55, 0x0e, 0xfb, 0xb6, 0x0d, 0xb5, 0x27, 0x7c, 0x8e, 0x4e, 0xa5, 0x6d, 0x74,
|
||||
0x2c, 0x26, 0xcf, 0x44, 0x3b, 0xcd, 0x22, 0x74, 0xaa, 0x8a, 0x46, 0x67, 0xfb, 0x26, 0x34, 0xcf,
|
||||
0x62, 0xd2, 0x36, 0x47, 0xa7, 0x26, 0xe9, 0x05, 0x26, 0xde, 0x09, 0x8f, 0xe3, 0xcb, 0x50, 0x8c,
|
||||
0x1d, 0x53, 0xf1, 0x72, 0x6c, 0xef, 0x40, 0xf5, 0x8c, 0x1d, 0x39, 0x75, 0x49, 0xa6, 0xa3, 0xed,
|
||||
0x40, 0xa3, 0x8f, 0x13, 0x9e, 0xfa, 0x89, 0xd3, 0x68, 0x1b, 0x9d, 0x26, 0xcb, 0x21, 0xe9, 0x39,
|
||||
0x45, 0x1f, 0xa7, 0x82, 0x4f, 0x9c, 0xa6, 0xd2, 0x93, 0x63, 0x7b, 0x0f, 0xec, 0xc3, 0x20, 0xc6,
|
||||
0x51, 0x2a, 0x70, 0xf0, 0xdc, 0x8b, 0xce, 0x51, 0x78, 0x93, 0xcc, 0xb1, 0xa4, 0x82, 0x0d, 0x1c,
|
||||
0xba, 0xe5, 0x31, 0x26, 0x9c, 0xee, 0x06, 0xa9, 0x2a, 0x87, 0xb6, 0x0b, 0x5b, 0x83, 0x19, 0x17,
|
||||
0x38, 0x1e, 0xe0, 0x48, 0x60, 0xe2, 0xb4, 0x24, 0x7b, 0x85, 0x46, 0x32, 0xc7, 0x62, 0xca, 0x03,
|
||||
0xef, 0x3b, 0x9e, 0x78, 0x61, 0xe0, 0x6c, 0x29, 0x99, 0x32, 0x8d, 0xbc, 0xc4, 0x42, 0x1f, 0x9d,
|
||||
0x6b, 0xca, 0x4b, 0x74, 0x76, 0x7f, 0x35, 0xc0, 0xea, 0xf3, 0x78, 0x36, 0x0c, 0xb9, 0x18, 0xbf,
|
||||
0x92, 0xaf, 0x6f, 0x81, 0x39, 0x42, 0xdf, 0x8f, 0x9d, 0x6a, 0xbb, 0xda, 0x69, 0x75,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8e, 0x47, 0xdc, 0xcf, 0x4b, 0x5f, 0x01, 0xf7, 0x77, 0x83,
|
||||
0x46, 0x82, 0x6a, 0x65, 0x6b, 0x1e, 0x7e, 0x03, 0x9a, 0xd4, 0xe6, 0x9e, 0x5d, 0x70, 0xa1, 0x0d,
|
||||
0x6e, 0x10, 0x3e, 0xe7, 0xc2, 0xfe, 0x04, 0xea, 0xb2, 0x42, 0x36, 0xb4, 0xd5, 0x5c, 0x9d, 0xf4,
|
||||
0x2a, 0xd3, 0x62, 0x45, 0xe3, 0xa9, 0x95, 0x1a, 0x4f, 0x61, 0xac, 0x59, 0x36, 0xf6, 0x16, 0x98,
|
||||
0xd4, 0xc1, 0x32, 0xf9, 0xfa, 0x8d, 0x9a, 0x55, 0x9f, 0x53, 0x52, 0xee, 0x19, 0x5c, 0x5b, 0xb9,
|
||||
0xb1, 0xb8, 0xc9, 0x58, 0xbd, 0x69, 0x59, 0xed, 0x96, 0xae, 0x6e, 0x2a, 0xa5, 0x18, 0x7d, 0x1c,
|
||||
0x25, 0x38, 0xd6, 0x59, 0x57, 0x60, 0xf7, 0x47, 0x63, 0xa9, 0x57, 0xde, 0x47, 0x29, 0x3a, 0x0a,
|
||||
0xe7, 0x73, 0x1e, 0x8c, 0xb5, 0xea, 0x1c, 0x92, 0xdf, 0xc6, 0x43, 0xad, 0xba, 0x32, 0x1e, 0x12,
|
||||
0x16, 0x91, 0x8e, 0x60, 0x45, 0x44, 0x94, 0x3b, 0x73, 0xe4, 0x71, 0x2a, 0x70, 0x8e, 0x41, 0xa2,
|
||||
0x5d, 0x50, 0x26, 0xd9, 0x37, 0xa0, 0x91, 0xf0, 0xe9, 0x33, 0xea, 0x51, 0x3a, 0x92, 0x09, 0x9f,
|
||||
0x3e, 0xc2, 0xcc, 0x7e, 0x13, 0x2c, 0x59, 0xa5, 0x92, 0xa5, 0xc2, 0xd9, 0x94, 0x84, 0x47, 0x98,
|
||||
0xb9, 0x7f, 0x1b, 0x50, 0x1f, 0xa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61, 0x5f, 0xe6, 0x79, 0x95, 0x69, 0xe4, 0xfe, 0x64, 0x40, 0x8d, 0x7a, 0x51, 0x49,
|
||||
0x75, 0xed, 0x65, 0x7d, 0xec, 0x44, 0x84, 0x17, 0xde, 0x18, 0x45, 0x6e, 0x5c, 0x8e, 0xa5, 0xd3,
|
||||
0x47, 0x33, 0x2c, 0x06, 0xbe, 0x46, 0x94, 0x6b, 0xf4, 0xff, 0x90, 0xd7, 0x52, 0x29, 0xd7, 0x88,
|
||||
0xcc, 0x14, 0x93, 0x36, 0xbb, 0x41, 0x1a, 0xa1, 0xe8, 0x8d, 0xe7, 0x5e, 0xbe, 0x01, 0x95, 0x28,
|
||||
0xee, 0x7d, 0xf5, 0x47, 0xb2, 0xd6, 0xd1, 0x8c, 0xcd, 0x7f, 0x2f, 0x57, 0x5f, 0xee, 0xfe, 0x6c,
|
||||
0x40, 0xe3, 0xb1, 0xde, 0xd5, 0xca, 0x56, 0x18, 0x2f, 0xb4, 0xa2, 0xb2, 0x62, 0x45, 0x17, 0x76,
|
||||
0x73, 0x99, 0x95, 0xfb, 0x95, 0x17, 0x36, 0xf2, 0xb4, 0x47, 0x6b, 0x45, 0xb0, 0x5e, 0xe5, 0x77,
|
||||
0xe5, 0x74, 0x55, 0x66, 0x53, 0xc0, 0xd7, 0xa2, 0xd2, 0x86, 0x96, 0xfe, 0xcd, 0x94, 0x3f, 0x6d,
|
||||
0xba, 0xa9, 0x96, 0x48, 0x6e, 0x17, 0xea, 0x07, 0x61, 0x30, 0xf1, 0xa6, 0x76, 0x07, 0x6a, 0xbd,
|
||||
0x34, 0x99, 0x49, 0x8d, 0xad, 0xee, 0x6e, 0xa9, 0xf0, 0xd3, 0x64, 0xa6, 0x64, 0x98, 0x94, 0x70,
|
||||
0x3f, 0x03, 0x58, 0xd2, 0x68, 0x4a, 0x2c, 0xa3, 0xf1, 0x04, 0x2f, 0x29, 0x65, 0x62, 0xa9, 0xa5,
|
||||
0xc9, 0x36, 0x70, 0xdc, 0xcf, 0xc1, 0xda, 0x4f, 0x3d, 0x7f, 0x7c, 0x18, 0x4c, 0x42, 0x6a, 0x1d,
|
||||
0xe7, 0x28, 0xe2, 0x65, 0xbc, 0x72, 0x48, 0xee, 0xa6, 0x2e, 0x52, 0xd4, 0x90, 0x46, 0xc3, 0xba,
|
||||
0xfc, 0xcd, 0xbf, 0xf3, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xda, 0x7c, 0x0d, 0xab, 0xf8, 0x0f,
|
||||
0x00, 0x00,
|
||||
// 1599 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0xdb, 0xc8,
|
||||
0x15, 0x07, 0x45, 0x51, 0x12, 0x9f, 0x1c, 0xd7, 0x98, 0x1a, 0x09, 0x9b, 0x16, 0x85, 0x4a, 0xf4,
|
||||
0x43, 0xfd, 0x88, 0x1b, 0x28, 0x28, 0x10, 0x04, 0x6d, 0x00, 0xd9, 0x6a, 0x52, 0x37, 0x4e, 0xec,
|
||||
0x8c, 0x6c, 0xf7, 0x54, 0x04, 0x23, 0x69, 0x24, 0x11, 0xa1, 0x48, 0x76, 0x48, 0xda, 0x62, 0xcf,
|
||||
0x3d, 0xf5, 0x8f, 0x28, 0x50, 0xa0, 0xfd, 0x07, 0x8a, 0x5e, 0xf6, 0xb4, 0xf7, 0xfd, 0x87, 0x76,
|
||||
0x8f, 0x8b, 0x37, 0x1f, 0x24, 0x65, 0x29, 0x41, 0x16, 0x58, 0xec, 0x6d, 0x7e, 0xef, 0x3d, 0xbd,
|
||||
0x99, 0xf7, 0xfd, 0x28, 0xd8, 0x0f, 0xa2, 0x8c, 0x8b, 0x88, 0x85, 0x47, 0x89, 0x88, 0xb3, 0x98,
|
||||
0x74, 0x0c, 0xf6, 0xff, 0x61, 0x43, 0x6b, 0x1c, 0xe7, 0x62, 0xca, 0xc9, 0x3e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4, 0xa1, 0x39, 0xcc, 0xb3, 0xa5,
|
||||
0xd4, 0xd8, 0x1d, 0x1c, 0xd6, 0x0a, 0x3f, 0xcf, 0x96, 0x4a, 0x86, 0x4a, 0x09, 0xff, 0xf7, 0x00,
|
||||
0x15, 0x0d, 0xa7, 0x44, 0x15, 0x8d, 0x37, 0xfc, 0x16, 0x53, 0x26, 0x95, 0x5a, 0x3a, 0x74, 0x07,
|
||||
0xc7, 0xff, 0x03, 0xb8, 0xc7, 0x79, 0x10, 0xce, 0x4e, 0xa3, 0x79, 0x8c, 0xad, 0xe3, 0x9a, 0x8b,
|
||||
0xb4, 0x8a, 0x97, 0x81, 0xe8, 0x6e, 0xec, 0x22, 0x65, 0x0d, 0x69, 0x34, 0x69, 0xc9, 0x3f, 0x01,
|
||||
0x9e, 0x7c, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xb6, 0xb2, 0x98, 0x60, 0x16, 0x10, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ message Source {
|
|||
string SharedSecret = 11; // SharedSecret signs the optional InfluxDB JWT Authorization
|
||||
string Organization = 12; // Organization is the organization ID that resource belongs to
|
||||
string Role = 13; // Role is the name of the miniumum role that a user must possess to access the resource
|
||||
string DefaultRP = 14; // DefaultRP is the default retention policy used in database queries to this source
|
||||
}
|
||||
|
||||
message Dashboard {
|
||||
|
|
|
@ -28,6 +28,7 @@ func TestSourceStore(t *testing.T) {
|
|||
URL: "toyota-hilux.lyon-estates.local",
|
||||
Default: true,
|
||||
Organization: "1337",
|
||||
DefaultRP: "pineapple",
|
||||
},
|
||||
chronograf.Source{
|
||||
Name: "HipToBeSquare",
|
||||
|
@ -67,8 +68,10 @@ func TestSourceStore(t *testing.T) {
|
|||
// Update source.
|
||||
srcs[0].Username = "calvinklein"
|
||||
srcs[1].Name = "Enchantment Under the Sea Dance"
|
||||
srcs[2].DefaultRP = "cubeapple"
|
||||
mustUpdateSource(t, s, srcs[0])
|
||||
mustUpdateSource(t, s, srcs[1])
|
||||
mustUpdateSource(t, s, srcs[2])
|
||||
|
||||
// Confirm sources have updated.
|
||||
if src, err := s.Get(ctx, srcs[0].ID); err != nil {
|
||||
|
@ -81,6 +84,11 @@ func TestSourceStore(t *testing.T) {
|
|||
} else if src.Name != "Enchantment Under the Sea Dance" {
|
||||
t.Fatalf("source 1 update error: got %v, expected %v", src.Name, "Enchantment Under the Sea Dance")
|
||||
}
|
||||
if src, err := s.Get(ctx, srcs[2].ID); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if src.DefaultRP != "cubeapple" {
|
||||
t.Fatalf("source 2 update error: got %v, expected %v", src.DefaultRP, "cubeapple")
|
||||
}
|
||||
|
||||
// Attempt to make two default sources
|
||||
srcs[0].Default = true
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Apache Bytes/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"BytesPerSec\")) AS \"bytes_per_sec\" FROM apache",
|
||||
"query": "SELECT non_negative_derivative(max(\"BytesPerSec\")) AS \"bytes_per_sec\" FROM \":db:\".\":rp:\".\"apache\"",
|
||||
"label": "bytes/s",
|
||||
"groupbys": [
|
||||
"\"server\""
|
||||
|
@ -31,7 +31,7 @@
|
|||
"name": "Apache - Requests/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"ReqPerSec\")) AS \"req_per_sec\" FROM apache",
|
||||
"query": "SELECT non_negative_derivative(max(\"ReqPerSec\")) AS \"req_per_sec\" FROM \":db:\".\":rp:\".\"apache\"",
|
||||
"label": "requests/s",
|
||||
"groupbys": [
|
||||
"\"server\""
|
||||
|
@ -49,7 +49,7 @@
|
|||
"name": "Apache - Total Accesses",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"TotalAccesses\")) AS \"tot_access\" FROM apache",
|
||||
"query": "SELECT non_negative_derivative(max(\"TotalAccesses\")) AS \"tot_access\" FROM \":db:\".\":rp:\".\"apache\"",
|
||||
"label": "accesses/s",
|
||||
"groupbys": [
|
||||
"\"server\""
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Consul – Number of Critical Health Checks",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT count(\"check_id\") as \"Number Critical\" FROM consul_health_checks",
|
||||
"query": "SELECT count(\"check_id\") as \"Number Critical\" FROM \":db:\".\":rp:\".\"consul_health_checks\"",
|
||||
"label": "count",
|
||||
"groupbys": [
|
||||
"\"service_name\""
|
||||
|
@ -33,7 +33,7 @@
|
|||
"name": "Consul – Number of Warning Health Checks",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT count(\"check_id\") as \"Number Warning\" FROM consul_health_checks",
|
||||
"query": "SELECT count(\"check_id\") as \"Number Warning\" FROM \":db:\".\":rp:\".\"consul_health_checks\"",
|
||||
"label": "count",
|
||||
"groupbys": [
|
||||
"\"service_name\""
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Consul Agent – Number of Go Routines",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"value\") AS \"Go Routines\" FROM \"consul_ip-172-31-6-247_runtime_num_goroutines\"",
|
||||
"query": "SELECT max(\"value\") AS \"Go Routines\" FROM \":db:\".\":rp:\".\"consul_ip-172-31-6-247_runtime_num_goroutines\"",
|
||||
"groupbys": [
|
||||
],
|
||||
"wheres": [
|
||||
|
@ -30,7 +30,7 @@
|
|||
"name": "Consul Agent – Runtime Alloc Bytes",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"value\") AS \"Runtime Alloc Bytes\" FROM \"consul_ip-172-31-6-247_runtime_alloc_bytes\"",
|
||||
"query": "SELECT max(\"value\") AS \"Runtime Alloc Bytes\" FROM \":db:\".\":rp:\".\"consul_ip-172-31-6-247_runtime_alloc_bytes\"",
|
||||
"groupbys": [
|
||||
],
|
||||
"wheres": [
|
||||
|
@ -47,7 +47,7 @@
|
|||
"name": "Consul Agent – Heap Objects",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"value\") AS \"Heap Objects\" FROM \"consul_ip-172-31-6-247_runtime_heap_objects\"",
|
||||
"query": "SELECT max(\"value\") AS \"Heap Objects\" FROM \":db:\".\":rp:\".\"consul_ip-172-31-6-247_runtime_heap_objects\"",
|
||||
"groupbys": [
|
||||
],
|
||||
"wheres": [
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Consul – Number of Agents",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT min(\"value\") AS \"num_agents\" FROM \"consul_memberlist_msg_alive\"",
|
||||
"query": "SELECT min(\"value\") AS \"num_agents\" FROM \":db:\".\":rp:\".\"consul_memberlist_msg_alive\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Consul – Leadership Election",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"value\") AS \"max_value\" FROM \"consul_raft_state_candidate\"",
|
||||
"query": "SELECT max(\"value\") AS \"max_value\" FROM \":db:\".\":rp:\".\"consul_raft_state_candidate\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Consul – HTTP Request Time (ms)",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"upper\") AS \"GET_health_state\" FROM \"consul_consul_http_GET_v1_health_state__\"",
|
||||
"query": "SELECT max(\"upper\") AS \"GET_health_state\" FROM \":db:\".\":rp:\".\"consul_consul_http_GET_v1_health_state__\"",
|
||||
"label": "ms",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Consul – Leadership Change",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"value\") as \"change\" FROM \"consul_raft_state_leader\"",
|
||||
"query": "SELECT max(\"value\") as \"change\" FROM \":db:\".\":rp:\".\"consul_raft_state_leader\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Consul – Number of serf events",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"value\") AS \"serf_events\" FROM \"consul_serf_events\"",
|
||||
"query": "SELECT max(\"value\") AS \"serf_events\" FROM \":db:\".\":rp:\".\"consul_serf_events\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "CPU Usage",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT 100 - mean(\"usage_idle\") AS \"usage\" FROM \"cpu\"",
|
||||
"query": "SELECT 100 - mean(\"usage_idle\") AS \"usage\" FROM \":db:\".\":rp:\".\"cpu\"",
|
||||
"label": "% CPU time",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "System - Disk used %",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"used_percent\") AS \"used_percent\" FROM disk",
|
||||
"query": "SELECT mean(\"used_percent\") AS \"used_percent\" FROM \":db:\".\":rp:\".\"disk\"",
|
||||
"label": "% used",
|
||||
"groupbys": [
|
||||
"\"path\""
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "System – Disk MB/s",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"read_bytes\"), 1s) / 1000000 AS \"read_megabytes_per_second\" FROM diskio",
|
||||
"query": "SELECT non_negative_derivative(max(\"read_bytes\"), 1s) / 1000000 AS \"read_megabytes_per_second\" FROM \":db:\".\":rp:\".\"diskio\"",
|
||||
"groupbys": [
|
||||
"\"name\""
|
||||
],
|
||||
|
@ -21,7 +21,7 @@
|
|||
"label": "MB/s"
|
||||
},
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"write_bytes\"), 1s) / 1000000 AS \"write_megabytes_per_second\" FROM diskio",
|
||||
"query": "SELECT non_negative_derivative(max(\"write_bytes\"), 1s) / 1000000 AS \"write_megabytes_per_second\" FROM \":db:\".\":rp:\".\"diskio\"",
|
||||
"groupbys": [
|
||||
"\"name\""
|
||||
],
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Docker - Container CPU %",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"usage_percent\") AS \"usage_percent\" FROM \"docker_container_cpu\"",
|
||||
"query": "SELECT mean(\"usage_percent\") AS \"usage_percent\" FROM \":db:\".\":rp:\".\"docker_container_cpu\"",
|
||||
"label": "% CPU time",
|
||||
"groupbys": [
|
||||
"\"container_name\""
|
||||
|
@ -31,7 +31,7 @@
|
|||
"name": "Docker - Container Memory (MB)",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"usage\") / 1048576 AS \"usage\" FROM \"docker_container_mem\"",
|
||||
"query": "SELECT mean(\"usage\") / 1048576 AS \"usage\" FROM \":db:\".\":rp:\".\"docker_container_mem\"",
|
||||
"label": "MB",
|
||||
"groupbys": [
|
||||
"\"container_name\""
|
||||
|
@ -49,7 +49,7 @@
|
|||
"name": "Docker - Containers",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"n_containers\") AS \"max_n_containers\" FROM \"docker\"",
|
||||
"query": "SELECT max(\"n_containers\") AS \"max_n_containers\" FROM \":db:\".\":rp:\".\"docker\"",
|
||||
"label": "count",
|
||||
"groupbys": [
|
||||
"\"host\""
|
||||
|
@ -68,7 +68,7 @@
|
|||
"name": "Docker - Images",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"n_images\") AS \"max_n_images\" FROM \"docker\"",
|
||||
"query": "SELECT max(\"n_images\") AS \"max_n_images\" FROM \":db:\".\":rp:\".\"docker\"",
|
||||
"groupbys": [
|
||||
"\"host\""
|
||||
]
|
||||
|
@ -86,20 +86,20 @@
|
|||
"name": "Docker - Container State",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"n_containers_running\") AS \"max_n_containers_running\" FROM \"docker\"",
|
||||
"query": "SELECT max(\"n_containers_running\") AS \"max_n_containers_running\" FROM \":db:\".\":rp:\".\"docker\"",
|
||||
"label": "count",
|
||||
"groupbys": [
|
||||
"\"host\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"query": "SELECT max(\"n_containers_stopped\") AS \"max_n_containers_stopped\" FROM \"docker\"",
|
||||
"query": "SELECT max(\"n_containers_stopped\") AS \"max_n_containers_stopped\" FROM \":db:\".\":rp:\".\"docker\"",
|
||||
"groupbys": [
|
||||
"\"host\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"query": "SELECT max(\"n_containers_paused\") AS \"max_n_containers_paused\" FROM \"docker\"",
|
||||
"query": "SELECT max(\"n_containers_paused\") AS \"max_n_containers_paused\" FROM \":db:\".\":rp:\".\"docker\"",
|
||||
"groupbys": [
|
||||
"\"host\""
|
||||
]
|
||||
|
|
|
@ -13,28 +13,28 @@
|
|||
"name": "Docker - Container Block IO",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"io_serviced_recursive_read\") AS \"max_io_read\" FROM \"docker_container_blkio\"",
|
||||
"query": "SELECT max(\"io_serviced_recursive_read\") AS \"max_io_read\" FROM \":db:\".\":rp:\".\"docker_container_blkio\"",
|
||||
"groupbys": [
|
||||
"\"container_name\""
|
||||
],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT max(\"io_serviced_recursive_sync\") AS \"max_io_sync\" FROM \"docker_container_blkio\"",
|
||||
"query": "SELECT max(\"io_serviced_recursive_sync\") AS \"max_io_sync\" FROM \":db:\".\":rp:\".\"docker_container_blkio\"",
|
||||
"groupbys": [
|
||||
"\"container_name\""
|
||||
],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT max(\"io_serviced_recursive_write\") AS \"max_io_write\" FROM \"docker_container_blkio\"",
|
||||
"query": "SELECT max(\"io_serviced_recursive_write\") AS \"max_io_write\" FROM \":db:\".\":rp:\".\"docker_container_blkio\"",
|
||||
"groupbys": [
|
||||
"\"container_name\""
|
||||
],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT max(\"io_serviced_recursive_total\") AS \"max_io_total\" FROM \"docker_container_blkio\"",
|
||||
"query": "SELECT max(\"io_serviced_recursive_total\") AS \"max_io_total\" FROM \":db:\".\":rp:\".\"docker_container_blkio\"",
|
||||
"groupbys": [
|
||||
"\"container_name\""
|
||||
],
|
||||
|
|
|
@ -13,14 +13,14 @@
|
|||
"name": "Docker - Container Network",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT derivative(mean(\"tx_bytes\"), 10s) AS \"net_tx_bytes\" FROM \"docker_container_net\"",
|
||||
"query": "SELECT derivative(mean(\"tx_bytes\"), 10s) AS \"net_tx_bytes\" FROM \":db:\".\":rp:\".\"docker_container_net\"",
|
||||
"groupbys": [
|
||||
"\"container_name\""
|
||||
],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT derivative(mean(\"rx_bytes\"), 10s) AS \"net_rx_bytes\" FROM \"docker_container_net\"",
|
||||
"query": "SELECT derivative(mean(\"rx_bytes\"), 10s) AS \"net_rx_bytes\" FROM \":db:\".\":rp:\".\"docker_container_net\"",
|
||||
"groupbys": [
|
||||
"\"container_name\""
|
||||
],
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "HAProxy – Number of Servers",
|
||||
"queries": [
|
||||
{
|
||||
"query": "select mean(\"active_servers\") AS active_servers, mean(\"backup_servers\") AS backup_servers FROM haproxy",
|
||||
"query": "select mean(\"active_servers\") AS active_servers, mean(\"backup_servers\") AS backup_servers FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
|||
"name": "HAProxy – Sum HTTP 2xx",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(last(\"http_response.2xx\"), 1s) AS \"2xx\" FROM haproxy",
|
||||
"query": "SELECT non_negative_derivative(last(\"http_response.2xx\"), 1s) AS \"2xx\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -43,7 +43,7 @@
|
|||
"name": "HAProxy – Sum HTTP 4xx",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(last(\"http_response.4xx\"), 1s) AS \"4xx\" FROM haproxy",
|
||||
"query": "SELECT non_negative_derivative(last(\"http_response.4xx\"), 1s) AS \"4xx\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -58,7 +58,7 @@
|
|||
"name": "HAProxy – Sum HTTP 5xx",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(last(\"http_response.5xx\"), 1s) AS \"5xx\" FROM haproxy",
|
||||
"query": "SELECT non_negative_derivative(last(\"http_response.5xx\"), 1s) AS \"5xx\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -73,7 +73,7 @@
|
|||
"name": "HAProxy – Frontend HTTP Requests/Second ",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"req_rate\") AS \"requests_per_second\" FROM haproxy",
|
||||
"query": "SELECT mean(\"req_rate\") AS \"requests_per_second\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -88,7 +88,7 @@
|
|||
"name": "HAProxy – Frontend Sessions/Second ",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"rate\")) AS \"sessions_per_second\" FROM haproxy",
|
||||
"query": "SELECT non_negative_derivative(max(\"rate\")) AS \"sessions_per_second\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -103,7 +103,7 @@
|
|||
"name": "HAProxy – Frontend Session Usage %",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"scur\")) / non_negative_derivative(max(\"slim\")) * 100 AS \"session_usage_percent\" FROM haproxy",
|
||||
"query": "SELECT non_negative_derivative(max(\"scur\")) / non_negative_derivative(max(\"slim\")) * 100 AS \"session_usage_percent\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -118,7 +118,7 @@
|
|||
"name": "HAProxy – Frontend Security Denials/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"dreq\")) AS \"denials_per_second\" FROM haproxy",
|
||||
"query": "SELECT non_negative_derivative(max(\"dreq\")) AS \"denials_per_second\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -133,7 +133,7 @@
|
|||
"name": "HAProxy – Frontend Request Errors/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"ereq\")) AS \"errors_per_second\" FROM haproxy",
|
||||
"query": "SELECT non_negative_derivative(max(\"ereq\")) AS \"errors_per_second\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -148,12 +148,12 @@
|
|||
"name": "HAProxy – Frontend Bytes/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"bin\")) AS \"bytes_in_per_second\" FROM haproxy",
|
||||
"query": "SELECT non_negative_derivative(max(\"bin\")) AS \"bytes_in_per_second\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"bout\")) AS \"bytes_out_per_second\" FROM haproxy",
|
||||
"query": "SELECT non_negative_derivative(max(\"bout\")) AS \"bytes_out_per_second\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -168,7 +168,7 @@
|
|||
"name": "HAProxy – Backend Average Response Time (ms)",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"rtime\") AS \"response_time\" FROM haproxy",
|
||||
"query": "SELECT max(\"rtime\") AS \"response_time\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -183,7 +183,7 @@
|
|||
"name": "HAProxy – Backend Connection Errors/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"econ\")) AS \"errors_per_second\" FROM haproxy",
|
||||
"query": "SELECT non_negative_derivative(max(\"econ\")) AS \"errors_per_second\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -198,7 +198,7 @@
|
|||
"name": "HAProxy – Backend Queued Requests/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"qcur\")) AS \"queued_per_second\" FROM haproxy",
|
||||
"query": "SELECT non_negative_derivative(max(\"qcur\")) AS \"queued_per_second\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -213,7 +213,7 @@
|
|||
"name": "HAProxy – Backend Average Request Queue Time (ms)",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"qtime\") AS \"queue_time\" FROM haproxy",
|
||||
"query": "SELECT max(\"qtime\") AS \"queue_time\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -228,7 +228,7 @@
|
|||
"name": "HAProxy – Backend Error Responses/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"eresp\") AS \"error_response_rate\" FROM haproxy",
|
||||
"query": "SELECT max(\"eresp\") AS \"error_response_rate\" FROM \":db:\".\":rp:\".\"haproxy\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
"name": "InfluxDB - Cardinality",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"numMeasurements\") AS \"measurements\" FROM \"influxdb_database\"",
|
||||
"query": "SELECT max(\"numMeasurements\") AS \"measurements\" FROM \":db:\".\":rp:\".\"influxdb_database\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT max(\"numSeries\") AS \"series\" FROM \"influxdb_database\"",
|
||||
"query": "SELECT max(\"numSeries\") AS \"series\" FROM \":db:\".\":rp:\".\"influxdb_database\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "InfluxDB - Write HTTP Requests",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"writeReq\")) AS \"http_requests\" FROM \"influxdb_httpd\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"writeReq\")) AS \"http_requests\" FROM \":db:\".\":rp:\".\"influxdb_httpd\"",
|
||||
"label": "count/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -29,7 +29,7 @@
|
|||
"name": "InfluxDB - Query Requests",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"queryReq\")) AS \"query_requests\" FROM \"influxdb_httpd\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"queryReq\")) AS \"query_requests\" FROM \":db:\".\":rp:\".\"influxdb_httpd\"",
|
||||
"label": "count/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -46,13 +46,13 @@
|
|||
"name": "InfluxDB - Client Failures",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"clientError\")) AS \"client_errors\" FROM \"influxdb_httpd\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"clientError\")) AS \"client_errors\" FROM \":db:\".\":rp:\".\"influxdb_httpd\"",
|
||||
"label": "count/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"authFail\"), 1s) AS \"auth_fail\" FROM \"influxdb_httpd\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"authFail\"), 1s) AS \"auth_fail\" FROM \":db:\".\":rp:\".\"influxdb_httpd\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
"name": "InfluxDB - Query Performance",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"queryDurationNs\"), 1s) / 1000000 AS \"duration_ms\" FROM \"influxdb_queryExecutor\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"queryDurationNs\"), 1s) / 1000000 AS \"duration_ms\" FROM \":db:\".\":rp:\".\"influxdb_queryExecutor\"",
|
||||
"label": "ms",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"queriesExecuted\"), 1s) / 1000000 AS \"queries_executed_ms\" FROM \"influxdb_queryExecutor\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"queriesExecuted\"), 1s) / 1000000 AS \"queries_executed_ms\" FROM \":db:\".\":rp:\".\"influxdb_queryExecutor\"",
|
||||
"label": "ms",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "InfluxDB - Write Points",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"pointReq\")) AS \"points_written\" FROM \"influxdb_write\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"pointReq\")) AS \"points_written\" FROM \":db:\".\":rp:\".\"influxdb_write\"",
|
||||
"label": "points/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -29,13 +29,13 @@
|
|||
"name": "InfluxDB - Write Errors",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"writeError\")) AS \"shard_write_error\" FROM \"influxdb_write\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"writeError\")) AS \"shard_write_error\" FROM \":db:\".\":rp:\".\"influxdb_write\"",
|
||||
"label": "errors/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"serveError\")) AS \"http_error\" FROM \"influxdb_httpd\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"serveError\")) AS \"http_error\" FROM \":db:\".\":rp:\".\"influxdb_httpd\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "K8s - Node Millicores",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"cpu_usage_nanocores\") / 1000000 AS \"cpu_usage_millicores\" FROM kubernetes_node",
|
||||
"query": "SELECT mean(\"cpu_usage_nanocores\") / 1000000 AS \"cpu_usage_millicores\" FROM \":db:\".\":rp:\".\"kubernetes_node\"",
|
||||
"groupbys": [
|
||||
"\"node_name\""
|
||||
],
|
||||
|
@ -30,7 +30,7 @@
|
|||
"name": "K8s - Node Memory Bytes",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"memory_usage_bytes\") AS \"memory_usage_bytes\" FROM kubernetes_node",
|
||||
"query": "SELECT mean(\"memory_usage_bytes\") AS \"memory_usage_bytes\" FROM \":db:\".\":rp:\".\"kubernetes_node\"",
|
||||
"groupbys": [
|
||||
"\"node_name\""
|
||||
],
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "K8s - Pod Millicores",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"cpu_usage_nanocores\") / 1000000 AS \"cpu_usage_millicores\" FROM kubernetes_pod_container",
|
||||
"query": "SELECT mean(\"cpu_usage_nanocores\") / 1000000 AS \"cpu_usage_millicores\" FROM \":db:\".\":rp:\".\"kubernetes_pod_container\"",
|
||||
"groupbys": [
|
||||
"\"pod_name\""
|
||||
],
|
||||
|
@ -30,7 +30,7 @@
|
|||
"name": "K8s - Pod Memory Bytes",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"memory_usage_bytes\") AS \"memory_usage_bytes\" FROM kubernetes_pod_container",
|
||||
"query": "SELECT mean(\"memory_usage_bytes\") AS \"memory_usage_bytes\" FROM \":db:\".\":rp:\".\"kubernetes_pod_container\"",
|
||||
"groupbys": [
|
||||
"\"pod_name\""
|
||||
],
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "K8s - Pod TX Bytes/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"tx_bytes\")) AS \"tx_bytes_per_second\" FROM kubernetes_pod_network",
|
||||
"query": "SELECT non_negative_derivative(max(\"tx_bytes\")) AS \"tx_bytes_per_second\" FROM \":db:\".\":rp:\".\"kubernetes_pod_network\"",
|
||||
"groupbys": [
|
||||
"\"pod_name\"",
|
||||
"\"host\""
|
||||
|
@ -31,7 +31,7 @@
|
|||
"name": "K8s - Pod RX Bytes/Second ",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"rx_bytes\")) AS \"rx_bytes_per_second\" FROM kubernetes_pod_network",
|
||||
"query": "SELECT non_negative_derivative(max(\"rx_bytes\")) AS \"rx_bytes_per_second\" FROM \":db:\".\":rp:\".\"kubernetes_pod_network\"",
|
||||
"groupbys": [
|
||||
"\"pod_name\"",
|
||||
"\"host\""
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "K8s - Kubelet Millicores",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"cpu_usage_nanocores\") / 1000000 AS \"cpu_usage_millicores\" FROM kubernetes_system_container",
|
||||
"query": "SELECT mean(\"cpu_usage_nanocores\") / 1000000 AS \"cpu_usage_millicores\" FROM \":db:\".\":rp:\".\"kubernetes_system_container\"",
|
||||
"groupbys": [],
|
||||
"wheres": [
|
||||
"\"container_name\" = 'kubelet'"
|
||||
|
@ -30,7 +30,7 @@
|
|||
"name": "K8s - Kubelet Memory Bytes",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"memory_usage_bytes\") AS \"memory_usage_bytes\" FROM kubernetes_system_container",
|
||||
"query": "SELECT mean(\"memory_usage_bytes\") AS \"memory_usage_bytes\" FROM \":db:\".\":rp:\".\"kubernetes_system_container\"",
|
||||
"groupbys": [],
|
||||
"wheres": [
|
||||
"\"container_name\" = 'kubelet'"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "System Load",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"load1\") AS \"load\" FROM \"system\"",
|
||||
"query": "SELECT mean(\"load1\") AS \"load\" FROM \":db:\".\":rp:\".\"system\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "System - Memory Gigabytes Used",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"used\") / 1073741824 AS \"used\", mean(\"available\") / 1073741824 AS \"available\" FROM \"mem\"",
|
||||
"query": "SELECT mean(\"used\") / 1073741824 AS \"used\", mean(\"available\") / 1073741824 AS \"available\" FROM \":db:\".\":rp:\".\"mem\"",
|
||||
"label": "GB",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Memcached - Current Connections",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"curr_connections\") AS \"current_connections\" FROM memcached",
|
||||
"query": "SELECT max(\"curr_connections\") AS \"current_connections\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -29,7 +29,7 @@
|
|||
"name": "Memcached - Get Hits/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"get_hits\")) AS \"get_hits\" FROM memcached",
|
||||
"query": "SELECT non_negative_derivative(max(\"get_hits\")) AS \"get_hits\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "hits/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -45,7 +45,7 @@
|
|||
"name": "Memcached - Get Misses/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"get_misses\")) AS \"get_misses\" FROM memcached",
|
||||
"query": "SELECT non_negative_derivative(max(\"get_misses\")) AS \"get_misses\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "misses/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -61,7 +61,7 @@
|
|||
"name": "Memcached - Delete Hits/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"delete_hits\")) AS \"delete_hits\" FROM memcached",
|
||||
"query": "SELECT non_negative_derivative(max(\"delete_hits\")) AS \"delete_hits\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "deletes/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -77,7 +77,7 @@
|
|||
"name": "Memcached - Delete Misses/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"delete_misses\")) AS \"delete_misses\" FROM memcached",
|
||||
"query": "SELECT non_negative_derivative(max(\"delete_misses\")) AS \"delete_misses\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "delete misses/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -93,7 +93,7 @@
|
|||
"name": "Memcached - Incr Hits/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"incr_hits\")) AS \"incr_hits\" FROM memcached",
|
||||
"query": "SELECT non_negative_derivative(max(\"incr_hits\")) AS \"incr_hits\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "incr hits/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -109,7 +109,7 @@
|
|||
"name": "Memcached - Incr Misses/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"incr_misses\")) AS \"incr_misses\" FROM memcached",
|
||||
"query": "SELECT non_negative_derivative(max(\"incr_misses\")) AS \"incr_misses\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "incr misses/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -125,7 +125,7 @@
|
|||
"name": "Memcached - Current Items",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"curr_items\") AS \"current_items\" FROM memcached",
|
||||
"query": "SELECT max(\"curr_items\") AS \"current_items\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -141,7 +141,7 @@
|
|||
"name": "Memcached - Total Items",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"total_items\") AS \"total_items\" FROM memcached",
|
||||
"query": "SELECT max(\"total_items\") AS \"total_items\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -157,7 +157,7 @@
|
|||
"name": "Memcached - Bytes Stored",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"bytes\") AS \"bytes\" FROM memcached",
|
||||
"query": "SELECT max(\"bytes\") AS \"bytes\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "bytes",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -173,7 +173,7 @@
|
|||
"name": "Memcached - Bytes Read/Sec",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"bytes_read\")) AS \"bytes_read\" FROM memcached",
|
||||
"query": "SELECT non_negative_derivative(max(\"bytes_read\")) AS \"bytes_read\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "bytes/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -189,7 +189,7 @@
|
|||
"name": "Memcached - Bytes Written/Sec",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"bytes_written\")) AS \"bytes_written\" FROM memcached",
|
||||
"query": "SELECT non_negative_derivative(max(\"bytes_written\")) AS \"bytes_written\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "bytes/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -205,7 +205,7 @@
|
|||
"name": "Memcached - Evictions/10 Seconds",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"evictions\"), 10s) AS \"evictions\" FROM memcached",
|
||||
"query": "SELECT non_negative_derivative(max(\"evictions\"), 10s) AS \"evictions\" FROM \":db:\".\":rp:\".\"memcached\"",
|
||||
"label": "evictions / 10s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Mesos Active Slaves",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"master/slaves_active\") AS \"Active Slaves\" FROM \"mesos\"",
|
||||
"query": "SELECT max(\"master/slaves_active\") AS \"Active Slaves\" FROM \":db:\".\":rp:\".\"mesos\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -29,7 +29,7 @@
|
|||
"name": "Mesos Tasks Active",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"master/tasks_running\") AS \"num tasks\" FROM \"mesos\"",
|
||||
"query": "SELECT max(\"master/tasks_running\") AS \"num tasks\" FROM \":db:\".\":rp:\".\"mesos\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -45,18 +45,18 @@
|
|||
"name": "Mesos Tasks",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"master/tasks_finished\"), 60s) AS \"tasks finished\" FROM \"mesos\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"master/tasks_finished\"), 60s) AS \"tasks finished\" FROM \":db:\".\":rp:\".\"mesos\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"master/tasks_failed\"), 60s) AS \"tasks failed\" FROM \"mesos\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"master/tasks_failed\"), 60s) AS \"tasks failed\" FROM \":db:\".\":rp:\".\"mesos\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"master/tasks_killed\"), 60s) AS \"tasks killed\" FROM \"mesos\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"master/tasks_killed\"), 60s) AS \"tasks killed\" FROM \":db:\".\":rp:\".\"mesos\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -71,7 +71,7 @@
|
|||
"name": "Mesos Outstanding offers",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"master/outstanding_offers\") AS \"Outstanding Offers\" FROM \"mesos\"",
|
||||
"query": "SELECT max(\"master/outstanding_offers\") AS \"Outstanding Offers\" FROM \":db:\".\":rp:\".\"mesos\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -87,7 +87,7 @@
|
|||
"name": "Mesos Available/Used CPUs",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"master/cpus_total\") AS \"cpu total\", max(\"master/cpus_used\") AS \"cpu used\" FROM \"mesos\"",
|
||||
"query": "SELECT max(\"master/cpus_total\") AS \"cpu total\", max(\"master/cpus_used\") AS \"cpu used\" FROM \":db:\".\":rp:\".\"mesos\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -103,7 +103,7 @@
|
|||
"name": "Mesos Available/Used Memory",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"master/mem_total\") AS \"memory total\", max(\"master/mem_used\") AS \"memory used\" FROM \"mesos\"",
|
||||
"query": "SELECT max(\"master/mem_total\") AS \"memory total\", max(\"master/mem_used\") AS \"memory used\" FROM \":db:\".\":rp:\".\"mesos\"",
|
||||
"label": "MB",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -121,7 +121,7 @@
|
|||
"type": "single-stat",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"master/uptime_secs\") AS \"uptime\" FROM \"mesos\"",
|
||||
"query": "SELECT max(\"master/uptime_secs\") AS \"uptime\" FROM \":db:\".\":rp:\".\"mesos\"",
|
||||
"label": "Seconds",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "MongoDB – Read/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(queries_per_sec) AS queries_per_second, mean(getmores_per_sec) AS getmores_per_second FROM mongodb",
|
||||
"query": "SELECT mean(queries_per_sec) AS queries_per_second, mean(getmores_per_sec) AS getmores_per_second FROM \":db:\".\":rp:\".\"mongodb\"",
|
||||
"label": "reads/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -29,7 +29,7 @@
|
|||
"name": "MongoDB – Writes/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(inserts_per_sec) AS inserts_per_second, mean(updates_per_sec) AS updates_per_second, mean(deletes_per_sec) AS deletes_per_second FROM mongodb",
|
||||
"query": "SELECT mean(inserts_per_sec) AS inserts_per_second, mean(updates_per_sec) AS updates_per_second, mean(deletes_per_sec) AS deletes_per_second FROM \":db:\".\":rp:\".\"mongodb\"",
|
||||
"label": "writes/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -45,7 +45,7 @@
|
|||
"name": "MongoDB – Active Connections",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(open_connections) AS open_connections FROM mongodb",
|
||||
"query": "SELECT mean(open_connections) AS open_connections FROM \":db:\".\":rp:\".\"mongodb\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -61,7 +61,7 @@
|
|||
"name": "MongoDB – Reads/Writes Waiting in Queue",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(queued_reads) AS queued_reads, max(queued_writes) as queued_writes FROM mongodb",
|
||||
"query": "SELECT max(queued_reads) AS queued_reads, max(queued_writes) as queued_writes FROM \":db:\".\":rp:\".\"mongodb\"",
|
||||
"label": "count",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -77,7 +77,7 @@
|
|||
"name": "MongoDB – Network Bytes/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(net_in_bytes) AS net_in_bytes, mean(net_out_bytes) as net_out_bytes FROM mongodb",
|
||||
"query": "SELECT mean(net_in_bytes) AS net_in_bytes, mean(net_out_bytes) as net_out_bytes FROM \":db:\".\":rp:\".\"mongodb\"",
|
||||
"label": "bytes/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -93,7 +93,7 @@
|
|||
"name": "MongoDB – Page Faults",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(page_faults_per_sec) AS page_faults_per_second FROM mongodb",
|
||||
"query": "SELECT mean(page_faults_per_sec) AS page_faults_per_second FROM \":db:\".\":rp:\".\"mongodb\"",
|
||||
"label": "faults/s",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
@ -109,7 +109,7 @@
|
|||
"name": "MongoDB – Memory Usage (MB)",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(vsize_megabytes) AS virtual_memory_megabytes, mean(resident_megabytes) as resident_memory_megabytes FROM mongodb",
|
||||
"query": "SELECT mean(vsize_megabytes) AS virtual_memory_megabytes, mean(resident_megabytes) as resident_memory_megabytes FROM \":db:\".\":rp:\".\"mongodb\"",
|
||||
"label": "MB",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "MySQL – Reads/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(last(\"commands_select\"), 1s) AS selects_per_second FROM mysql",
|
||||
"query": "SELECT non_negative_derivative(last(\"commands_select\"), 1s) AS selects_per_second FROM \":db:\".\":rp:\".\"mysql\"",
|
||||
"groupbys": [
|
||||
"\"server\""
|
||||
],
|
||||
|
@ -30,7 +30,7 @@
|
|||
"name": "MySQL – Writes/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(last(\"commands_insert\"), 1s) AS inserts_per_second, non_negative_derivative(last(\"commands_update\"), 1s) AS updates_per_second, non_negative_derivative(last(\"commands_delete\"), 1s) AS deletes_per_second FROM mysql",
|
||||
"query": "SELECT non_negative_derivative(last(\"commands_insert\"), 1s) AS inserts_per_second, non_negative_derivative(last(\"commands_update\"), 1s) AS updates_per_second, non_negative_derivative(last(\"commands_delete\"), 1s) AS deletes_per_second FROM \":db:\".\":rp:\".\"mysql\"",
|
||||
"groupbys": [
|
||||
"\"server\""
|
||||
],
|
||||
|
@ -47,7 +47,7 @@
|
|||
"name": "MySQL – Connections/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(last(\"threads_connected\"), 1s) AS cxn_per_second, non_negative_derivative(last(\"threads_running\"), 1s) AS threads_running_per_second FROM mysql",
|
||||
"query": "SELECT non_negative_derivative(last(\"threads_connected\"), 1s) AS cxn_per_second, non_negative_derivative(last(\"threads_running\"), 1s) AS threads_running_per_second FROM \":db:\".\":rp:\".\"mysql\"",
|
||||
"groupbys": [
|
||||
"\"server\""
|
||||
],
|
||||
|
@ -64,7 +64,7 @@
|
|||
"name": "MySQL – Connections Errors/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(last(\"connection_errors_max_connections\"), 1s) AS cxn_errors_per_second, non_negative_derivative(last(\"connection_errors_internal\"), 1s) AS internal_cxn_errors_per_second, non_negative_derivative(last(\"aborted_connects\"), 1s) AS cxn_aborted_per_second FROM mysql",
|
||||
"query": "SELECT non_negative_derivative(last(\"connection_errors_max_connections\"), 1s) AS cxn_errors_per_second, non_negative_derivative(last(\"connection_errors_internal\"), 1s) AS internal_cxn_errors_per_second, non_negative_derivative(last(\"aborted_connects\"), 1s) AS cxn_aborted_per_second FROM \":db:\".\":rp:\".\"mysql\"",
|
||||
"groupbys": [
|
||||
"\"server\""
|
||||
],
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
"name": "System – Network Mb/s",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"bytes_recv\"), 1s) / 125000 as \"rx_megabits_per_second\" FROM \"net\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"bytes_recv\"), 1s) / 125000 as \"rx_megabits_per_second\" FROM \":db:\".\":rp:\".\"net\"",
|
||||
"groupbys": [],
|
||||
"wheres": [],
|
||||
"label": "Mb/s"
|
||||
},
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"bytes_sent\"), 1s) / 125000 as \"tx_megabits_per_second\" FROM \"net\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"bytes_sent\"), 1s) / 125000 as \"tx_megabits_per_second\" FROM \":db:\".\":rp:\".\"net\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -34,12 +34,12 @@
|
|||
"name": "System – Network Error Rate",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"err_in\"), 1s) / 125000 as \"tx_errors_per_second\" FROM \"net\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"err_in\"), 1s) / 125000 as \"tx_errors_per_second\" FROM \":db:\".\":rp:\".\"net\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"err_out\"), 1s) / 125000 as \"rx_errors_per_second\" FROM \"net\"",
|
||||
"query": "SELECT non_negative_derivative(max(\"err_out\"), 1s) / 125000 as \"rx_errors_per_second\" FROM \":db:\".\":rp:\".\"net\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
"name": "System - Open Sockets",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"tcp_established\") AS \"tcp_established\" FROM netstat",
|
||||
"query": "SELECT mean(\"tcp_established\") AS \"tcp_established\" FROM \":db:\".\":rp:\".\"netstat\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT mean(\"udp_socket\") AS \"udp_socket\" FROM netstat",
|
||||
"query": "SELECT mean(\"udp_socket\") AS \"udp_socket\" FROM \":db:\".\":rp:\".\"netstat\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -33,12 +33,12 @@
|
|||
"name": "System - Sockets Created/Second ",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"tcp_established\")) AS \"tcp_established\" FROM netstat",
|
||||
"query": "SELECT non_negative_derivative(max(\"tcp_established\")) AS \"tcp_established\" FROM \":db:\".\":rp:\".\"netstat\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"udp_socket\")) AS \"udp_socket\" FROM netstat",
|
||||
"query": "SELECT non_negative_derivative(max(\"udp_socket\")) AS \"udp_socket\" FROM \":db:\".\":rp:\".\"netstat\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "NGINX – Client Connections",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"accepts\"), 1s) AS \"accepts\", non_negative_derivative(max(\"handled\"), 1s) AS \"handled\", non_negative_derivative(max(\"active\"), 1s) AS \"active\" FROM nginx",
|
||||
"query": "SELECT non_negative_derivative(max(\"accepts\"), 1s) AS \"accepts\", non_negative_derivative(max(\"handled\"), 1s) AS \"handled\", non_negative_derivative(max(\"active\"), 1s) AS \"active\" FROM \":db:\".\":rp:\".\"nginx\"",
|
||||
"groupbys": [
|
||||
"\"server\""
|
||||
],
|
||||
|
@ -30,7 +30,7 @@
|
|||
"name": "NGINX – Client Errors",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"accepts\")) - non_negative_derivative(max(\"handled\")) FROM nginx",
|
||||
"query": "SELECT non_negative_derivative(max(\"accepts\")) - non_negative_derivative(max(\"handled\")) FROM \":db:\".\":rp:\".\"nginx\"",
|
||||
"groupbys": [
|
||||
"\"server\""
|
||||
],
|
||||
|
@ -47,7 +47,7 @@
|
|||
"name": "NGINX – Client Requests",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"requests\"), 1s) AS \"requests\" FROM nginx",
|
||||
"query": "SELECT non_negative_derivative(max(\"requests\"), 1s) AS \"requests\" FROM \":db:\".\":rp:\".\"nginx\"",
|
||||
"groupbys": [
|
||||
"\"server\""
|
||||
],
|
||||
|
@ -64,7 +64,7 @@
|
|||
"name": "NGINX – Active Client State",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"waiting\"), 1s) AS \"waiting\", non_negative_derivative(max(\"reading\"), 1s) AS \"reading\", non_negative_derivative(max(\"writing\"), 1s) AS \"writing\" FROM nginx",
|
||||
"query": "SELECT non_negative_derivative(max(\"waiting\"), 1s) AS \"waiting\", non_negative_derivative(max(\"reading\"), 1s) AS \"reading\", non_negative_derivative(max(\"writing\"), 1s) AS \"writing\" FROM \":db:\".\":rp:\".\"nginx\"",
|
||||
"groupbys": [
|
||||
"\"server\""
|
||||
],
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "NSQ - Channel Client Count",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"client_count\") AS \"client_count\" FROM nsq_channel",
|
||||
"query": "SELECT mean(\"client_count\") AS \"client_count\" FROM \":db:\".\":rp:\".\"nsq_channel\"",
|
||||
"groupbys": [
|
||||
"\"topic\"",
|
||||
"\"channel\""
|
||||
|
@ -31,7 +31,7 @@
|
|||
"name": "NSQ - Channel Messages Count",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"message_count\") AS \"message_count\" FROM nsq_channel",
|
||||
"query": "SELECT mean(\"message_count\") AS \"message_count\" FROM \":db:\".\":rp:\".\"nsq_channel\"",
|
||||
"groupbys": [
|
||||
"\"topic\"",
|
||||
"\"channel\""
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "NSQ - Topic Count",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"topic_count\") AS \"topic_count\" FROM nsq_server",
|
||||
"query": "SELECT mean(\"topic_count\") AS \"topic_count\" FROM \":db:\".\":rp:\".\"nsq_server\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
|||
"name": "NSQ - Server Count",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"server_count\") AS \"server_count\" FROM nsq_server",
|
||||
"query": "SELECT mean(\"server_count\") AS \"server_count\" FROM \":db:\".\":rp:\".\"nsq_server\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "NSQ - Topic Messages",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"depth\") AS \"depth\" FROM nsq_topic",
|
||||
"query": "SELECT mean(\"depth\") AS \"depth\" FROM \":db:\".\":rp:\".\"nsq_topic\"",
|
||||
"groupbys": [
|
||||
"\"topic\""
|
||||
],
|
||||
|
@ -30,7 +30,7 @@
|
|||
"name": "NSQ - Topic Messages on Disk",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"backend_depth\") AS \"backend_depth\" FROM nsq_topic",
|
||||
"query": "SELECT mean(\"backend_depth\") AS \"backend_depth\" FROM \":db:\".\":rp:\".\"nsq_topic\"",
|
||||
"groupbys": [
|
||||
"\"topic\""
|
||||
],
|
||||
|
@ -47,7 +47,7 @@
|
|||
"name": "NSQ - Topic Ingress",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"message_count\")) AS \"messages_per_second\" FROM nsq_topic",
|
||||
"query": "SELECT non_negative_derivative(max(\"message_count\")) AS \"messages_per_second\" FROM \":db:\".\":rp:\".\"nsq_topic\"",
|
||||
"groupbys": [
|
||||
"\"topic\"",
|
||||
"\"host\""
|
||||
|
@ -65,7 +65,7 @@
|
|||
"name": "NSQ topic egress",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"message_count\")) - non_negative_derivative(max(\"depth\")) AS \"messages_per_second\" FROM nsq_topic",
|
||||
"query": "SELECT non_negative_derivative(max(\"message_count\")) - non_negative_derivative(max(\"depth\")) AS \"messages_per_second\" FROM \":db:\".\":rp:\".\"nsq_topic\"",
|
||||
"groupbys": [
|
||||
"\"topic\"",
|
||||
"\"host\""
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "phpfpm – Accepted Connections",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(mean(\"accepted_conn\"),1s) FROM \"phpfpm\"",
|
||||
"query": "SELECT non_negative_derivative(mean(\"accepted_conn\"),1s) FROM \":db:\".\":rp:\".\"phpfpm\"",
|
||||
"label": "count",
|
||||
"groupbys": [
|
||||
"\"pool\""
|
||||
|
@ -30,7 +30,7 @@
|
|||
"name": "phpfpm – Processes",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"active_processes\") as \"active\",mean(\"idle_processes\") as \"idle\" FROM \"phpfpm\"",
|
||||
"query": "SELECT mean(\"active_processes\") as \"active\",mean(\"idle_processes\") as \"idle\" FROM \":db:\".\":rp:\".\"phpfpm\"",
|
||||
"label": "count",
|
||||
"groupbys": [
|
||||
"\"pool\""
|
||||
|
@ -47,7 +47,7 @@
|
|||
"name": "phpfpm – Slow Requests",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(mean(\"slow_requests\"),1s) FROM \"phpfpm\"",
|
||||
"query": "SELECT non_negative_derivative(mean(\"slow_requests\"),1s) FROM \":db:\".\":rp:\".\"phpfpm\"",
|
||||
"label": "count",
|
||||
"groupbys": [
|
||||
"\"pool\""
|
||||
|
@ -64,7 +64,7 @@
|
|||
"name": "phpfpm – Max Children Reached",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"max_children_reached\") FROM \"phpfpm\"",
|
||||
"query": "SELECT mean(\"max_children_reached\") FROM \":db:\".\":rp:\".\"phpfpm\"",
|
||||
"label": "count",
|
||||
"groupbys": [
|
||||
"\"pool\""
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "PostgreSQL - Rows",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(mean(\"tup_fetched\")) AS \"fetched\", non_negative_derivative(mean(\"tup_returned\")) AS \"returned\", non_negative_derivative(mean(\"tup_inserted\")) AS \"inserted\", non_negative_derivative(mean(\"tup_updated\")) AS \"updated\" FROM postgresql",
|
||||
"query": "SELECT non_negative_derivative(mean(\"tup_fetched\")) AS \"fetched\", non_negative_derivative(mean(\"tup_returned\")) AS \"returned\", non_negative_derivative(mean(\"tup_inserted\")) AS \"inserted\", non_negative_derivative(mean(\"tup_updated\")) AS \"updated\" FROM \":db:\".\":rp:\".\"postgresql\"",
|
||||
"groupbys": [
|
||||
"db"
|
||||
],
|
||||
|
@ -30,7 +30,7 @@
|
|||
"name": "PostgreSQL - QPS",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(mean(\"xact_commit\")) AS \"xact_commit\" FROM postgresql",
|
||||
"query": "SELECT non_negative_derivative(mean(\"xact_commit\")) AS \"xact_commit\" FROM \":db:\".\":rp:\".\"postgresql\"",
|
||||
"groupbys": [
|
||||
"db"
|
||||
],
|
||||
|
@ -47,7 +47,7 @@
|
|||
"name": "PostgreSQL - Buffers",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"buffers_alloc\") AS \"buffers_allocated\", mean(\"buffers_backend\") AS \"buffers_backend\", mean(\"buffers_backend_fsync\") AS \"buffers_backend_fsync\", mean(\"buffers_checkpoint\") AS \"buffers_checkpoint\", mean(\"buffers_clean\") AS \"buffers_clean\" FROM postgresql",
|
||||
"query": "SELECT mean(\"buffers_alloc\") AS \"buffers_allocated\", mean(\"buffers_backend\") AS \"buffers_backend\", mean(\"buffers_backend_fsync\") AS \"buffers_backend_fsync\", mean(\"buffers_checkpoint\") AS \"buffers_checkpoint\", mean(\"buffers_clean\") AS \"buffers_clean\" FROM \":db:\".\":rp:\".\"postgresql\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -62,7 +62,7 @@
|
|||
"name": "PostgreSQL - Conflicts/Deadlocks",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"conflicts\") AS \"conflicts\", mean(\"deadlocks\") AS \"deadlocks\" FROM postgresql",
|
||||
"query": "SELECT mean(\"conflicts\") AS \"conflicts\", mean(\"deadlocks\") AS \"deadlocks\" FROM \":db:\".\":rp:\".\"postgresql\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "System - Total Processes",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"total\") AS \"total\" FROM processes",
|
||||
"query": "SELECT mean(\"total\") AS \"total\" FROM \":db:\".\":rp:\".\"processes\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Processes – Resident Memory (MB)",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"memory_rss\") / 1000000 AS \"max_mb_memory_rss\" FROM \"procstat\"",
|
||||
"query": "SELECT max(\"memory_rss\") / 1000000 AS \"max_mb_memory_rss\" FROM \":db:\".\":rp:\".\"procstat\"",
|
||||
"groupbys": ["\"exe\""],
|
||||
"wheres": [],
|
||||
"label": "MB"
|
||||
|
@ -29,7 +29,7 @@
|
|||
"name": "Processes – CPU Usage %",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"cpu_usage\") AS \"cpu_usage\" FROM \"procstat\"",
|
||||
"query": "SELECT max(\"cpu_usage\") AS \"cpu_usage\" FROM \":db:\".\":rp:\".\"procstat\"",
|
||||
"groupbys": ["\"exe\""],
|
||||
"wheres": [],
|
||||
"label": "%"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Redis - Connected Clients",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"clients\") AS \"clients\" FROM redis",
|
||||
"query": "SELECT mean(\"clients\") AS \"clients\" FROM \":db:\".\":rp:\".\"redis\"",
|
||||
"groupbys": []
|
||||
}
|
||||
]
|
||||
|
@ -27,7 +27,7 @@
|
|||
"name": "Redis - Blocked Clients",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"blocked_clients\") AS \"blocked_clients\" FROM redis",
|
||||
"query": "SELECT mean(\"blocked_clients\") AS \"blocked_clients\" FROM \":db:\".\":rp:\".\"redis\"",
|
||||
"groupbys": []
|
||||
}
|
||||
]
|
||||
|
@ -41,7 +41,7 @@
|
|||
"name": "Redis - CPU",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"used_cpu_user\")) AS \"used_cpu_per_second\" FROM redis",
|
||||
"query": "SELECT non_negative_derivative(max(\"used_cpu_user\")) AS \"used_cpu_per_second\" FROM \":db:\".\":rp:\".\"redis\"",
|
||||
"groupbys": []
|
||||
}
|
||||
]
|
||||
|
@ -55,7 +55,7 @@
|
|||
"name": "Redis - Memory",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT non_negative_derivative(max(\"used_memory\")) AS \"used_memory_per_second\" FROM redis",
|
||||
"query": "SELECT non_negative_derivative(max(\"used_memory\")) AS \"used_memory_per_second\" FROM \":db:\".\":rp:\".\"redis\"",
|
||||
"groupbys": []
|
||||
}
|
||||
]
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "Riak – Total Memory Bytes",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"memory_total\") as memory_total_bytes FROM riak",
|
||||
"query": "SELECT max(\"memory_total\") as memory_total_bytes FROM \":db:\".\":rp:\".\"riak\"",
|
||||
"groupbys": [
|
||||
"\"nodename\""
|
||||
],
|
||||
|
@ -30,7 +30,7 @@
|
|||
"name": "Riak – Object Byte Size",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"node_get_fsm_objsize_median\") AS \"median\", max(\"node_get_fsm_objsize_100\") AS \"100th-percentile\", max(\"node_get_fsm_objsize_99\") AS \"99th-percentile\", max(\"node_get_fsm_objsize_mean\") AS \"mean\", max(\"node_get_fsm_objsize_95\") AS \"95th-percentile\" FROM riak",
|
||||
"query": "SELECT max(\"node_get_fsm_objsize_median\") AS \"median\", max(\"node_get_fsm_objsize_100\") AS \"100th-percentile\", max(\"node_get_fsm_objsize_99\") AS \"99th-percentile\", max(\"node_get_fsm_objsize_mean\") AS \"mean\", max(\"node_get_fsm_objsize_95\") AS \"95th-percentile\" FROM \":db:\".\":rp:\".\"riak\"",
|
||||
"groupbys": [
|
||||
"\"nodename\""
|
||||
],
|
||||
|
@ -47,7 +47,7 @@
|
|||
"name": "Riak – Number of Siblings/Minute",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"node_get_fsm_siblings_median\") AS \"median\", max(\"node_get_fsm_siblings_mean\") AS \"mean\", max(\"node_get_fsm_siblings_99\") AS \"99th-percentile\", max(\"node_get_fsm_siblings_95\") AS \"95h-percentile\", max(\"node_get_fsm_siblings_100\") AS \"100th-percentile\" FROM riak",
|
||||
"query": "SELECT max(\"node_get_fsm_siblings_median\") AS \"median\", max(\"node_get_fsm_siblings_mean\") AS \"mean\", max(\"node_get_fsm_siblings_99\") AS \"99th-percentile\", max(\"node_get_fsm_siblings_95\") AS \"95h-percentile\", max(\"node_get_fsm_siblings_100\") AS \"100th-percentile\" FROM \":db:\".\":rp:\".\"riak\"",
|
||||
"groupbys": [
|
||||
"\"nodename\""
|
||||
],
|
||||
|
@ -64,7 +64,7 @@
|
|||
"name": "Riak – Latency (ms)",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"node_put_fsm_time_median\") / 1000 AS \"median_put_milliseconds\", max(\"node_get_fsm_time_median\") / 1000 AS \"median_get_milliseconds\" FROM riak",
|
||||
"query": "SELECT max(\"node_put_fsm_time_median\") / 1000 AS \"median_put_milliseconds\", max(\"node_get_fsm_time_median\") / 1000 AS \"median_get_milliseconds\" FROM \":db:\".\":rp:\".\"riak\"",
|
||||
"groupbys": [
|
||||
"\"nodename\""
|
||||
],
|
||||
|
@ -81,7 +81,7 @@
|
|||
"name": "Riak – Reads and Writes/Minute",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"node_puts\") AS \"puts_per_minute\", max(\"node_gets\") AS \"gets_per_minute\" FROM riak",
|
||||
"query": "SELECT max(\"node_puts\") AS \"puts_per_minute\", max(\"node_gets\") AS \"gets_per_minute\" FROM \":db:\".\":rp:\".\"riak\"",
|
||||
"groupbys": [
|
||||
"\"nodename\""
|
||||
],
|
||||
|
@ -98,7 +98,7 @@
|
|||
"name": "Riak – Active Connections",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"pbc_active\") AS \"active_protobuf_connections\" FROM riak",
|
||||
"query": "SELECT max(\"pbc_active\") AS \"active_protobuf_connections\" FROM \":db:\".\":rp:\".\"riak\"",
|
||||
"groupbys": [
|
||||
"\"nodename\""
|
||||
],
|
||||
|
@ -115,7 +115,7 @@
|
|||
"name": "Riak – Read Repairs/Minute",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT max(\"read_repairs\") AS \"read_repairs_per_minute\" FROM riak",
|
||||
"query": "SELECT max(\"read_repairs\") AS \"read_repairs_per_minute\" FROM \":db:\".\":rp:\".\"riak\"",
|
||||
"groupbys": [
|
||||
"\"nodename\""
|
||||
],
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "System - CPU Usage",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"Percent_Processor_Time\") AS \"percent_processor_time\" FROM win_cpu",
|
||||
"query": "SELECT mean(\"Percent_Processor_Time\") AS \"percent_processor_time\" FROM \":db:\".\":rp:\".\"win_cpu\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "System - Available Bytes",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"Available_Bytes\") AS \"available_bytes\" FROM win_mem",
|
||||
"query": "SELECT mean(\"Available_Bytes\") AS \"available_bytes\" FROM \":db:\".\":rp:\".\"win_mem\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "System - TX Bytes/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"Bytes_Sent_persec\") AS \"bytes_sent\" FROM win_net",
|
||||
"query": "SELECT mean(\"Bytes_Sent_persec\") AS \"bytes_sent\" FROM \":db:\".\":rp:\".\"win_net\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
|||
"name": "RX Bytes/Second",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"Bytes_Received_persec\") AS \"bytes_received\" FROM win_net",
|
||||
"query": "SELECT mean(\"Bytes_Received_persec\") AS \"bytes_received\" FROM \":db:\".\":rp:\".\"win_net\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"name": "System - Load",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"Processor_Queue_Length\") AS \"load\" FROM win_system",
|
||||
"query": "SELECT mean(\"Processor_Queue_Length\") AS \"load\" FROM \":db:\".\":rp:\".\"win_system\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -13,17 +13,17 @@
|
|||
"name": "IIS - Service",
|
||||
"queries": [
|
||||
{
|
||||
"query": "SELECT mean(\"Get_Requests_persec\") AS \"gets\" FROM win_websvc",
|
||||
"query": "SELECT mean(\"Get_Requests_persec\") AS \"gets\" FROM \":db:\".\":rp:\".\"win_websvc\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT mean(\"Post_Requests_persec\") AS \"posts\" FROM win_websvc",
|
||||
"query": "SELECT mean(\"Post_Requests_persec\") AS \"posts\" FROM \":db:\".\":rp:\".\"win_websvc\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
},
|
||||
{
|
||||
"query": "SELECT mean(\"Current_Connections\") AS \"connections\" FROM win_websvc",
|
||||
"query": "SELECT mean(\"Current_Connections\") AS \"connections\" FROM \":db:\".\":rp:\".\"win_websvc\"",
|
||||
"groupbys": [],
|
||||
"wheres": []
|
||||
}
|
||||
|
|
|
@ -236,6 +236,7 @@ type Source struct {
|
|||
Telegraf string `json:"telegraf"` // Telegraf is the db telegraf is written to. By default it is "telegraf"
|
||||
Organization string `json:"organization"` // Organization is the organization ID that resource belongs to
|
||||
Role string `json:"role,omitempty"` // Not Currently Used. Role is the name of the minimum role that a user must possess to access the resource.
|
||||
DefaultRP string `json:"defaultRP"` // DefaultRP is the default retention policy used in database queries to this source
|
||||
}
|
||||
|
||||
// SourcesStore stores connection information for a `TimeSeries`
|
||||
|
|
|
@ -104,6 +104,7 @@ func TestServer(t *testing.T) {
|
|||
"default": true,
|
||||
"telegraf": "telegraf",
|
||||
"organization": "howdy",
|
||||
"defaultRP": "",
|
||||
"links": {
|
||||
"self": "/chronograf/v1/sources/5000",
|
||||
"kapacitors": "/chronograf/v1/sources/5000/kapacitors",
|
||||
|
@ -291,6 +292,7 @@ func TestServer(t *testing.T) {
|
|||
"default": true,
|
||||
"telegraf": "telegraf",
|
||||
"organization": "howdy",
|
||||
"defaultRP": "",
|
||||
"links": {
|
||||
"self": "/chronograf/v1/sources/5000",
|
||||
"kapacitors": "/chronograf/v1/sources/5000/kapacitors",
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/bouk/httprouter"
|
||||
|
||||
"github.com/influxdata/chronograf/mocks"
|
||||
|
||||
"github.com/influxdata/chronograf"
|
||||
)
|
||||
|
||||
func TestService_Influx(t *testing.T) {
|
||||
type fields struct {
|
||||
SourcesStore chronograf.SourcesStore
|
||||
TimeSeries TimeSeriesClient
|
||||
}
|
||||
type args struct {
|
||||
w *httptest.ResponseRecorder
|
||||
r *http.Request
|
||||
}
|
||||
type want struct {
|
||||
StatusCode int
|
||||
ContentType string
|
||||
Body string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
fields fields
|
||||
args args
|
||||
ID string
|
||||
want want
|
||||
}{
|
||||
{
|
||||
name: "Proxies request to Influxdb",
|
||||
fields: fields{
|
||||
SourcesStore: &mocks.SourcesStore{
|
||||
GetF: func(ctx context.Context, ID int) (chronograf.Source, error) {
|
||||
return chronograf.Source{
|
||||
ID: 1337,
|
||||
URL: "http://any.url",
|
||||
}, nil
|
||||
},
|
||||
},
|
||||
TimeSeries: &mocks.TimeSeries{
|
||||
ConnectF: func(ctx context.Context, src *chronograf.Source) error {
|
||||
return nil
|
||||
},
|
||||
QueryF: func(ctx context.Context, query chronograf.Query) (chronograf.Response, error) {
|
||||
return mocks.NewResponse(
|
||||
`{"results":[{"statement_id":0,"series":[{"name":"cpu","columns":["key","value"],"values":[["cpu","cpu-total"],["cpu","cpu0"],["cpu","cpu1"],["cpu","cpu2"],["cpu","cpu3"],["host","pineapples-MBP"],["host","pineapples-MacBook-Pro.local"]]}]}]}`,
|
||||
nil,
|
||||
),
|
||||
nil
|
||||
},
|
||||
},
|
||||
},
|
||||
args: args{
|
||||
w: httptest.NewRecorder(),
|
||||
r: httptest.NewRequest(
|
||||
"POST",
|
||||
"http://any.url",
|
||||
ioutil.NopCloser(
|
||||
bytes.NewReader([]byte(
|
||||
`{"db":"bob", "rp":"joe", "query":"SELECT mean(\"usage_user\") FROM cpu WHERE \"cpu\" = 'cpu-total' AND time > now() - 10m GROUP BY host;"}`,
|
||||
)),
|
||||
),
|
||||
),
|
||||
},
|
||||
ID: "1",
|
||||
want: want{
|
||||
StatusCode: http.StatusOK,
|
||||
ContentType: "application/json",
|
||||
Body: `{"results":{"results":[{"statement_id":0,"series":[{"name":"cpu","columns":["key","value"],"values":[["cpu","cpu-total"],["cpu","cpu0"],["cpu","cpu1"],["cpu","cpu2"],["cpu","cpu3"],["host","pineapples-MBP"],["host","pineapples-MacBook-Pro.local"]]}]}]}}
|
||||
`,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
tt.args.r = tt.args.r.WithContext(httprouter.WithParams(
|
||||
context.Background(),
|
||||
httprouter.Params{
|
||||
{
|
||||
Key: "id",
|
||||
Value: tt.ID,
|
||||
},
|
||||
},
|
||||
))
|
||||
h := &Service{
|
||||
Store: &mocks.Store{
|
||||
SourcesStore: tt.fields.SourcesStore,
|
||||
},
|
||||
TimeSeriesClient: tt.fields.TimeSeries,
|
||||
}
|
||||
h.Influx(tt.args.w, tt.args.r)
|
||||
|
||||
resp := tt.args.w.Result()
|
||||
contentType := resp.Header.Get("Content-Type")
|
||||
body, _ := ioutil.ReadAll(resp.Body)
|
||||
|
||||
if resp.StatusCode != tt.want.StatusCode {
|
||||
t.Errorf("%q. Influx() = got %v, want %v", tt.name, resp.StatusCode, tt.want.StatusCode)
|
||||
}
|
||||
if contentType != tt.want.ContentType {
|
||||
t.Errorf("%q. Influx() = got %v, want %v", tt.name, contentType, tt.want.ContentType)
|
||||
}
|
||||
if string(body) != tt.want.Body {
|
||||
t.Errorf("%q. Influx() =\ngot ***%v***\nwant ***%v***\n", tt.name, string(body), tt.want.Body)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -302,6 +302,7 @@ func (s *Service) UpdateSource(w http.ResponseWriter, r *http.Request) {
|
|||
if req.Telegraf != "" {
|
||||
src.Telegraf = req.Telegraf
|
||||
}
|
||||
src.DefaultRP = req.DefaultRP
|
||||
|
||||
defaultOrg, err := s.Store.Organizations(ctx).DefaultOrganization(ctx)
|
||||
if err != nil {
|
||||
|
|
|
@ -399,6 +399,188 @@ func TestService_newSourceKapacitor(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestService_SourcesID(t *testing.T) {
|
||||
type fields struct {
|
||||
SourcesStore chronograf.SourcesStore
|
||||
Logger chronograf.Logger
|
||||
}
|
||||
type args struct {
|
||||
w *httptest.ResponseRecorder
|
||||
r *http.Request
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
fields fields
|
||||
ID string
|
||||
wantStatusCode int
|
||||
wantContentType string
|
||||
wantBody string
|
||||
}{
|
||||
{
|
||||
name: "Get source without defaultRP includes empty defaultRP in response",
|
||||
args: args{
|
||||
w: httptest.NewRecorder(),
|
||||
r: httptest.NewRequest(
|
||||
"GET",
|
||||
"http://any.url",
|
||||
nil,
|
||||
),
|
||||
},
|
||||
fields: fields{
|
||||
SourcesStore: &mocks.SourcesStore{
|
||||
GetF: func(ctx context.Context, ID int) (chronograf.Source, error) {
|
||||
return chronograf.Source{
|
||||
ID: 1,
|
||||
}, nil
|
||||
},
|
||||
},
|
||||
Logger: log.New(log.DebugLevel),
|
||||
},
|
||||
ID: "1",
|
||||
wantStatusCode: 200,
|
||||
wantContentType: "application/json",
|
||||
wantBody: `{"id":"1","name":"","url":"","default":false,"telegraf":"telegraf","organization":"","defaultRP":"","links":{"self":"/chronograf/v1/sources/1","kapacitors":"/chronograf/v1/sources/1/kapacitors","proxy":"/chronograf/v1/sources/1/proxy","queries":"/chronograf/v1/sources/1/queries","write":"/chronograf/v1/sources/1/write","permissions":"/chronograf/v1/sources/1/permissions","users":"/chronograf/v1/sources/1/users","databases":"/chronograf/v1/sources/1/dbs","annotations":"/chronograf/v1/sources/1/annotations","health":"/chronograf/v1/sources/1/health"}}
|
||||
`,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
tt.args.r = tt.args.r.WithContext(httprouter.WithParams(
|
||||
context.Background(),
|
||||
httprouter.Params{
|
||||
{
|
||||
Key: "id",
|
||||
Value: tt.ID,
|
||||
},
|
||||
}))
|
||||
h := &Service{
|
||||
Store: &mocks.Store{
|
||||
SourcesStore: tt.fields.SourcesStore,
|
||||
},
|
||||
Logger: tt.fields.Logger,
|
||||
}
|
||||
h.SourcesID(tt.args.w, tt.args.r)
|
||||
|
||||
resp := tt.args.w.Result()
|
||||
contentType := resp.Header.Get("Content-Type")
|
||||
body, _ := ioutil.ReadAll(resp.Body)
|
||||
|
||||
if resp.StatusCode != tt.wantStatusCode {
|
||||
t.Errorf("%q. SourcesID() = got %v, want %v", tt.name, resp.StatusCode, tt.wantStatusCode)
|
||||
}
|
||||
if tt.wantContentType != "" && contentType != tt.wantContentType {
|
||||
t.Errorf("%q. SourcesID() = got %v, want %v", tt.name, contentType, tt.wantContentType)
|
||||
}
|
||||
if tt.wantBody != "" && string(body) != tt.wantBody {
|
||||
t.Errorf("%q. SourcesID() =\ngot ***%v***\nwant ***%v***\n", tt.name, string(body), tt.wantBody)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
func TestService_UpdateSource(t *testing.T) {
|
||||
type fields struct {
|
||||
SourcesStore chronograf.SourcesStore
|
||||
OrganizationsStore chronograf.OrganizationsStore
|
||||
Logger chronograf.Logger
|
||||
}
|
||||
type args struct {
|
||||
w *httptest.ResponseRecorder
|
||||
r *http.Request
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
fields fields
|
||||
ID string
|
||||
wantStatusCode int
|
||||
wantContentType string
|
||||
wantBody func(string) string
|
||||
}{
|
||||
{
|
||||
name: "Update source updates fields",
|
||||
args: args{
|
||||
w: httptest.NewRecorder(),
|
||||
r: httptest.NewRequest(
|
||||
"PATCH",
|
||||
"http://any.url",
|
||||
nil),
|
||||
},
|
||||
fields: fields{
|
||||
SourcesStore: &mocks.SourcesStore{
|
||||
GetF: func(ctx context.Context, ID int) (chronograf.Source, error) {
|
||||
return chronograf.Source{
|
||||
ID: 1,
|
||||
}, nil
|
||||
},
|
||||
UpdateF: func(ctx context.Context, upd chronograf.Source) error {
|
||||
return nil
|
||||
},
|
||||
},
|
||||
OrganizationsStore: &mocks.OrganizationsStore{
|
||||
DefaultOrganizationF: func(context.Context) (*chronograf.Organization, error) {
|
||||
return &chronograf.Organization{
|
||||
ID: "1337",
|
||||
Name: "pineapple_kingdom",
|
||||
}, nil
|
||||
},
|
||||
},
|
||||
Logger: log.New(log.DebugLevel),
|
||||
},
|
||||
ID: "1",
|
||||
wantStatusCode: 200,
|
||||
wantContentType: "application/json",
|
||||
wantBody: func(url string) string {
|
||||
return fmt.Sprintf(`{"id":"1","name":"marty","type":"influx","username":"bob","url":"%s","metaUrl":"http://murl","default":false,"telegraf":"murlin","organization":"1337","defaultRP":"pineapple","links":{"self":"/chronograf/v1/sources/1","kapacitors":"/chronograf/v1/sources/1/kapacitors","proxy":"/chronograf/v1/sources/1/proxy","queries":"/chronograf/v1/sources/1/queries","write":"/chronograf/v1/sources/1/write","permissions":"/chronograf/v1/sources/1/permissions","users":"/chronograf/v1/sources/1/users","databases":"/chronograf/v1/sources/1/dbs","annotations":"/chronograf/v1/sources/1/annotations","health":"/chronograf/v1/sources/1/health"}}
|
||||
`, url)
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
h := &Service{
|
||||
Store: &mocks.Store{
|
||||
SourcesStore: tt.fields.SourcesStore,
|
||||
OrganizationsStore: tt.fields.OrganizationsStore,
|
||||
},
|
||||
Logger: tt.fields.Logger,
|
||||
}
|
||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
w.Header().Set("X-Influxdb-Build", "ENT")
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
tt.args.r = tt.args.r.WithContext(httprouter.WithParams(
|
||||
context.Background(),
|
||||
httprouter.Params{
|
||||
{
|
||||
Key: "id",
|
||||
Value: tt.ID,
|
||||
},
|
||||
}))
|
||||
tt.args.r.Body = ioutil.NopCloser(
|
||||
bytes.NewReader([]byte(
|
||||
fmt.Sprintf(`{"name":"marty","password":"the_lake","username":"bob","type":"influx","telegraf":"murlin","defaultRP":"pineapple","url":"%s","metaUrl":"http://murl"}`, ts.URL)),
|
||||
),
|
||||
)
|
||||
h.UpdateSource(tt.args.w, tt.args.r)
|
||||
|
||||
resp := tt.args.w.Result()
|
||||
contentType := resp.Header.Get("Content-Type")
|
||||
body, _ := ioutil.ReadAll(resp.Body)
|
||||
|
||||
if resp.StatusCode != tt.wantStatusCode {
|
||||
t.Errorf("%q. UpdateSource() = got %v, want %v", tt.name, resp.StatusCode, tt.wantStatusCode)
|
||||
}
|
||||
if contentType != tt.wantContentType {
|
||||
t.Errorf("%q. UpdateSource() = got %v, want %v", tt.name, contentType, tt.wantContentType)
|
||||
}
|
||||
wantBody := tt.wantBody(ts.URL)
|
||||
if string(body) != wantBody {
|
||||
t.Errorf("%q. UpdateSource() =\ngot ***%v***\nwant ***%v***\n", tt.name, string(body), wantBody)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestService_NewSourceUser(t *testing.T) {
|
||||
type fields struct {
|
||||
SourcesStore chronograf.SourcesStore
|
||||
|
|
|
@ -3860,9 +3860,13 @@
|
|||
"example": {
|
||||
"id": "4",
|
||||
"name": "Influx 1",
|
||||
"type": "influx",
|
||||
"url": "http://localhost:8086",
|
||||
"default": false,
|
||||
"telegraf": "telegraf",
|
||||
"defaultRP": "customRP",
|
||||
"organization": "default",
|
||||
"role": "viewer",
|
||||
"links": {
|
||||
"self": "/chronograf/v1/sources/4",
|
||||
"kapacitors": "/chronograf/v1/sources/4/kapacitors",
|
||||
|
@ -3932,6 +3936,24 @@
|
|||
"Database where telegraf information is stored for this source",
|
||||
"default": "telegraf"
|
||||
},
|
||||
"defaultRP": {
|
||||
"type": "string",
|
||||
"description":
|
||||
"Default retention policy used in Host-related queries proxied to InfluxDB from the Host List and Host pages.",
|
||||
"default": ""
|
||||
},
|
||||
"organization": {
|
||||
"type": "string",
|
||||
"description":
|
||||
"Organization that this source belongs to, when Chronograf auth is in use",
|
||||
"default": "default"
|
||||
},
|
||||
"role": {
|
||||
"type": "string",
|
||||
"description":
|
||||
"Not used currently. Can be used to designate a minimum role required to access this source.",
|
||||
"default": "viewer"
|
||||
},
|
||||
"links": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
import {layout, hosts} from 'test/resources'
|
||||
|
||||
export let getCpuAndLoadForHosts = jest.fn().mockResolvedValue(hosts)
|
||||
export const getAllHosts = () => Promise.resolve()
|
||||
export const getLayouts = () => Promise.resolve({data: {layouts: [layout]}})
|
||||
export const getAppsForHosts = () => Promise.resolve(hosts)
|
||||
export const getMeasurementsForHost = () => Promise.resolve()
|
|
@ -0,0 +1 @@
|
|||
export const getEnv = () => Promise.resolve({telegrafSystemInterval: '1m0s'})
|
|
@ -5,18 +5,20 @@ import _ from 'lodash'
|
|||
export const getCpuAndLoadForHosts = (
|
||||
proxyLink,
|
||||
telegrafDB,
|
||||
telegrafSystemInterval
|
||||
telegrafSystemInterval,
|
||||
tempVars
|
||||
) => {
|
||||
return proxy({
|
||||
source: proxyLink,
|
||||
query: `SELECT mean("usage_user") FROM cpu WHERE "cpu" = 'cpu-total' AND time > now() - 10m GROUP BY host;
|
||||
SELECT mean("load1") FROM "system" WHERE time > now() - 10m GROUP BY host;
|
||||
SELECT non_negative_derivative(mean(uptime)) AS deltaUptime FROM "system" WHERE time > now() - ${telegrafSystemInterval} * 10 GROUP BY host, time(${telegrafSystemInterval}) fill(0);
|
||||
SELECT mean("Percent_Processor_Time") FROM win_cpu WHERE time > now() - 10m GROUP BY host;
|
||||
SELECT mean("Processor_Queue_Length") FROM win_system WHERE time > now() - 10s GROUP BY host;
|
||||
SELECT non_negative_derivative(mean("System_Up_Time")) AS winDeltaUptime FROM win_system WHERE time > now() - ${telegrafSystemInterval} * 10 GROUP BY host, time(${telegrafSystemInterval}) fill(0);
|
||||
query: `SELECT mean("usage_user") FROM \":db:\".\":rp:\".\"cpu\" WHERE "cpu" = 'cpu-total' AND time > now() - 10m GROUP BY host;
|
||||
SELECT mean("load1") FROM \":db:\".\":rp:\".\"system\" WHERE time > now() - 10m GROUP BY host;
|
||||
SELECT non_negative_derivative(mean(uptime)) AS deltaUptime FROM \":db:\".\":rp:\".\"system\" WHERE time > now() - ${telegrafSystemInterval} * 10 GROUP BY host, time(${telegrafSystemInterval}) fill(0);
|
||||
SELECT mean("Percent_Processor_Time") FROM \":db:\".\":rp:\".\"win_cpu\" WHERE time > now() - 10m GROUP BY host;
|
||||
SELECT mean("Processor_Queue_Length") FROM \":db:\".\":rp:\".\"win_system\" WHERE time > now() - 10s GROUP BY host;
|
||||
SELECT non_negative_derivative(mean("System_Up_Time")) AS winDeltaUptime FROM \":db:\".\":rp:\".\"win_system\" WHERE time > now() - ${telegrafSystemInterval} * 10 GROUP BY host, time(${telegrafSystemInterval}) fill(0);
|
||||
SHOW TAG VALUES WITH KEY = "host";`,
|
||||
db: telegrafDB,
|
||||
tempVars,
|
||||
}).then(resp => {
|
||||
const hosts = {}
|
||||
const precision = 100
|
||||
|
@ -176,7 +178,7 @@ export function getMeasurementsForHost(source, host) {
|
|||
return []
|
||||
}
|
||||
|
||||
const series = data.results[0].series[0]
|
||||
const series = _.get(data, ['results', '0', 'series', '0'])
|
||||
return series.values.map(measurement => {
|
||||
return measurement[0]
|
||||
})
|
||||
|
|
|
@ -9,6 +9,7 @@ import LayoutRenderer from 'shared/components/LayoutRenderer'
|
|||
import DashboardHeader from 'src/dashboards/components/DashboardHeader'
|
||||
import FancyScrollbar from 'shared/components/FancyScrollbar'
|
||||
import ManualRefresh from 'src/shared/components/ManualRefresh'
|
||||
import {generateForHosts} from 'src/utils/tempVars'
|
||||
|
||||
import {timeRanges} from 'shared/data/timeRanges'
|
||||
import {
|
||||
|
@ -124,7 +125,8 @@ class HostPage extends Component {
|
|||
}
|
||||
cell.queries.forEach(q => {
|
||||
q.text = q.query
|
||||
q.database = source.telegraf
|
||||
q.db = source.telegraf
|
||||
q.rp = source.defaultRP
|
||||
})
|
||||
})
|
||||
translateY = maxY
|
||||
|
@ -132,11 +134,14 @@ class HostPage extends Component {
|
|||
return allCells.concat(layout.cells)
|
||||
}, [])
|
||||
|
||||
const tempVars = generateForHosts(source)
|
||||
|
||||
return (
|
||||
<LayoutRenderer
|
||||
source={source}
|
||||
isEditable={false}
|
||||
cells={layoutCells}
|
||||
templates={tempVars}
|
||||
timeRange={timeRange}
|
||||
autoRefresh={autoRefresh}
|
||||
manualRefresh={manualRefresh}
|
||||
|
|
|
@ -13,6 +13,7 @@ import {getCpuAndLoadForHosts, getLayouts, getAppsForHosts} from '../apis'
|
|||
import {getEnv} from 'src/shared/apis/env'
|
||||
import {setAutoRefresh} from 'shared/actions/app'
|
||||
import {notify as notifyAction} from 'shared/actions/notifications'
|
||||
import {generateForHosts} from 'src/utils/tempVars'
|
||||
|
||||
import {
|
||||
notifyUnableToGetHosts,
|
||||
|
@ -21,7 +22,7 @@ import {
|
|||
import {ErrorHandling} from 'src/shared/decorators/errors'
|
||||
|
||||
@ErrorHandling
|
||||
class HostsPage extends Component {
|
||||
export class HostsPage extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
|
@ -36,11 +37,14 @@ class HostsPage extends Component {
|
|||
const {source, links, notify} = this.props
|
||||
const {telegrafSystemInterval} = await getEnv(links.environment)
|
||||
const hostsError = notifyUnableToGetHosts().message
|
||||
const tempVars = generateForHosts(source)
|
||||
|
||||
try {
|
||||
const hosts = await getCpuAndLoadForHosts(
|
||||
source.links.proxy,
|
||||
source.telegraf,
|
||||
telegrafSystemInterval
|
||||
telegrafSystemInterval,
|
||||
tempVars
|
||||
)
|
||||
if (!hosts) {
|
||||
throw new Error(hostsError)
|
||||
|
@ -71,8 +75,9 @@ class HostsPage extends Component {
|
|||
const {notify, autoRefresh} = this.props
|
||||
|
||||
this.setState({hostsLoading: true}) // Only print this once
|
||||
const {data} = await getLayouts()
|
||||
this.layouts = data.layouts
|
||||
const results = await getLayouts()
|
||||
const data = _.get(results, 'data')
|
||||
this.layouts = data && data.layouts
|
||||
if (!this.layouts) {
|
||||
const layoutError = notifyUnableToGetApps().message
|
||||
notify(notifyUnableToGetApps())
|
||||
|
|
|
@ -97,6 +97,11 @@ const AutoRefresh = ComposedComponent => {
|
|||
|
||||
const timeSeriesPromises = queries.map(query => {
|
||||
const {host, database, rp} = query
|
||||
// the key `database` was used upstream in HostPage.js, and since as of this writing
|
||||
// the codebase has not been fully converted to TypeScript, it's not clear where else
|
||||
// it may be used, but this slight modification is intended to allow for the use of
|
||||
// `database` while moving over to `db` for consistency over time
|
||||
const db = _.get(query, 'db', database)
|
||||
|
||||
const templatesWithIntervalVals = templates.map(temp => {
|
||||
if (temp.tempVar === ':interval:') {
|
||||
|
@ -125,7 +130,7 @@ const AutoRefresh = ComposedComponent => {
|
|||
return fetchTimeSeriesAsync(
|
||||
{
|
||||
source: host,
|
||||
db: database,
|
||||
db,
|
||||
rp,
|
||||
query,
|
||||
tempVars,
|
||||
|
|
|
@ -8,7 +8,7 @@ import {insecureSkipVerifyText} from 'shared/copy/tooltipText'
|
|||
|
||||
import {SUPERADMIN_ROLE} from 'src/auth/Authorized'
|
||||
|
||||
const SourceForm = ({
|
||||
export const SourceForm = ({
|
||||
source,
|
||||
editMode,
|
||||
onSubmit,
|
||||
|
@ -100,7 +100,7 @@ const SourceForm = ({
|
|||
/>
|
||||
</div>
|
||||
) : null}
|
||||
<div className="form-group col-xs-12">
|
||||
<div className="form-group col-xs-12 col-sm-6">
|
||||
<label htmlFor="telegraf">Telegraf Database</label>
|
||||
<input
|
||||
type="text"
|
||||
|
@ -111,6 +111,17 @@ const SourceForm = ({
|
|||
value={source.telegraf}
|
||||
/>
|
||||
</div>
|
||||
<div className="form-group col-xs-12 col-sm-6">
|
||||
<label htmlFor="defaultRP">Default Retention Policy</label>
|
||||
<input
|
||||
type="text"
|
||||
name="defaultRP"
|
||||
className="form-control"
|
||||
id="defaultRP"
|
||||
onChange={onInputChange}
|
||||
value={source.defaultRP}
|
||||
/>
|
||||
</div>
|
||||
<div className="form-group col-xs-12">
|
||||
<div className="form-control-static">
|
||||
<input
|
||||
|
|
|
@ -3,19 +3,23 @@ import {Kapacitor} from './'
|
|||
export interface Source {
|
||||
id: string
|
||||
name: string
|
||||
url: string
|
||||
type: string
|
||||
default: boolean
|
||||
organization: string
|
||||
insecureSkipVerify: boolean
|
||||
role: string
|
||||
telegraf: string
|
||||
links: SourceLinks
|
||||
kapacitors?: Kapacitor[]
|
||||
username?: string
|
||||
password?: string
|
||||
sharedSecret?: string
|
||||
url: string
|
||||
metaUrl?: string
|
||||
insecureSkipVerify: boolean
|
||||
default: boolean
|
||||
telegraf: string
|
||||
organization: string
|
||||
role: string
|
||||
defaultRP: string
|
||||
links: SourceLinks
|
||||
kapacitors?: Kapacitor[] // this field does not exist on the server type for Source and is added in the client in the reducer for loading kapacitors.
|
||||
}
|
||||
|
||||
interface SourceLinks {
|
||||
export interface SourceLinks {
|
||||
self: string
|
||||
kapacitors: string
|
||||
proxy: string
|
||||
|
@ -23,6 +27,8 @@ interface SourceLinks {
|
|||
write: string
|
||||
permissions: string
|
||||
users: string
|
||||
databases: string
|
||||
roles?: string
|
||||
databases: string
|
||||
annotations: string
|
||||
health: string
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
interface Source {
|
||||
telegraf: string
|
||||
defaultRP: string
|
||||
}
|
||||
|
||||
interface Value {
|
||||
value: string
|
||||
type: string
|
||||
selected: boolean
|
||||
}
|
||||
|
||||
interface TempVar {
|
||||
tempVar: string
|
||||
id: string
|
||||
type: string
|
||||
values: Value[]
|
||||
}
|
||||
|
||||
export const generateForHosts = (source: Source): TempVar[] => [
|
||||
{
|
||||
tempVar: ':db:',
|
||||
id: 'db',
|
||||
type: 'constant',
|
||||
values: [{value: source.telegraf, type: 'constant', selected: true}],
|
||||
},
|
||||
{
|
||||
tempVar: ':rp:',
|
||||
id: 'rp',
|
||||
type: 'constant',
|
||||
values: [{value: source.defaultRP, type: 'constant', selected: true}],
|
||||
},
|
||||
]
|
|
@ -0,0 +1,59 @@
|
|||
import React from 'react'
|
||||
import {shallow} from 'enzyme'
|
||||
|
||||
import {HostsPage} from 'src/hosts/containers/HostsPage'
|
||||
import HostsTable from 'src/hosts/components/HostsTable'
|
||||
import SourceIndicator from 'src/shared/components/SourceIndicator'
|
||||
import AutoRefreshDropdown from 'src/shared/components/AutoRefreshDropdown'
|
||||
|
||||
import {source} from 'test/resources'
|
||||
|
||||
jest.mock('src/hosts/apis', () => require('mocks/hosts/apis'))
|
||||
jest.mock('src/shared/apis/env', () => require('mocks/shared/apis/env'))
|
||||
|
||||
import {getCpuAndLoadForHosts} from 'src/hosts/apis'
|
||||
|
||||
const setup = (override = {}) => {
|
||||
const props = {
|
||||
source,
|
||||
links: {environment: ''},
|
||||
autoRefresh: 0,
|
||||
manualRefresh: 0,
|
||||
onChooseAutoRefresh: () => {},
|
||||
onManualRefresh: () => {},
|
||||
notify: () => {},
|
||||
...override,
|
||||
}
|
||||
|
||||
const wrapper = shallow(<HostsPage {...props} />)
|
||||
return {wrapper, props}
|
||||
}
|
||||
|
||||
describe('Hosts.Containers.HostsPage', () => {
|
||||
describe('rendering', () => {
|
||||
it('renders all children components', () => {
|
||||
const {wrapper} = setup()
|
||||
const sourceIndicator = wrapper.find(SourceIndicator)
|
||||
const autoRefreshDropdown = wrapper.find(AutoRefreshDropdown)
|
||||
const hostsTable = wrapper.find(HostsTable)
|
||||
|
||||
expect(sourceIndicator.exists()).toBe(true)
|
||||
expect(autoRefreshDropdown.exists()).toBe(true)
|
||||
expect(hostsTable.exists()).toBe(true)
|
||||
})
|
||||
|
||||
describe('hosts', () => {
|
||||
it('renders hosts when response has hosts', done => {
|
||||
const {wrapper} = setup()
|
||||
|
||||
process.nextTick(() => {
|
||||
wrapper.update()
|
||||
const hostsTable = wrapper.find(HostsTable)
|
||||
expect(hostsTable.prop('hosts').length).toBe(1)
|
||||
expect(getCpuAndLoadForHosts).toHaveBeenCalledTimes(2)
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
|
@ -1,3 +1,6 @@
|
|||
import {Source} from 'src/types'
|
||||
import {SourceLinks} from 'src/types/sources'
|
||||
|
||||
export const role = {
|
||||
name: '',
|
||||
organization: '',
|
||||
|
@ -17,7 +20,7 @@ export const me = {
|
|||
role,
|
||||
}
|
||||
|
||||
export const links = {
|
||||
export const sourceLinks: SourceLinks = {
|
||||
self: '/chronograf/v1/sources/16',
|
||||
kapacitors: '/chronograf/v1/sources/16/kapacitors',
|
||||
proxy: '/chronograf/v1/sources/16/proxy',
|
||||
|
@ -26,10 +29,11 @@ export const links = {
|
|||
permissions: '/chronograf/v1/sources/16/permissions',
|
||||
users: '/chronograf/v1/sources/16/users',
|
||||
databases: '/chronograf/v1/sources/16/dbs',
|
||||
annotations: '/chronograf/v1/sources/16/annotations',
|
||||
health: '/chronograf/v1/sources/16/health',
|
||||
}
|
||||
|
||||
export const source = {
|
||||
export const source: Source = {
|
||||
id: '16',
|
||||
name: 'ssl',
|
||||
type: 'influx',
|
||||
|
@ -40,7 +44,8 @@ export const source = {
|
|||
telegraf: 'telegraf',
|
||||
organization: '0',
|
||||
role: 'viewer',
|
||||
links,
|
||||
defaultRP: '',
|
||||
links: sourceLinks,
|
||||
}
|
||||
|
||||
export const timeRange = {
|
||||
|
@ -450,3 +455,115 @@ export const authLinks = {
|
|||
sources: '/chronograf/v1/sources',
|
||||
users: '/chronograf/v1/organizations/default/users',
|
||||
}
|
||||
|
||||
export const layout = {
|
||||
id: '6dfb4d49-20dc-4157-9018-2b1b1cb75c2d',
|
||||
app: 'apache',
|
||||
measurement: 'apache',
|
||||
autoflow: false,
|
||||
cells: [
|
||||
{
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 4,
|
||||
h: 4,
|
||||
i: '0246e457-916b-43e3-be99-211c4cbc03e8',
|
||||
name: 'Apache Bytes/Second',
|
||||
queries: [
|
||||
{
|
||||
query:
|
||||
'SELECT non_negative_derivative(max("BytesPerSec")) AS "bytes_per_sec" FROM ":db:".":rp:"."apache"',
|
||||
groupbys: ['"server"'],
|
||||
label: 'bytes/s',
|
||||
},
|
||||
],
|
||||
axes: {
|
||||
x: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
||||
y: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
||||
y2: {
|
||||
bounds: [],
|
||||
label: '',
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
base: '',
|
||||
scale: '',
|
||||
},
|
||||
},
|
||||
type: '',
|
||||
colors: [],
|
||||
},
|
||||
{
|
||||
x: 4,
|
||||
y: 0,
|
||||
w: 4,
|
||||
h: 4,
|
||||
i: '37f2e4bb-9fa5-4891-a424-9df5ce7458bb',
|
||||
name: 'Apache - Requests/Second',
|
||||
queries: [
|
||||
{
|
||||
query:
|
||||
'SELECT non_negative_derivative(max("ReqPerSec")) AS "req_per_sec" FROM ":db:".":rp:"."apache"',
|
||||
groupbys: ['"server"'],
|
||||
label: 'requests/s',
|
||||
},
|
||||
],
|
||||
axes: {
|
||||
x: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
||||
y: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
||||
y2: {
|
||||
bounds: [],
|
||||
label: '',
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
base: '',
|
||||
scale: '',
|
||||
},
|
||||
},
|
||||
type: '',
|
||||
colors: [],
|
||||
},
|
||||
{
|
||||
x: 8,
|
||||
y: 0,
|
||||
w: 4,
|
||||
h: 4,
|
||||
i: 'ea9174b3-2b56-4e80-a37d-064507c6775a',
|
||||
name: 'Apache - Total Accesses',
|
||||
queries: [
|
||||
{
|
||||
query:
|
||||
'SELECT non_negative_derivative(max("TotalAccesses")) AS "tot_access" FROM ":db:".":rp:"."apache"',
|
||||
groupbys: ['"server"'],
|
||||
label: 'accesses/s',
|
||||
},
|
||||
],
|
||||
axes: {
|
||||
x: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
||||
y: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
||||
y2: {
|
||||
bounds: [],
|
||||
label: '',
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
base: '',
|
||||
scale: '',
|
||||
},
|
||||
},
|
||||
type: '',
|
||||
colors: [],
|
||||
},
|
||||
],
|
||||
link: {
|
||||
href: '/chronograf/v1/layouts/6dfb4d49-20dc-4157-9018-2b1b1cb75c2d',
|
||||
rel: 'self',
|
||||
},
|
||||
}
|
||||
|
||||
export const hosts = {
|
||||
'MacBook-Pro.local': {
|
||||
name: 'MacBook-Pro.local',
|
||||
deltaUptime: -1,
|
||||
cpu: 0,
|
||||
load: 0,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
import React from 'react'
|
||||
import {shallow} from 'enzyme'
|
||||
|
||||
import {SourceForm} from 'src/sources/components/SourceForm'
|
||||
|
||||
const setup = (override = {}) => {
|
||||
const noop = () => {}
|
||||
const props = {
|
||||
source: {
|
||||
url: '',
|
||||
name: '',
|
||||
username: '',
|
||||
password: '',
|
||||
telegraf: '',
|
||||
insecureSkipVerify: false,
|
||||
default: false,
|
||||
metaUrl: '',
|
||||
},
|
||||
editMode: false,
|
||||
onSubmit: noop,
|
||||
onInputChange: noop,
|
||||
onBlurSourceURL: noop,
|
||||
isUsingAuth: false,
|
||||
gotoPurgatory: noop,
|
||||
isInitialSource: false,
|
||||
me: {},
|
||||
...override,
|
||||
}
|
||||
|
||||
const wrapper = shallow(<SourceForm {...props} />)
|
||||
return {wrapper, props}
|
||||
}
|
||||
|
||||
describe('Sources.Components.SourceForm', () => {
|
||||
describe('rendering', () => {
|
||||
it('renders default retention policy field', () => {
|
||||
const {wrapper} = setup()
|
||||
const inputs = wrapper.find('input')
|
||||
const defaultRP = inputs.find({id: 'defaultRP'})
|
||||
|
||||
expect(defaultRP.exists()).toBe(true)
|
||||
})
|
||||
})
|
||||
})
|
|
@ -0,0 +1,55 @@
|
|||
import {generateForHosts} from 'src/utils/tempVars'
|
||||
|
||||
describe('utils.tempVars', () => {
|
||||
describe('generateForHosts', () => {
|
||||
it('should return template variables', () => {
|
||||
const telegraf = 'bob'
|
||||
const defaultRP = '1h10m'
|
||||
const source = {telegraf, defaultRP}
|
||||
|
||||
const expected = [
|
||||
{
|
||||
tempVar: ':db:',
|
||||
id: 'db',
|
||||
type: 'constant',
|
||||
values: [{value: telegraf, type: 'constant', selected: true}],
|
||||
},
|
||||
{
|
||||
tempVar: ':rp:',
|
||||
id: 'rp',
|
||||
type: 'constant',
|
||||
values: [{value: defaultRP, type: 'constant', selected: true}],
|
||||
},
|
||||
]
|
||||
const actual = generateForHosts(source)
|
||||
|
||||
expect(actual).toEqual(expected)
|
||||
})
|
||||
|
||||
describe('if rp is an empty string', () => {
|
||||
it('should return an empty rention policy variable', () => {
|
||||
const telegraf = 'bob'
|
||||
const defaultRP = ''
|
||||
const source = {telegraf, defaultRP}
|
||||
|
||||
const expected = [
|
||||
{
|
||||
tempVar: ':db:',
|
||||
id: 'db',
|
||||
type: 'constant',
|
||||
values: [{value: telegraf, type: 'constant', selected: true}],
|
||||
},
|
||||
{
|
||||
tempVar: ':rp:',
|
||||
id: 'rp',
|
||||
type: 'constant',
|
||||
values: [{value: '', type: 'constant', selected: true}],
|
||||
},
|
||||
]
|
||||
const actual = generateForHosts(source)
|
||||
|
||||
expect(actual).toEqual(expected)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue