Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dynamic Sampling] Head of trace #492

Merged
merged 6 commits into from Nov 30, 2022
Merged

[Dynamic Sampling] Head of trace #492

merged 6 commits into from Nov 30, 2022

Conversation

cleptric
Copy link
Member

@cleptric cleptric commented Nov 7, 2022

This adds support in case we're the head SDK that starts the trace for Dynamic Sampling.

  • Add DynamicSamplingContextFromTransaction
  • Add Span.Source
  • Set the correct sample rate on the Span

Populating the envelop header will be done in #491

Closes #457

@cleptric cleptric self-assigned this Nov 7, 2022
@cleptric cleptric changed the base branch from master to dynamic-sampling November 7, 2022 13:37
@cleptric cleptric added this to the Dynamic Sampling Context milestone Nov 7, 2022
Copy link
Contributor

@kamilogorek kamilogorek left a comment

Choose a reason for hiding this comment

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

Small nitpicks

@cleptric cleptric marked this pull request as ready for review November 30, 2022 11:41
dynamic_sampling_context.go Outdated Show resolved Hide resolved
dynamic_sampling_context.go Outdated Show resolved Hide resolved
tracing.go Outdated Show resolved Hide resolved
dynamic_sampling_context.go Show resolved Hide resolved
@@ -36,10 +37,57 @@ func NewDynamicSamplingContext(header []byte) (DynamicSamplingContext, error) {
}, nil
}

func DynamicSamplingContextFromTransaction(span *Span) (DynamicSamplingContext, error) {
Copy link
Member

Choose a reason for hiding this comment

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

m: Should this return an error?

Copy link
Member Author

Choose a reason for hiding this comment

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

http/sentryhttp.go Show resolved Hide resolved
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

:shipit:

@cleptric cleptric merged commit f219a81 into dynamic-sampling Nov 30, 2022
@cleptric cleptric deleted the head-of-trace branch November 30, 2022 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(tracing) Collect DSC for head of trace
3 participants