Skip to content

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

Closed
@aidansteele

Description

@aidansteele

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.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationlogger

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions