Merge pull request #979 from grafana/matiasb/slack-endpoint-extra-logging

Add additional logging info for slack API event endpoint requests
This commit is contained in:
Matias Bordese 2022-12-12 15:58:10 -03:00 committed by GitHub
commit ad71fc3d61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,6 +143,15 @@ class SlackEventApiEndpointView(APIView):
if isinstance(payload, str):
payload = json.JSONDecoder().decode(payload)
logger.info(
"team_id: %s channel_id: %s user_id: %s command: %s event: %s",
payload.get("team_id"),
payload.get("channel_id"),
payload.get("user_id"),
payload.get("command"),
payload.get("event", {}).get("type"),
)
# Checking if it's repeated Slack request
if "HTTP_X_SLACK_RETRY_NUM" in request.META and int(request.META["HTTP_X_SLACK_RETRY_NUM"]) > 1:
logger.critical(