Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kapacitor alert rule to have detail field #852

Merged
merged 5 commits into from
Feb 9, 2017

Conversation

goller
Copy link
Contributor

@goller goller commented Feb 7, 2017

  • CHANGELOG.md updated
  • Rebased/mergable
  • Tests pass
  • Sign CLA (if not already signed)

Connect #838

The problem

Kapacitor supports adding an email body via the .details() chaining method.

The Solution

Added detail to rules endpoint.

@@ -34,19 +30,19 @@ export const RuleMessage = React.createClass({
const alerts = this.props.enabledAlerts.map((text) => {
return {text, ruleID: rule.id};
});
const selectedAlert = rule.alerts[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this always be the first item in the array? Why is that?

Copy link
Contributor

@121watts 121watts Feb 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should either be the first element in the array or undefined. Currently, there is only a 1-to-1 relationship of rule to output. This will be changing in the future which is why it's stored in an array.

return {...state, ...{
[ruleID]: {...state[ruleID], details},
}};
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

Copy link
Contributor

@121watts 121watts Feb 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha. idk if this syntax is easier to follow than Object.assign but I'm trying it out.

@goller goller merged commit 7deaf84 into master Feb 9, 2017
@goller goller deleted the feature/kapacitor-detail-field branch February 9, 2017 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants