Skip to content

Docs: injected Lambda context keys do not match documentation #1828

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

Closed
1 task done
aidansteele opened this issue Jan 11, 2023 · 5 comments · Fixed by #1830
Closed
1 task done

Docs: injected Lambda context keys do not match documentation #1828

aidansteele opened this issue Jan 11, 2023 · 5 comments · Fixed by #1830
Assignees
Labels
documentation Improvements or additions to documentation logger

Comments

@aidansteele
Copy link
Contributor

What were you searching in the docs?

The inject_lambda_context_output.json example says the following keys should be emitted:

{
  "cold_start": true,
  "lambda_function_name": "test",
  "lambda_function_memory_size": 128,
  "lambda_function_arn": "arn:aws:lambda:eu-west-1:12345678910:function:test",
  "lambda_request_id": "52fdfc07-2182-154f-163f-5f0f9a621d72"
}

The actual keys (as of version 2.5.0, layer version 17) that get emitted are:

{
  "cold_start": true,
  "function_name": "test",
  "function_memory_size": 128,
  "function_arn": "arn:aws:lambda:eu-west-1:12345678910:function:test",
  "function_request_id": "52fdfc07-2182-154f-163f-5f0f9a621d72"
}

Specifically: the lambda_ prefix is dropped from lambda_function_name, lambda_function_memory_size, lambda_function_arn and the lambda_request_id is renamed to function_request_id.

Is this related to an existing documentation section?

https://awslabs.github.io/aws-lambda-powertools-python/2.5.0/core/logger/#capturing-lambda-context-info

How can we improve?

The examples should match the output generated by the library.

Got a suggestion in mind?

It's not clear if this is a bug in the docs or the code. This GitHub search results page shows where the incorrect keys appear in the docs - I suspect it's easier to fix the docs? But I'll defer to the maintainer's judgment.

Acknowledgment

  • I understand the final update might be different from my proposed suggestion, or refused.
@aidansteele aidansteele added documentation Improvements or additions to documentation triage Pending triage from maintainers labels Jan 11, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 11, 2023

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our AWS Lambda Powertools Discord: Invite link

@rubenfonseca
Copy link
Contributor

Hi @aidansteele thank you so much for catching this! The documentation is wrong, I can see that the keys never had the lambda_ prefix. Do you want to submit a PR to fix the documentation?

@rubenfonseca rubenfonseca self-assigned this Jan 11, 2023
@rubenfonseca rubenfonseca added logger and removed triage Pending triage from maintainers labels Jan 11, 2023
@aidansteele
Copy link
Contributor Author

@rubenfonseca thanks for confirming. Sure, I'll submit a PR ASAP 👍

@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@rubenfonseca rubenfonseca added the pending-release Fix or implementation already in dev waiting to be released label Jan 12, 2023
@rubenfonseca rubenfonseca reopened this Jan 12, 2023
@github-actions
Copy link
Contributor

This is now released under 2.6.0 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation logger
Projects
None yet
2 participants