AWS Lambda Adapter: Expose aws_request_id and log_stream_name in SlackRequestHandler context
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
Beginne in slack_bolt/adapter/aws_lambda/handler.py, wo SlackRequestHandler den AWS Lambda-Kontext auf bolt_req.context abbildet. Überprüfe die vorhandene Befüllung des Kontexts und stelle aws_request_id und log_stream_name neben den anderen Lambda-Werten bereit; die Aufgabe ist abgeschlossen, wenn beide Schlüssel während der Verarbeitung von Bolt-Anfragen verfügbar sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I would like to add two parameters from the AWS Lambda context into the BoltRequest context in AWS :
- aws_request_id
- log_stream_name
These parameters are useful for manual logging and are accessible directly from the context variable within lambda_handler(event, context) function when not in Bolt framework. I would like to also make them available in Bolt framework. Proposed code mirrors how bolt_req.context is currently populated in AWS Lambda adapter handler:
$ git diff
diff --git a/slack_bolt/adapter/aws_lambda/handler.py b/slack_bolt/adapter/aws_lambda/handler.py
index 1ba44dd..ba3e183 100644
--- a/slack_bolt/adapter/aws_lambda/handler.py
+++ b/slack_bolt/adapter/aws_lambda/handler.py
@@ -55,7 +55,11 @@ class SlackRequestHandler:
bolt_req = to_bolt_request(event)
# https://docs.aws.amazon.com/lambda/latest/dg/python-context.html
aws_lambda_function_name = context.function_name
+ aws_request_id = context.aws_request_id
+ log_stream_name = context.log_stream_name
bolt_req.context["aws_lambda_function_name"] = aws_lambda_function_name
+ bolt_req.context["aws_request_id"] = aws_request_id
+ bolt_req.context["log_stream_name"] = log_stream_name
bolt_req.context["aws_lambda_invoked_function_arn"] = context.invoked_function_arn
bolt_req.context["lambda_request"] = event
bolt_resp = self.app.dispatch(bolt_req)
I am open to implementing this feature myself if there is desire to add it to bolt-python.
Category (place an x in each of the [ ])
- slack_bolt.App and/or its core components
- slack_bolt.async_app.AsyncApp and/or its core components
- Adapters in slack_bolt.adapter
- Others
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
- Vorherrschende Sprache
- Python
- Sterne
- 1.3k
- Forks
- 291
- Ø Merge
- 1 T. 14 Std.
- Gemergte PRs (30 T.)
- 8
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus slackapi/bolt-python
-
docs enhancement server-side
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
slackapi/bolt-python#1576 · 1 Kommentar ·
-
auto-triage-skip bug security semver:major
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
slackapi/bolt-python#1447 · 9 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
slackapi/bolt-python#1577 ·
-
area:async auto-triage-skip dependencies
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
slackapi/bolt-python#1472 · 1 Kommentar · 1 Reaktion ·
-
Enhancement: Assistant should inherit global middleware for security and consistencyEvtl. wieder frei @hello-ashleyintech hat das vor 422 Tagen übernommen, und es ist kein Pull Request offen. Offenauto-triage-skip enhancement
slackapi/bolt-python#1346 · 2 Kommentare · 1 zugewiesene Person ·
Alle Issues in slackapi/bolt-python
Ähnliche Issues
-
tool-calling
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
vllm-project/vllm#59838 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
raullenchai/Rapid-MLX#4042 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
transitmatters/mbta-slow-zone-bot#70 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
litestar-org/advanced-alchemy#811 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag