Skip to content

Commit

Permalink
change class definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Zhang committed Jun 17, 2020
1 parent e65cf5c commit 7b20dc1
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions sdk/include/opentelemetry/sdk/trace/sampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Sampler
* @since 0.1.0
*/

virtual Decision shouldSample(
virtual SamplingResult ShouldSample(
trace_api::TraceId trace_id,
std::string name,
trace_api::SpanKind span_kind,
Expand All @@ -49,30 +49,29 @@ class Sampler
*
* @return the description of this {@code Sampler}.
*/
virtual std::string getDescription();
virtual std::string GetDescription() const noexcept = 0;
};

class Decision
class SamplingResult
{
public:
virtual ~Decision() = default;
// TODO: add Decision enum
virtual ~SamplingResult() = default;
/**
* Return sampling decision whether span should be sampled or not.
*
* @return sampling decision.
* @return TODO: Decision.
*/
virtual bool isSampled();
virtual bool GetDecision();

/**
* Return tags which will be attached to the span.
* Return attributes which will be attached to the span.
*
* @return attributes added to span. These attributes should be added to the span only for root
* span or when sampling decision isSampled() changes from false to true.
*/
virtual std::map<std::string, common::AttributeValue> getAttributes();
virtual std::map<std::string, common::AttributeValue> GetAttributes();
};

class
} // namespace trace
} // namespace sdk
OPENTELEMETRY_END_NAMESPACE

0 comments on commit 7b20dc1

Please sign in to comment.