Skip to content
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

Add Lambda request id #39

Open
benkehoe opened this issue Jun 13, 2020 · 3 comments
Open

Add Lambda request id #39

benkehoe opened this issue Jun 13, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@benkehoe
Copy link
Contributor

The aws_request_id field from the context object should get added to the default set of properties. https://docs.aws.amazon.com/lambda/latest/dg/python-context.html

@jaredcnance
Copy link
Member

jaredcnance commented Jun 16, 2020

The library doesn’t have access to the context object currently. Are you asking for a method on the logger that would allow you to add the context? Or are you wanting a lambda_metric_scope that wraps your handler and adds the request id automatically for you?

I’m not sure how much auto-magic we want to add just to eliminate a single call to set_property.

@jaredcnance jaredcnance added the question Further information is requested label Jun 16, 2020
@benkehoe
Copy link
Contributor Author

I mean, in an ideal world the Lambda Python runtime would put the request id in the environment variables, since we're already using that to populate the context.

I guess it could be a separate lambda_metric_scope decorator, though it seems like in metric_scope if the environment says it's type AWS::Lambda::Function then you'd know to find the context in the arguments.

@jaredcnance jaredcnance added enhancement New feature or request and removed question Further information is requested labels Jun 18, 2020
@jaredcnance
Copy link
Member

Makes sense. I think it should be pretty straightforward to scrape the input arguments for the request id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants