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

Remove SpanId from Sampler parameters #269

Closed
fbogsany opened this issue Jun 2, 2020 · 0 comments · Fixed by #270
Closed

Remove SpanId from Sampler parameters #269

fbogsany opened this issue Jun 2, 2020 · 0 comments · Fixed by #270
Assignees
Milestone

Comments

@fbogsany
Copy link
Contributor

fbogsany commented Jun 2, 2020

open-telemetry/opentelemetry-specification#621

# Custom samplers can be provided by SDK users. The required interface is
# a callable with the signature:
#
# (trace_id:, span_id:, parent_context:, links:, name:, kind:, attributes:) -> Result
#
# Where:
#
# @param [String] trace_id The trace_id of the {Span} to be created.
# @param [String] span_id The span_id of the {Span} to be created.

And

# Returns a {Result} with {Decision::RECORD_AND_SAMPLED}.
ALWAYS_ON = ->(trace_id:, span_id:, parent_context:, links:, name:, kind:, attributes:) { RECORD_AND_SAMPLED }
# Returns a {Result} with {Decision::NOT_RECORD}.
ALWAYS_OFF = ->(trace_id:, span_id:, parent_context:, links:, name:, kind:, attributes:) { NOT_RECORD }
# Returns a {Result} with {Decision::RECORD_AND_SAMPLED} if the parent
# context is sampled or {Decision::NOT_RECORD} otherwise, or if there
# is no parent context.
# rubocop:disable Style/Lambda
ALWAYS_PARENT = ->(trace_id:, span_id:, parent_context:, links:, name:, kind:, attributes:) do
if parent_context&.trace_flags&.sampled?
RECORD_AND_SAMPLED
else
NOT_RECORD
end
end

And

def call(trace_id:, span_id:, parent_context:, links:, name:, kind:, attributes:)

@fbogsany fbogsany self-assigned this Jun 4, 2020
@mwear mwear added this to the Alpha v0.5 milestone Jun 4, 2020
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 a pull request may close this issue.

2 participants