Hi,
In this example under the slack_bot lambda, the following code handles slack retry messages:
|
if 'x-slack-retry-num' in event['headers']: |
|
slk_retry = event['headers']['x-slack-retry-num'] |
|
logger.info({"slk_retry": slk_retry}) |
|
metrics.add_metric( |
|
name="Retry", |
|
unit=MetricUnit.Count, |
However when deploying this example the actual header returned from slack is: X-Slack-Retry-Num and not x-slack-retry-num.
example from lambda event log:
"headers": {
"Content-Length": "865",
"Content-Type": "application/json",
"User-Agent": "Slackbot 1.0 (+https://api.slack.com/robots)",
"X-Forwarded-For": "3.89.205.0",
"X-Forwarded-Port": "443",
"X-Forwarded-Proto": "https",
"X-Slack-Request-Timestamp": "1739205646",
"X-Slack-Retry-Num": "1",
"X-Slack-Retry-Reason": "http_timeout",
"accept": "*/*",
"accept-encoding": "gzip,deflate"
},
the official slack documentation also reference the header as x-slack-retry-num so I'm not sure, maybe I got something wrong.
Hi,
In this example under the
slack_botlambda, the following code handles slack retry messages:Multi-Interface-Chatbot-using-Amazon-Q-and-Slack-with-CloudFront-Clickable-References/lambdas/slack_bot/index.py
Lines 45 to 50 in 50d6f6e
However when deploying this example the actual header returned from slack is:
X-Slack-Retry-Numand notx-slack-retry-num.example from lambda event log:
the official slack documentation also reference the header as
x-slack-retry-numso I'm not sure, maybe I got something wrong.