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

Use details field from alert node in pagerduty #1512

Merged
merged 1 commit into from
Aug 8, 2017
Merged

Use details field from alert node in pagerduty #1512

merged 1 commit into from
Aug 8, 2017

Conversation

desa
Copy link
Contributor

@desa desa commented Aug 4, 2017

Fixes #743

Previously the details field specified on an alert node was not being used in the pagerduty service. Instead, the results object that generated was being used. This PR now uses the details field specified.

@nathanielc is this all, or is there something I'm missing?

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated

@desa desa requested a review from nathanielc August 4, 2017 13:52
@desa
Copy link
Contributor Author

desa commented Aug 4, 2017

@phemmer your thoughts would be appreciated.

@phemmer
Copy link

phemmer commented Aug 4, 2017

Seems straightforward enough. Lets .details() behave like all the other alert services 👍

@@ -7844,6 +7844,7 @@ stream
.info(lambda: "count" > 6.0)
.warn(lambda: "count" > 7.0)
.crit(lambda: "count" > 8.0)
.details('details')
Copy link
Contributor

Choose a reason for hiding this comment

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

Why change the test here? I'd like to test that the default behavior is not changed. Meaning if details is not specified that the pageDuty handler remains the same.

@@ -7828,6 +7828,8 @@ func TestStream_AlertPagerDuty(t *testing.T) {
ts := pagerdutytest.NewServer()
defer ts.Close()

defaultDetails := "{"Name":"cpu","TaskName":"TestStream_Alert","Group":"host=serverA","Tags":{"host":"serverA"},"ServerInfo":{"Hostname":"","ClusterID":"","ServerID":""},"ID":"kapacitor/cpu/serverA","Fields":{"count":10},"Level":"CRITICAL","Time":"1971-01-01T00:00:10Z","Message":"CRITICAL alert for kapacitor/cpu/serverA"}\n"
Copy link
Contributor Author

@desa desa Aug 4, 2017

Choose a reason for hiding this comment

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

This is the default format that gets generated.

@desa
Copy link
Contributor Author

desa commented Aug 7, 2017

@nathanielc this should be ready to review again. Also, once this is done should I cherry pick it onto master?

Copy link
Contributor

@nathanielc nathanielc left a comment

Choose a reason for hiding this comment

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

Looks good. Do not cherry pick but rather merge the v1.3 branch back to master.

@desa
Copy link
Contributor Author

desa commented Aug 8, 2017

kk

@desa desa merged commit 6dff1be into v1.3 Aug 8, 2017
@desa desa deleted the md-issue#743 branch August 8, 2017 18:15
@desa
Copy link
Contributor Author

desa commented Aug 8, 2017

Whoops. Just realized i didn't update the changelog. Going to open another PR for that.

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