diff --git a/integrations/pagerduty/CHANGELOG.md b/integrations/pagerduty/CHANGELOG.md index dcf1536039..8cb75b3508 100644 --- a/integrations/pagerduty/CHANGELOG.md +++ b/integrations/pagerduty/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +# Port_Ocean 0.1.19 (2023-11-29) + +### Improvements + +- Enhance oncalls API with detailed logging (#19) + + # Port_Ocean 0.1.18 (2023-11-29) ### Improvements diff --git a/integrations/pagerduty/clients/pagerduty.py b/integrations/pagerduty/clients/pagerduty.py index 61cccbf9df..7fde7d2193 100644 --- a/integrations/pagerduty/clients/pagerduty.py +++ b/integrations/pagerduty/clients/pagerduty.py @@ -153,6 +153,9 @@ async def create_webhooks_if_not_exists(self) -> None: async def get_oncall_user( self, *escalation_policy_ids: str ) -> list[dict[str, Any]]: + logger.info( + f"Fetching who is oncall for escalation poilices: {','.join(escalation_policy_ids)}" + ) params = { "escalation_policy_ids[]": ",".join(escalation_policy_ids), "include[]": "users", @@ -163,6 +166,7 @@ async def get_oncall_user( data_key="oncalls", params=params ): logger.info(f"Received oncalls with batch size {len(oncall_batch)}") + logger.info(f"Listing received oncalls data: {oncall_batch}") oncalls.extend(oncall_batch) return oncalls @@ -170,7 +174,10 @@ async def get_oncall_user( async def update_oncall_users( self, services: list[dict[str, Any]] ) -> list[dict[str, Any]]: - logger.info("Fetching and matching who is on-call for services") + services_names = [service["name"] for service in services] + logger.info( + f"Fetching and matching who is on-call for {len(services)} services: {services_names}" + ) oncall_users = await self.get_oncall_user( *[service["escalation_policy"]["id"] for service in services] ) diff --git a/integrations/pagerduty/pyproject.toml b/integrations/pagerduty/pyproject.toml index 2a8c5b7ea8..503a323b98 100644 --- a/integrations/pagerduty/pyproject.toml +++ b/integrations/pagerduty/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pagerduty" -version = "0.1.18" +version = "0.1.19" description = "Pagerduty Integration" authors = ["Port Team "]