draft: measure e2e latency for amazon q requests #5566
Draft
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.
Problem
This is just a draft of what we could potentially do to measure e2e latency in amazon q chat message requests. Feel free to leave comments on the PR. This isn't trying to directly get to a solution, its trying to figure what works and what doesn't.
Solution
Since amazon q chat is fire and forget, this solution manually instruments all the checkpoints that happen in the code through a trace id. This trace id lets us know which message we are currently handling throughout the execution flow.
In the future I'd like to get to a point where we don't need to do as much manual work. I still think we can automate listening for incoming events (like the dropdown details show) but it needs a bit more thought
Previous PR description
Problem
This is just a draft of what we could potentially do to measure e2e latency in amazon q chat message requests. Feel free to leave comments on the PR
Main code level problems:
Solution
This PR does a couple things:
Sample event when sending a request in amazon q chat:
You can also get events from the right click context menu items as well (explain, refactor, etc)
License: I confirm that my contribution is made under the terms of the Apache 2.0 license.