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

Inconsistent Sampling Result Names #938

Merged
merged 3 commits into from
Sep 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions specification/trace/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ Returns the sampling Decision for a `Span` to be created.
It produces an output called `SamplingResult` which contains:

* A sampling `Decision`. One of the following enum values:
* `NOT_RECORD` - `IsRecording() == false`, span will not be recorded and all events and attributes
* `IGNORE` - `IsRecording() == false`, span will not be recorded and all events and attributes
Copy link
Member

Choose a reason for hiding this comment

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

Since the description says "will be dropped" here, maybe DROP would be an even better name. I'm fine with IGNORE or SKIP too though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I like DROP better.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for DROP. This is necessary for opentelemetry-cpp because IGNORE is defined as macro as constant. This build failure for details.

Copy link
Member

Choose a reason for hiding this comment

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

@ThomsonTan Then the main problem there seems to be that you have defined a macro constant 😃 And isn't the usual C++ idiom to only have macros/defines in ALL_CAPS? Then you would write SamplingResult::Drop or SamplingResult::drop or similar.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Oberon00 the problem is not defined by opentelemetry-cpp, as IGNORE is sounds like a common word, there is chance of name collision. Change casing in C++ sounds a good suggestion though.

will be dropped.
* `RECORD` - `IsRecording() == true`, but `Sampled` flag MUST NOT be set.
* `RECORD_AND_SAMPLED` - `IsRecording() == true` AND `Sampled` flag` MUST be set.
* `RECORD_ONLY` - `IsRecording() == true`, but `Sampled` flag MUST NOT be set.
* `RECORD_AND_SAMPLE` - `IsRecording() == true` AND `Sampled` flag` MUST be set.
* A set of span Attributes that will also be added to the `Span`. The returned
object must be immutable (multiple calls may return different immutable objects).

Expand All @@ -115,12 +115,12 @@ The default sampler is `ParentBased(root=AlwaysOn)`.

#### AlwaysOn

* Returns `RECORD_AND_SAMPLED` always.
* Returns `RECORD_AND_SAMPLE` always.
* Description MUST be `AlwaysOnSampler`.

#### AlwaysOff

* Returns `NOT_RECORD` always.
* Returns `IGNORE` always.
* Description MUST be `AlwaysOffSampler`.

#### TraceIdRatioBased
Expand Down