feat: add support for running on AWS Lambda managed instance types #2083
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.
Adds support for running on AWS Lambda managed instances.
Lambda managed instances differ from standard lambda functions in several areas, but the differences most relevant for the OpenTelemetry collector layer are:
Invokeevent type.platform.runtimeDoneeventsdecoupleprocessor)For more information see: https://docs.aws.amazon.com/lambda/latest/dg/lambda-managed-instances.html
In order to accommodate the changes above, the following changes have been made to the layer if the extension determines the initialization type is
lambda-managed-instancesusing theAWS_LAMBDA_INITIALIZATION_TYPEenvironment variable:Invokeevent type, and the extension no longer subscribes to the telemetry API to listen for theplatform.runtimeDoneevent if the initialization type islambda-managed-instancesdecoupleprocessor is no longer added to any pipelines.FunctionInvoked()andFunctionFinished()lifecycle methods are no longer invoked for lifecycle listeners.I have added relevant unit tests and have manually verified the implementation using the following repo: https://github.com/herin049/aws-lambda-managed which configures the layer to export signals to Grafana cloud.