getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
37.64k stars 4.05k forks source link

PagerDuty Integration: Unable to add integration on self-hosted sentry #23480

Open Elektordi opened 3 years ago

Elektordi commented 3 years ago

Hello,

I'm unable to add a PagerDuty integration to a freshly installed self-hosted Sentry server.

After logging on pagerduty, I get this error: App not found.

The url at this moment is: https://xxxxxxx.pagerduty.com/install/integration?app_id=&redirect_url=http://x.x.x.x:9000/extensions/pagerduty/setup/&version=2 The app_id is empty. I was able to find the Sentry app_id from pagerduty, which seems to be PKAPG94. And then if I update the url, I can select projects from my pagerduty account. But still can't continue because of the error: The supplied redirect URL does not match a redirect URL configured by this app.

I think the automatic integration may not be working on self-hosted servers. Is there any way to manually add the integration (like, copy-pasting integration keys from pagerduty)? Or maybe disable the automatic integration on self-hosted by default if it's not supposed to work...

Thanks,

Elektordi commented 3 years ago

Ok, nailed it. If anyone else needs to fake the integration, here is the url you need to call: http://x.x.x.x:9000/extensions/pagerduty/setup/?config=%7B%22account%22%3A+%7B%22name%22%3A+%22Example+company%22%2C+%22subdomain%22%3A+%22example%22%7D%2C+%22integration_keys%22%3A+%5B%7B%22type%22%3A+%22service%22%2C+%22integration_key%22%3A+%22xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%22%2C+%22id%22%3A+%22ZZZZZZZ%22%2C+%22name%22%3A+%22Test%22%7D%5D%7D

Where the parameters is the url_encoded of the json below:

{
   "account" : {
      "name" : "Example company",
      "subdomain" : "example"
   },
   "integration_keys" : [
      {
         "type" : "service",
         "integration_key" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
         "id" : "ZZZZZZZ",
         "name" : "Test"
      }
   ]
}
BYK commented 3 years ago

Looks like we need to add an integration guide here: https://develop.sentry.dev/integrations/ @manuzope

mpechner-akasa commented 1 year ago

2 years later and still not in the documentation. Did this not work for others? I am having a similar issue. For me sentry does not consider pagerduty installed.

chipzzz commented 2 months ago

Just adding a note here. For self hosted sentry (using helm chart) setting pagerduty.app-id in config.yaml or even setting it as SENTRY_OPTIONS['pagerduty.app-id'] = <id> in pyConfig has no effect.

A pagerduty user that has permissions to create apps has to go through https://develop.sentry.dev/integrations/pagerduty create the app then for each org in sentry go through the UI workflow of setting up pagerduty.

Setting either of the mentioned parameters has no bounds on sentry.

getsantry[bot] commented 2 months ago

Routing to @getsentry/product-owners-settings-integrations for triage ⏲️

chipzzz commented 3 weeks ago

@BYK , has anyone solved this for self-hosted? The only way I got it to work was as I described here. IT doesn't work deployment wide, you still have to do it per org. Also you have to create your own sentry app, self-hosted cannot use the global sentry app available on Pagerduty

https://github.com/getsentry/sentry/issues/23480#issuecomment-2105185908

chipzzz commented 3 weeks ago

To add this is a multi-org environment.