NH-85973 instrument function handler dependencies #141
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.
Description
From Jira discussion it seems possible to try loading the original handler file (causing all function dependencies to also be loaded), then load
solarwinds_apm
which will bootstrap instrumentations based on loaded libraries.This is a POC for how we might use the existing OTel Lambda Handler instrumentation's resolve_original_handler on initialization to achieve the loading.
Test (if applicable)
Quick test with this change and a function that requires the
aws-sdk-lambda
gem has this in CW log:I, [2024-07-24T23:09:51.172528 #15] INFO -- : Instrumentation: OpenTelemetry::Instrumentation::AwsSdk was successfully installed with the following options {:inject_messaging_context=>false, :suppress_internal_instrumentation=>false}
Unfortunately I'm still not getting the AWS SDK span, maybe due to span context issue that would be fixed by open-telemetry/opentelemetry-ruby-contrib#1073