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

Watcher: Switch to pagerduty API V2 #32243

Closed
spinscale opened this issue Jul 20, 2018 · 10 comments
Closed

Watcher: Switch to pagerduty API V2 #32243

spinscale opened this issue Jul 20, 2018 · 10 comments

Comments

@spinscale
Copy link
Contributor

Watcher is currently using the v1 API events endpoint, available under https://v1.developer.pagerduty.com/documentation/events

This is however decommissioned at the 19th of October, so we have to switch to V2 API as soon as possible.

More info under https://v2.developer.pagerduty.com/

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@jasontedor
Copy link
Member

jasontedor commented Jul 20, 2018

If I read this correctly:

On April 24, 2018, at 22:00 PDT (UTC+7), our v1 REST API is entering a decommissioning period. Starting on that date, you will no longer be able to generate v1 REST API keys, but the v1 REST API will remain operational.

it implies that new users would not be able to use our PagerDuty integration today.

hub-cap added a commit to hub-cap/elasticsearch that referenced this issue Jul 23, 2018
The PagerDuty v1 API is EOL and will stop accepting new accounts
shortly. This commit swaps out the watcher use of the v1 API with the
new v2 API. It does not change anything about the existing watcher
API.

Closes elastic#32243
@hub-cap
Copy link
Contributor

hub-cap commented Aug 2, 2018

So after finishing the PR, I got to reading the actual docs here. Look at the gem I found.

WILL THE V1 EVENTS API STILL BE SUPPORTED?
This change only affects the v1 REST API. You can continue to use the v1 Events API as you do today.Learn more about our the differences between our APIs here.

This comes directly from the linked doc in the issue description. The only place we use the PagerDuty API is here, and for brevity ill include the 2 lines below.

    static final String HOST = "events.pagerduty.com";
    static final String PATH = "/generic/2010-04-15/create_event.json";

This means we are only using the Events API, and yes we are still using the V1 Events API, which will not be affected by this.

The good news is that we can still migrate to the V2 Events API. PagerDuty has a V2 Events API already. The work is done in the PR attached to this issue. I am not sure this warrants a blocker / critical status anymore though.

@spinscale
Copy link
Contributor Author

Agreed on this one. Events API seems safe. I think it makes sense to switch to the newer API then on master only, once verified that old tokens can be reused. But this is not a blocker anymore.

@hub-cap
Copy link
Contributor

hub-cap commented Aug 13, 2018

I think its worth backporting to 6.5 so future backports (which there will at least be one I know of) will be clean. Sound good @spinscale ?

hub-cap added a commit that referenced this issue Aug 14, 2018
The PagerDuty v1 API is EOL and will stop accepting new accounts
shortly. This commit swaps out the watcher use of the v1 API with the
new v2 API. It does not change anything about the existing watcher
API.

Closes #32243
hub-cap added a commit that referenced this issue Aug 15, 2018
The PagerDuty v1 API is EOL and will stop accepting new accounts
shortly. This commit swaps out the watcher use of the v1 API with the
new v2 API. It does not change anything about the existing watcher
API.

Closes #32243
@jasonslater2000
Copy link

I am running ES v6.4.3. Just tried creating a new API key. PagerDuty only creates v2 keys now, and it assigned a 20 character alphanumeric key. Plugged API key into elasticsearch.yml and created a watcher to use it. Checked .watcher-history index and found the call had failed with a 400 error and the following body.

"body": """{"status":"invalid event","message":"Event object is invalid","errors":["Service key is the wrong length (should be 32 characters)","Service key cannot contain non-alphanumeric characters."]}"""

@jasonslater2000
Copy link

Got it working, but had to create the API key in PagerDuty via Configuration/Services, rather than Configuration/API Access as is documented at https://www.elastic.co/guide/en/watcher/current/configuring-pagerduty.html

N.B.: During key creation, I selected "Events API v2" key, and this yielded a 32-character key.

@spinscale
Copy link
Contributor Author

@hub-cap can you take a look in the docs and fix if needed?

@jasonslater2000
Copy link

@hub-cap my pagerduty trial still has 12 days remaining. let me know if I can provide screenshots or my trial credentials for you to take screenshots.

@hub-cap
Copy link
Contributor

hub-cap commented Nov 26, 2018

heh, i missed this ping somehow. grr. Ill update the docs here, thanks for the notificaiton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants