Skip to content

docs(metrics): document InvokeStore isolation and local testing#5486

Open
leiwilson wants to merge 4 commits into
aws-powertools:mainfrom
leiwilson:docs/metrics-lambda-invoke-store-behavior
Open

docs(metrics): document InvokeStore isolation and local testing#5486
leiwilson wants to merge 4 commits into
aws-powertools:mainfrom
leiwilson:docs/metrics-lambda-invoke-store-behavior

Conversation

@leiwilson

@leiwilson leiwilson commented Jul 20, 2026

Copy link
Copy Markdown

Summary

Documents how Metrics behaves in the Lambda environment versus locally, including automatic per-invocation isolation via @aws/lambda-invoke-store when Lambda multi-concurrency is enabled, and clarifies how to assert emitted EMF metrics in unit tests.

Fixes #5187.

Changes

  • docs/features/metrics.md: add "Lambda environment vs local" and retitle the existing spy example under "Asserting metrics in unit tests"

Test plan

  • Skim Metrics docs Testing section for accuracy vs MetricsStore / shouldUseInvokeStore
  • Confirm existing testing snippet still renders

Docs-only; no AWS credentials required.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@boring-cyborg

boring-cyborg Bot commented Jul 20, 2026

Copy link
Copy Markdown

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #typescript channel on our Powertools for AWS Lambda Discord: Invite link

Comment thread docs/features/metrics.md Outdated
@svozza

svozza commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Hi there, thanks for the contribution, can you add the acknowledgement section to the PR. You can see the wording in the GitHub template here: https://github.com/aws-powertools/powertools-lambda-typescript/blob/main/.github/PULL_REQUEST_TEMPLATE.md.

@leiwilson

Copy link
Copy Markdown
Author

Thanks. The acknowledgment is in the description and the Acknowledgment Check is passing.

@svozza

svozza commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Can you address this comment too: #5486 (comment). Just needs a slight wording change to make the text clearer.

@leiwilson

Copy link
Copy Markdown
Author

Thanks. Updated the wording so the in-memory store is described as the default on standard Lambda too, not only for local/tests.

Comment thread docs/features/metrics.md Outdated
@svozza

svozza commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

One final tweak to the wording and then we're good to merge @leiwilson.

Co-authored-by: Stefano Vozza <svozza@gmail.com>
@dreamorosi

Copy link
Copy Markdown
Contributor

@svozza I accepted your suggestion so you can approve.

@dreamorosi
dreamorosi requested a review from svozza July 23, 2026 15:47
@leiwilson

Copy link
Copy Markdown
Author

Thanks — confirmed the wording now says Lambda on-demand functions.

@svozza svozza changed the title docs(metrics): document InvokeStore isolation and local testing docs(metrics): document InvokeStore isolation and local testing Jul 23, 2026
@svozza svozza changed the title docs(metrics): document InvokeStore isolation and local testing docs(metrics): document InvokeStore isolation and local testing Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S PR between 10-29 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: Powertools Metrics behavior in Lambda environment

3 participants