-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Introduce experimental JSON logging #10822
base: master
Are you sure you want to change the base?
Conversation
@@ -765,6 +765,7 @@ def create_function( | |||
f"Value {request.get('Runtime')} at 'runtime' failed to satisfy constraint: Member must satisfy enum value set: {VALID_RUNTIMES} or be a valid ARN", | |||
Type="User", | |||
) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -45,6 +46,7 @@ def __init__(self, service_manager: ServiceManager = None) -> None: | |||
handlers.add_region_from_header, | |||
handlers.add_account_id, | |||
handlers.parse_service_request, | |||
# TODO: add logger that initializes a request "trace" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# TODO: add logger that initializes a request "trace" |
LocalStack Community integration with Pro 2 files ±0 2 suites ±0 1h 38m 49s ⏱️ + 2m 16s For more details on these failures, see this check. Results for commit f19f45c. ± Comparison against base commit 3c4c463. This pull request skips 2 tests.
|
@@ -95,6 +95,10 @@ def _log(self, context: RequestContext, response: Response): | |||
response.status_code, | |||
context.service_exception.code, | |||
extra={ | |||
"request_id": context.request_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request_id
propagation is gonna be crucial for proper grouping and is going to require quite some manual work within service-specific loggers. Other fields can then be inferred based on the request_id
because some other fields won't be available at different stages (e.g., service, region, and operation won't be available before parsing an HTTP request into an AWS request; response-related fields such as status code obviously won't be available before handling the request)
Motivation
We've had a few requests in the past for outputting our logs in a structured format. We've been experimenting in the past but would like to push forward with the idea now. This will be in an experimental stage for some time now and will mostly be used internally before going into public preview and ideally GA release with 4.0 🤞
Changes
What's left to do:
There will also be some follow ups such as: