Skip to content

chore(runway): cherry-pick fix(perps): missing trace attachment in sentry measurements#21182

Merged
Cal-L merged 1 commit into
release/7.57.0from
cherry-pick-7-57-0-20ecfb5
Oct 15, 2025
Merged

chore(runway): cherry-pick fix(perps): missing trace attachment in sentry measurements#21182
Cal-L merged 1 commit into
release/7.57.0from
cherry-pick-7-57-0-20ecfb5

Conversation

@runway-github

@runway-github runway-github Bot commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

Description

What is the reason for the change?

Previous implementation sent Sentry measurements using
setMeasurement() without attaching them to parent spans, causing
Sentry to drop measurements or attach them to incorrect spans.

What is the improvement/solution?

Fixes measurement attachment by passing the parent traceSpan parameter
to 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

Feature: Sentry Measurement Attachment

  Scenario: Verify measurements attach to correct spans
    Given user places an order
    When Sentry trace is created
    Then measurements should attach to correct parent span

Screenshots/Recordings

Before

  • setMeasurement() called without span parameter
  • Measurements dropped or attached to wrong spans

After

  • setMeasurement(name, duration, 'millisecond', traceSpan) - span
    attached
  • Measurements reliably appear under correct traces
    image

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    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.

  • Performance/Tracing:
    • Replace measurementName usage with traceName across Perps views/hooks; start/end traces and attach setMeasurement(..., span) to parent spans.
    • Expand TraceName/TraceOperation; add many new Perps trace identifiers; refactor usePerpsMeasurement to trace-based API; update enums in performanceMetrics (new PERPS_ metrics).
  • Controller (PerpsController):
    • Wrap operations (placeOrder, editOrder, cancelOrder, closePosition, updatePositionTPSL, data fetches, withdraw) with start/end traces; pass parent span to setMeasurement; enrich error handling/logging; add data lake reporting trace with retries.
    • Add optional source to getAccountState params.
  • Services/Streams:
    • Add first-data traces for WebSocket channels; attach measurements to spans; improve prewarm/clear lifecycle; connection manager now traces connection stages and attaches measurements.
  • UI:
    • Update Perps views (Market List/Details, Order, Close, Tab, Transactions, Withdraw) to new usePerpsMeasurement API; remove legacy trace calls; minor UX logic unchanged.
    • PerpsConnectionErrorView: add MetaMetrics tracking for view and retry.
  • Analytics:
    • Extend eventNames with new properties/values (e.g., SCREEN_NAME, ACTION, retry fields).
  • Tests/Docs:
    • Update unit tests to new trace API expectations; add Sentry/MetaMetrics reference docs.

Written by Cursor Bugbot for commit 7744fd6. This will update automatically on new commits. Configure here.


Co-authored-by: Claude noreply@anthropic.com 20ecfb5

@runway-github runway-github Bot requested a review from a team as a code owner October 15, 2025 08:36
@github-actions

Copy link
Copy Markdown
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.

@metamaskbot metamaskbot added the team-runway-bot-deprecated DEPRECATED: please use "team-bots" instead label Oct 15, 2025
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
56.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@Cal-L Cal-L added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Oct 15, 2025

@Cal-L Cal-L left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cal-L Cal-L merged commit cc377cf into release/7.57.0 Oct 15, 2025
160 of 168 checks passed
@Cal-L Cal-L deleted the cherry-pick-7-57-0-20ecfb5 branch October 15, 2025 16:16
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 15, 2025
@metamaskbot metamaskbot added the release-7.57.0 Issue or pull request that will be included in release 7.57.0 label Oct 15, 2025
@metamaskbot

Copy link
Copy Markdown
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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.57.0 Issue or pull request that will be included in release 7.57.0 size-XL skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-runway-bot-deprecated DEPRECATED: please use "team-bots" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants