[SLES-2877] fix(traces): try to pair universal instrumentation on request id for on-demand#1250
Open
shreyamalpani wants to merge 1 commit into
Open
[SLES-2877] fix(traces): try to pair universal instrumentation on request id for on-demand#1250shreyamalpani wants to merge 1 commit into
shreyamalpani wants to merge 1 commit into
Conversation
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the invocation lifecycle pairing logic so that when the tracer provides the lambda-runtime-aws-request-id header, UniversalInstrumentationStart / UniversalInstrumentationEnd are paired to the correct invocation using the request ID (instead of FIFO). This extends request-id pairing to On-Demand mode (in addition to Managed Instance mode) while keeping FIFO as a fallback for On-Demand when the header is absent.
Changes:
- In
on_invoke_event, try to consume a bufferedUniversalInstrumentationStartbyrequest_idbefore using On-Demand FIFO fallback. - In
on_platform_runtime_done, try to consume a bufferedUniversalInstrumentationEndbyrequest_idbefore using On-Demand FIFO fallback. - In
on_universal_instrumentation_start/on_universal_instrumentation_end, use request-id-based pairing whenever the tracer supplies arequest_id, and retain FIFO fallback behavior when it does not (with warnings in Managed Instance mode).
Comment on lines
+222
to
+227
| // Both modes: check for buffered UniversalInstrumentationStart by request_id first. | ||
| // Falls back to FIFO for on-demand when the tracer does not send the header. | ||
| if let Some(buffered_event) = self | ||
| .context_buffer | ||
| .take_universal_instrumentation_start_for_request_id(&request_id) | ||
| { |
Contributor
|
Is there a fallback since old revisions of the SDK doesn't send the |
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.
Overview
When the tracer sends the
lambda-runtime-aws-request-idheader (in the start-invocation and end-invocation requests), use request ID based pairing instead of FIFO for bothUniversalInstrumentationStartandUniversalInstrumentationEndin On Demand mode in addition to Managed Instance mode. FIFO pairing is preserved as a fallback for tracers that do not send the header.Motivation: SLES-2877