Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📬 *Issue #, if available: #1192
✍️ Description of changes:
lambda-extensionfailed to deserialize Telemetry API records from functions running on Lambda Managed Instances. It also subscribed to the Telemetry API with a schema version that Managed Instances don't use. This PR fixes both.platform.reportmetrics (telemetry.rs)On Managed Instances,
platform.reportonly containsdurationMs.ReportMetricsrequiredbilledDurationMs,memorySizeMBandmaxMemoryUsedMB, so deserialization failed withmissing field `billedDurationMs`. Because records arrive in batches, that failure dropped the whole batch, including function log records.ReportMetricsis now an untagged enum:OnDemandis the first variant on purpose. Untagged deserialization tries variants in order, and an on-demand payload would also match the smaller Managed Instances shape. AReportMetrics::duration_ms()helper returns the one field both shapes share.initializationType(telemetry.rs)On Managed Instances, init records (
platform.initStart,platform.initRuntimeDone,platform.initReport) have"initializationType": "lambda-managed-instances". This PR addsInitType::LambdaManagedInstancesfor it. The enum's existingrename_all = "kebab-case"produces that string, so no explicit rename is needed.Telemetry API schema version (
requests.rs)The subscription request now sends
schemaVersion: "2025-01-29"when theAWS_LAMBDA_INITIALIZATION_TYPEenvironment variable islambda-managed-instances. Otherwise it still sends"2022-07-01", so on-demand, provisioned concurrency and SnapStart functions behave as before. The rustdoc forExtension::with_telemetry_processordescribes this.Breaking change
ReportMetricschanges from a struct to an enum. Code that reads its fields directly has to match on the variant first:Adding a variant to
InitType, which isn't#[non_exhaustive], is also a breaking change for exhaustivematches.Tests
platform.report(durationMs+ spans only) and forplatform.initStartwithlambda-managed-instances.platform.reporttests to the new enum. The JSON output is the same as before.These changes have not been tested against a real Managed Instances function.
🔏 By submitting this pull request
cargo +nightly fmt.cargo clippy --fix.🤖 Generated with Claude Code