Skip to content

TrpcMiddleware support for forceTransaction in span creation #15505

@leoambio

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions