Skip to content

Commit

Permalink
chore(sentry apps): Adjust logs when we dont have a url (#79779)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christinarlong authored Oct 25, 2024
1 parent 76f9dcd commit 4a448fb
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions src/sentry/sentry_apps/external_requests/select_requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,27 @@ def run(self) -> dict[str, Any]:

response = json.loads(body)
except Exception as e:
logger.info(
"select-requester.error",
extra={
"sentry_app_slug": self.sentry_app.slug,
"install_uuid": self.install.uuid,
"project_slug": self.project_slug,
"error_message": str(e),
"url": url,
},
)
extra = {
"sentry_app_slug": self.sentry_app.slug,
"install_uuid": self.install.uuid,
"project_slug": self.project_slug,
"error_message": str(e),
}

if not url:
extra.update(
{
"uri": self.uri,
"dependent_data": self.dependent_data,
"webhook_url": self.sentry_app.webhook_url,
}
)
message = "select-requester.missing-url"
else:
extra.update({"url": url})
message = "select-requester.request-failed"

logger.info(message, extra=extra)
raise APIError from e

if not self._validate_response(response):
Expand Down

0 comments on commit 4a448fb

Please sign in to comment.