diff --git a/CHANGELOG.md b/CHANGELOG.md index 49517decd..8785affed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ 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 1. [#3290](https://github.com/influxdata/chronograf/pull/3290): Add support for PagerDuty v2 in UI 1. [#3369](https://github.com/influxdata/chronograf/pull/3369): Add support for OpsGenie v2 in UI +1. [#3386](https://github.com/influxdata/chronograf/pull/3386): Add support for Kafka in UI to configure and create alert handlers 1. [#3416](https://github.com/influxdata/chronograf/pull/3416): Allow kapacitor services to be disabled ### UI Improvements @@ -34,6 +35,9 @@ 1. [#3357](https://github.com/influxdata/chronograf/pull/3357): Fix only the selected template variable value getting loaded 1. [#3389](https://github.com/influxdata/chronograf/pull/3389): Fix Generic OAuth bug for GitHub Enterprise where the principal was incorrectly being checked for email being Primary and Verified 1. [#3402](https://github.com/influxdata/chronograf/pull/3402): Fix missing icons when using basepath +1. [#3412](https://github.com/influxdata/chronograf/pull/3412): Limit max-width of TICKScript editor. +1. [#3166](https://github.com/influxdata/chronograf/pull/3166): Fixes naming of new TICKScripts + ## v1.4.4.1 [2018-04-16] diff --git a/kapacitor.go b/kapacitor.go index c5c3cc3ce..f6e3f0d4f 100644 --- a/kapacitor.go +++ b/kapacitor.go @@ -22,7 +22,8 @@ type AlertNodes struct { Alerta []*Alerta `json:"alerta"` // Alerta will send alert to all Alerta OpsGenie []*OpsGenie `json:"opsGenie"` // OpsGenie will send alert to all OpsGenie OpsGenie2 []*OpsGenie `json:"opsGenie2"` // OpsGenie2 will send alert to all OpsGenie v2 - Talk []*Talk `json:"talk"` // Talk will send alert to all Talk + Talk []*Talk `json:"talk"` // Talk will send alert to all Talk + Kafka []*Kafka `json:"kafka"` // Kafka will send alert to all Kafka } // Post will POST alerts to a destination URL @@ -135,6 +136,13 @@ type OpsGenie struct { // Talk sends alerts to Jane Talk (https://jianliao.com/site) type Talk struct{} +// Kafka sends alerts to any Kafka brokers specified in the handler config +type Kafka struct { + Cluster string `json:"cluster"` + Topic string `json:"topic"` + Template string `json:"template"` +} + // MarshalJSON converts AlertNodes to JSON func (n *AlertNodes) MarshalJSON() ([]byte, error) { type Alias AlertNodes diff --git a/kapacitor/client.go b/kapacitor/client.go index 2ceda3a38..3fdb0dad4 100644 --- a/kapacitor/client.go +++ b/kapacitor/client.go @@ -160,7 +160,7 @@ func (c *Client) createFromTick(rule chronograf.AlertRule) (*client.CreateTaskOp } return &client.CreateTaskOptions{ - ID: rule.ID, + ID: rule.Name, Type: taskType, DBRPs: dbrps, TICKscript: string(rule.TICKScript), diff --git a/server/kapacitors.go b/server/kapacitors.go index a528ba894..97b581f6d 100644 --- a/server/kapacitors.go +++ b/server/kapacitors.go @@ -339,6 +339,10 @@ func (s *Service) KapacitorRulesPost(w http.ResponseWriter, r *http.Request) { } */ + if req.Name == "" { + req.Name = req.ID + } + req.ID = "" task, err := c.Create(ctx, req) if err != nil { @@ -409,6 +413,10 @@ func newAlertResponse(task *kapa.Task, srcID, kapaID int) *alertResponse { res.AlertNodes.HipChat = []*chronograf.HipChat{} } + if res.AlertNodes.Kafka == nil { + res.AlertNodes.Kafka = []*chronograf.Kafka{} + } + if res.AlertNodes.Log == nil { res.AlertNodes.Log = []*chronograf.Log{} } diff --git a/server/kapacitors_test.go b/server/kapacitors_test.go index f528a540a..b6c9f9150 100644 --- a/server/kapacitors_test.go +++ b/server/kapacitors_test.go @@ -132,6 +132,7 @@ func Test_KapacitorRulesGet(t *testing.T) { OpsGenie: []*chronograf.OpsGenie{}, OpsGenie2: []*chronograf.OpsGenie{}, Talk: []*chronograf.Talk{}, + Kafka: []*chronograf.Kafka{}, }, }, }, diff --git a/server/swagger.json b/server/swagger.json index 070d6df48..24c79e5fa 100644 --- a/server/swagger.json +++ b/server/swagger.json @@ -3677,6 +3677,7 @@ "post", "http", "hipchat", + "kafka", "opsgenie", "opsgenie2", "pagerduty", diff --git a/ui/package.json b/ui/package.json index aae5e61f9..d25494042 100644 --- a/ui/package.json +++ b/ui/package.json @@ -146,7 +146,7 @@ "react-grid-layout": "^0.16.6", "react-onclickoutside": "^5.2.0", "react-redux": "^4.4.0", - "react-resizable": "^1.7.5", + "react-resize-detector": "^2.3.0", "react-router": "^3.0.2", "react-router-redux": "^4.0.8", "react-tooltip": "^3.2.1", diff --git a/ui/src/CheckSources.tsx b/ui/src/CheckSources.tsx index dfe6d2abc..03fa5bd0e 100644 --- a/ui/src/CheckSources.tsx +++ b/ui/src/CheckSources.tsx @@ -24,7 +24,7 @@ import {DEFAULT_HOME_PAGE} from 'src/shared/constants' import * as copy from 'src/shared/copy/notifications' -import {Source, Me} from 'src/types' +import {Source, Me, Notification, NotificationFunc} from 'src/types' interface Auth { isUsingAuth: boolean @@ -47,7 +47,7 @@ interface Props { router: InjectedRouter location: Location auth: Auth - notify: () => void + notify: (message: Notification | NotificationFunc) => void errorThrown: () => void } diff --git a/ui/src/admin/components/EmptyRow.js b/ui/src/admin/components/EmptyRow.js deleted file mode 100644 index af2179038..000000000 --- a/ui/src/admin/components/EmptyRow.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react' -import PropTypes from 'prop-types' - -const EmptyRow = ({tableName}) => ( -
- You don't have any {tableName},
why not create one?
-
+ You don't have any {tableName},
why not create one?
+
Build a Query above
-Build a Query above
+