Skip to content

TrpcMiddleware support for forceTransaction in span creation #15505

Closed

Description

@leoambio

Problem Statement

Currently, when using the trpc middleware from packages/core/src/trpc.ts, a span is created using startSpanManual.

I'd like to force this span creation to create a transaction and this could be done by adding the forceTransaction: true. However, currently, the only options to pass into the middleware SentryTrpcMiddlewareOptions is attachRpcInput?: boolean.

Solution Brainstorm

We could add forceTransaction?: boolean to SentryTrpcMiddlewareOptions and then pass it to startSpanManual as an argument if it is truthy.

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Feb 26, 2025
  2. chargome commented on Feb 26, 2025

    @chargome
    Member

    Hey @leoambio thanks for reaching out! Yes that sounds reasonable, would you maybe be up for contributing this change? No worries if not, I'll put it on my list otherwise!

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Feb 26, 2025
  4. leoambio commented on Feb 26, 2025

    @leoambio
    ContributorAuthor

    Hey @chargome! Sounds good, I think I can make a PR later this week.

  5. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Feb 26, 2025
  6. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Feb 26, 2025
  7. leoambio commented on Feb 27, 2025

    @leoambio
    ContributorAuthor

    @chargome thanks for helping with the PR! 🚀 when can i expect this feature to be released?

  8. chargome commented on Feb 27, 2025

    @chargome
    Member

    We'll likely release today, you'll get notified in this issue once you can upgrade!

  9. github-actions commented on Feb 28, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #15519, which was included in the 9.3.0 release.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions