chore(runway): cherry-pick fix(perps): missing trace attachment in sentry measurements#21182
Merged
Merged
Conversation
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
Collaborator
|
No release label on PR. Adding release label release-7.57.0 on PR, as PR was cherry-picked in branch 7.57.0. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
What is the reason for the change?
Previous implementation sent Sentry measurements using
setMeasurement()without attaching them to parent spans, causingSentry to drop measurements or attach them to incorrect spans.
What is the improvement/solution?
Fixes measurement attachment by passing the parent
traceSpanparameterto all
setMeasurement()calls.Changelog
CHANGELOG entry: fix missing span attachment to sentry measurements for
perps
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1824
Manual testing steps
Screenshots/Recordings
Before
setMeasurement()called without span parameterAfter
setMeasurement(name, duration, 'millisecond', traceSpan)- spanattached
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Attach Sentry measurements to parent spans and migrate Perps to a unified trace-based performance/analytics API across UI, controller, and services.
measurementNameusage withtraceNameacross Perps views/hooks; start/end traces and attachsetMeasurement(..., span)to parent spans.TraceName/TraceOperation; add many new Perps trace identifiers; refactorusePerpsMeasurementto trace-based API; update enums inperformanceMetrics(newPERPS_metrics).PerpsController):placeOrder,editOrder,cancelOrder,closePosition,updatePositionTPSL, data fetches, withdraw) with start/end traces; pass parent span tosetMeasurement; enrich error handling/logging; add data lake reporting trace with retries.sourcetogetAccountStateparams.usePerpsMeasurementAPI; remove legacy trace calls; minor UX logic unchanged.PerpsConnectionErrorView: add MetaMetrics tracking for view and retry.eventNameswith new properties/values (e.g.,SCREEN_NAME,ACTION, retry fields).Written by Cursor Bugbot for commit 7744fd6. This will update automatically on new commits. Configure here.
Co-authored-by: Claude noreply@anthropic.com 20ecfb5