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

Page duty V2 #10189

Merged
merged 4 commits into from
Nov 6, 2020
Merged

Page duty V2 #10189

merged 4 commits into from
Nov 6, 2020

Conversation

thiagoftsm
Copy link
Contributor

Summary

Fixes #10151

The main goal of this PR is to use the API V2 that Pager duty, but as we agreed with @Ferroin we are also using this PR to change the indentation used inside the file.

Component Name

Alarm notify

Test Plan

1 - Ask @knatsakis to invite you for Pagerduty.
2 - Create a new service.
3 - Get a key for API V2.
4 - Set the variable DEFAULT_RECIPIENT_PD
5 - Go to plugins.d directory cd /usr/libexec/netdata/plugins.d/
6 - Run the test: ./alarm-notify.sh test

Additional Information

When I ran the tests, I also kept telegram, slack and hangout enabled, and I received the alarms on all channels.
@knatsakis it was the first time that I worked with PagerDuty. I could not see the alarms on the service that I created, but I am always receiving 202 as you can see

*  subject: C=US; ST=California; L=San Francisco; O=PagerDuty, Inc.; CN=*.pagerduty.com
*  start date: Apr  6 00:00:00 2020 GMT
*  expire date: Apr 14 12:00:00 2021 GMT
*  subjectAltName: host "events.pagerduty.com" matched cert's "*.pagerduty.com"
*  issuer: C=US; O=DigiCert Inc; CN=DigiCert SHA2 Secure Server CA
*  SSL certificate verify ok.
} [5 bytes data]
> POST /v2/enqueue HTTP/1.1
> Host: events.pagerduty.com
> User-Agent: curl/7.73.0
> Accept: */*
> Content-Length: 1245
> Content-Type: application/x-www-form-urlencoded
> 
} [1245 bytes data]
* upload completely sent off: 1245 out of 1245 bytes
{ [5 bytes data]
* Mark bundle as not supporting multiuse

< HTTP/1.1 202 Accepted
< Server: nginx
< Date: Tue, 03 Nov 2020 23:04:16 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 64
< Connection: keep-alive

I think I am missing something on dashboard configuration.

@knatsakis
Copy link
Contributor

I think I am missing something on dashboard configuration.

@thiagoftsm, I am not aware of any dashboard configuration needed. It looks to me as if the alerts don't get triggered/accepted by PagerDuty. You can try using the "Netdata Cloud Production (alertmanager)" for a test if you like.

knatsakis
knatsakis previously approved these changes Nov 4, 2020
vlvkobal
vlvkobal previously approved these changes Nov 4, 2020
Copy link
Contributor

@vlvkobal vlvkobal left a comment

Choose a reason for hiding this comment

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

The code LGTM.

ilyam8
ilyam8 previously approved these changes Nov 4, 2020
@thiagoftsm
Copy link
Contributor Author

According the Pagerduty page, it is necessary to request access to have this new version enabled, I won't merge this PR until we have conditions to test. It looks like that we are not having any problem, considering the response code we are receiving, on the other hand, if we merge this PR, we will be forced to require access to the new API before to use Pagerduty

@thiagoftsm
Copy link
Contributor Author

thiagoftsm commented Nov 5, 2020

@vlvkobal , @ilyam8 and @knatsakis I pushed another commit bringing back the version 1 as default, and I also added another variable for users to select the newest version after they require usage for PagerDuty. We will need to move forward with this variable, until Pager Duty set version 2 as default.

@thiagoftsm thiagoftsm merged commit fda93c7 into netdata:master Nov 6, 2020
@thiagoftsm thiagoftsm deleted the page_duty_v2 branch November 6, 2020 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support PagerDuty API v2
4 participants