Skip to content

Convert segment spans to transactions #3278

@jjbayer

Description

@jjbayer

The current state of Performance is that

  1. There are SDKs that emit transactions, and there are SDKs that emit standalone spans.
  2. There are parts of the product that require transactions, and there are parts of the product that require spans.

We already extract spans from transactions to make span-dependent product features work for "transaction"-SDKs. Now we need to also extract transactions from spans to make transaction-dependent product features work for "span"-SDKs:

flowchart LR
    
    SDK -->|transaction| Relay
    SDK -->|span| Relay
    Relay -->|transaction| txc[Transaction Consumer] 
    Relay -->|span| spc[Span Consumer]
    Relay -->|span from transaction| spc
    Relay -->|transaction from span| txc
    
    linkStyle 5 color:green;
Loading
  • In order to prevent cycles, every envelope item should be marked with span_extracted and transaction_extracted headers.
  • While span extraction from transactions happens as late as possible, to make sure that all dynamic sampling, rate limiting etc. was already applied before duplicating the spans, it might be good to extract transactions from spans as early as possible. The transaction processing pipeline is more mature than the span processing pipeline, so early extraction should give us a more stable result. On the other hand, we might want to limit extraction to processing Relays, just to make sure we can iterate on it fast.
### Tasks
- [ ] https://github.com/getsentry/relay/pull/3469
- [x] Test with a single production project

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions