Skip to content

Tracing without performance#2084

Merged
sl0thentr0py merged 13 commits intomasterfrom
neel/twp
Sep 1, 2023
Merged

Tracing without performance#2084
sl0thentr0py merged 13 commits intomasterfrom
neel/twp

Conversation

@sl0thentr0py
Copy link
Copy Markdown
Member

@sl0thentr0py sl0thentr0py commented Aug 2, 2023

This PR is 1/2 to enable Tracing without Performance, i.e. make sure all our events are connected even if they are not Transactions.

This enables use cases such as Errors / Transactions / Replays etc all being connected across services and not just Transactions.

Summary of changes

  • new PropagationContext class that generates trace/span ids and baggage irrespective of whether there are transactions/spans active or not
  • this lives on the Scope
  • three new top level methods that first check the span and fallback on the scope's propagation context
    • Sentry.get_traceparent
    • Sentry.get_baggage
    • Sentry.get_trace_propagation_headers
  • move dynamic_sampling_context to Event from TransactionEvent since all events will now have this info
  • use the new top level helpers in net/http patch to set propagation headers

closes #2056
also see #2089

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 2, 2023

@sl0thentr0py
Copy link
Copy Markdown
Member Author

@st0012 still gonna write some specs and test but feel free to start reviewing if you have time and let me know if you have questions on why we are doing this!

# @param sentry_trace [String] the sentry-trace header value from the previous transaction.
# @return [Array, nil]
def self.extract_sentry_trace(sentry_trace)
match = SENTRY_TRACE_REGEXP.match(sentry_trace)

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data

This [regular expression](1) that depends on a [library input](2) may run slow on strings with many repetitions of '\t'. This [regular expression](1) that depends on a [library input](3) may run slow on strings with many repetitions of '\t'. This [regular expression](1) that depends on a [library input](4) may run slow on strings with many repetitions of '\t'.
@sl0thentr0py sl0thentr0py merged commit 9641957 into master Sep 1, 2023
@sl0thentr0py sl0thentr0py deleted the neel/twp branch September 1, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracing without Performance

5 participants