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

Update Samplers to conform to Spec #531

Merged
merged 9 commits into from
Mar 10, 2020
Merged

Conversation

Aneurysm9
Copy link
Member

@Aneurysm9 Aneurysm9 commented Mar 9, 2020

Fixes #519.

* Sampler is now an interface rather than a function type
* SamplingParameters include the span Kind, Attributes, and Links
* SamplingResult includes a SamplingDecision with three possible values, as well as Attributes
api/trace/sampler.go Outdated Show resolved Hide resolved
sdk/trace/sampling.go Show resolved Hide resolved
sdk/trace/sampling.go Outdated Show resolved Hide resolved
sdk/trace/sampling.go Outdated Show resolved Hide resolved
sdk/trace/sampling.go Outdated Show resolved Hide resolved
sdk/trace/sampling.go Outdated Show resolved Hide resolved
sdk/trace/sampling.go Outdated Show resolved Hide resolved
sdk/trace/sampling_test.go Outdated Show resolved Hide resolved
sdk/trace/sampling_test.go Outdated Show resolved Hide resolved
@Aneurysm9
Copy link
Member Author

@jmacd and @krnowak thanks for the feedback. I've addressed the requested changes.

@jmacd jmacd merged commit 7a1cbbc into open-telemetry:master Mar 10, 2020
@Aneurysm9 Aneurysm9 deleted the OTG-519 branch March 10, 2020 16:35
MikeGoldsmith pushed a commit to MikeGoldsmith/opentelemetry-go that referenced this pull request Mar 13, 2020
* Refactor SDK Sampler API to conform to Spec

* Sampler is now an interface rather than a function type
* SamplingParameters include the span Kind, Attributes, and Links
* SamplingResult includes a SamplingDecision with three possible values, as well as Attributes

* Add attributes retruned from a Sampler to the span

* Add SpanKind, Attributes, and Links to API Sampler.ShouldSample() parameters

* Drop "Get" from sdk Sampler.GetDescription to match api Sampler

* Make spanID parameter in API Sampler interface a core.SpanID

* Fix types and printf format per PR feedback from krnowak

* Ensure unit test error messages reflect new reality

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
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.

Sampler API must accept Attributes and Links and return Attributes
3 participants