avanier commented on issue #5107: URL: https://github.com/apache/incubator-devlake/issues/5107#issuecomment-1548581158
I had a quick look at the `debug` logs and it seems that while we're asking DevLake users to target specific PagerDuty services, the `service_ids[]` are actually not passed as part of the API call, meaning that all ALL incidents are pulled. On large _(or even non-trivial)_ organisations this is a significant issue as PagerDuty itself will limit the number of returns objects to `10_000`. Here's an example call as currently implemented ```plaintext [api-client] GET https://api.pagerduty.com/incidents?limit=100&offset=13700&since=2023-05-12+00%3A00%3A00+-0400+-0400&sort_by=created_at%3Adesc&total=true" ``` A better call would be something like ```plaintext [api-client] GET https://api.pagerduty.com/incidents?limit=100&offset=13700&since=2023-05-12+00%3A00%3A00+-0400+-0400%service_ids%5B%5D=asdf%2C1234&urgencies%5B%5D=high&sort_by=created_at%3Adesc&total=true" ``` Relevant PagerDuty API documentation [here](https://developer.pagerduty.com/api-reference/9d0b4b12e36f9-list-incidents). Relevant DevLake code seems to be [here](https://github.com/apache/incubator-devlake/blob/2affdffa7541552cf6e12bff7168a2592b60109a/backend/plugins/pagerduty/tasks/incidents_collector.go#L84-L101). I don't know that I'll get to dig into this, but the collecting of information may be useful to someone. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
