Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add telemetry for Lambda Managed Instances#13466

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
joe4dev merged 3 commits intomainfromlmi/add-telemetry
Dec 9, 2025
Merged

Conversation

@joe4dev
Copy link
Member

@joe4devjoe4dev commentedDec 4, 2025
edited
Loading

Motivation

We're currently missing runtime telemetry for Lambda Managed Instances (LMI) to track errors and usage of the feature beyond the control plane API.

Changes

  • Add instrumentation for LMI throughinitialization_type. This maps to an AWS-defined property and is more extensible than a simple boolean flaguses_capacity_provider.
  • Fix a double-counting error for successful async-invokes
  • Refactor the event manager to reduce duplication around metadata

Limitations

  • provisioned-concurrency is currently not taken into account because it is not easily accessible in the context (might require enriching the invocation result)
  • The current telemetry instrumentation seems too complex, as I would prefer a single instrumentation inlambda.Invoke. However, this would require some refactorings and API enrichment (e.g., passing ESM metadata throughlambda.Invoke via custom fields or headers)

Tests

The following tests can be used to validate that the metrics work as expected:

  • [localstack-pro]tests.aws.services.lambda_.test_lambda_managed_instances.TestLambdaManagedInstances.test_lifecycle should generate acreate andinvoke event with the newinitialization_type=lambda-managed-instances.
  • [localstack]aws.services.lambda_.test_lambda.TestLambdaFeatures.test_invocation_type_event should generate acreate andinvoke event with theinitialization_type=on-demand and theinvocation_type=event for each execution (node & python). Validate that theinvoke event is not recorded twice.

Related

Part of DRG-36

vittoriopolverino reacted with eyes emoji
@joe4devjoe4dev added this to the4.12 milestoneDec 4, 2025
@joe4devjoe4dev self-assigned thisDec 4, 2025
@joe4devjoe4dev added semver: patchNon-breaking changes which can be included in patch releases docs: skipPull request does not require documentation changes notes: skipPull request does not have to be mentioned in the release notes labelsDec 4, 2025
try:
invocation_result=self.version_manager.invoke(invocation=invocation)
function_config=self.version_manager.function_version.config
function_counter.labels(
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Given the counter in thefinally clause, this counter seems to produce double counting 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Great catch! I agree about your thoughts in the PR description - we should have a single point for the telemetry, instead of having it split up - this would have already prevented this double counting.

joe4dev reacted with thumbs up emoji
@github-actions
Copy link

github-actionsbot commentedDec 4, 2025
edited
Loading

Test Results - Preflight, Unit

22 889 tests  ±0   21 075 ✅ ±0   6m 38s ⏱️ +15s
     1 suites ±0    1 814 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit44105d8. ± Comparison against base commitb8e33ce.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actionsbot commentedDec 4, 2025
edited
Loading

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   2m 56s ⏱️ -6s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit44105d8. ± Comparison against base commitb8e33ce.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actionsbot commentedDec 4, 2025
edited
Loading

Test Results (amd64) - Integration, Bootstrap

    5 files      5 suites   2h 32m 25s ⏱️
5 507 tests 4 952 ✅ 555 💤 0 ❌
5 513 runs  4 952 ✅ 561 💤 0 ❌

Results for commit44105d8.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actionsbot commentedDec 4, 2025
edited
Loading

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 54m 53s ⏱️ -33s
5 127 tests +6  4 732 ✅ +3  395 💤 +3  0 ❌ ±0 
5 129 runs  +6  4 732 ✅ +3  397 💤 +3  0 ❌ ±0 

Results for commit44105d8. ± Comparison against base commitb8e33ce.

♻️ This comment has been updated with latest results.

@joe4devjoe4dev marked this pull request as ready for reviewDecember 5, 2025 13:30
Copy link
Member

@dfangldfangl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM in principal, but I believe there are some errors in how we construct the telemetry labels now, which we should fix before merging!

try:
invocation_result=self.version_manager.invoke(invocation=invocation)
function_config=self.version_manager.function_version.config
function_counter.labels(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Great catch! I agree about your thoughts in the PR description - we should have a single point for the telemetry, instead of having it split up - this would have already prevented this double counting.

joe4dev reacted with thumbs up emoji
@joe4devjoe4dev requested a review fromdfanglDecember 5, 2025 16:16
Copy link
Member

@dfangldfangl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for addressing those comments!

Copy link
Member

@vittoriopolverinovittoriopolverino left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

praise: thank you for taking the time to thoroughly consider the metric design and for suggestinginitialization_type instead of the flag. It significantly improves clarity 🚀

note: the schema bump shouldn't cause any major difficulties when querying the raw data because we've only added a new attribute. For historical data (before versionv4.12.0), you will simply see empty values for theinitialization_type attribute.

note: thelambda.function metric counter has now hit its soft limit of6 labels.

note: I have already updated the metrics dictionary ✅

joe4dev reacted with thumbs up emoji
@joe4devjoe4dev merged commit1224e92 intomainDec 9, 2025
44 checks passed
@joe4devjoe4dev deleted the lmi/add-telemetry branchDecember 9, 2025 16:34
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vittoriopolverinovittoriopolverinovittoriopolverino approved these changes

@dfangldfangldfangl approved these changes

@dominikschubertdominikschubertAwaiting requested review from dominikschubertdominikschubert is a code owner

@gregfurmangregfurmanAwaiting requested review from gregfurmangregfurman is a code owner

Assignees

@joe4devjoe4dev

Labels

docs: skipPull request does not require documentation changesnotes: skipPull request does not have to be mentioned in the release notessemver: patchNon-breaking changes which can be included in patch releases

Projects

None yet

Milestone

4.12

Development

Successfully merging this pull request may close these issues.

4 participants

@joe4dev@vittoriopolverino@dfangl

[8]ページ先頭

©2009-2025 Movatter.jp