Skip to content

Commit 0cf21ac

Browse files
jahtalabBogdan Drutu
authored andcommitted
minor fixes in the sampling RFC (open-telemetry#50)
* minor fixes in the sampling RFC * address review comments Co-authored-by: Bogdan Drutu <bdrutu@google.com>
1 parent f308663 commit 0cf21ac

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

0006-sampling.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ Examples: HBase, Envoy developers.
7979
OpenTelemetry SDKTracer, and OpenTelemetry wire format exporter.
8080
* They may have their own recommendations for sampling rates, but don't run the binaries in
8181
production, only provide packaged binaries. So their sampling rate configs, and sampling strategies
82-
need to a finite "built in" set from OpenTelemetry's SDK.
83-
* They need to deal with upstream sampling decisions made by services calling them.
82+
need to be a finite "built in" set from OpenTelemetry's SDK.
83+
* They need to deal with upstream sampling decisions made by services that call them.
8484

8585
**Solution:**
8686
* Allow different sampling strategies by default in OpenTelemetry SDK, all configurable easily via
@@ -138,12 +138,12 @@ or the cost to store all the Spans may be too high. In order to support this use
138138
ensure the quality of the data we send, OpenTelemetry needs to natively support sampling with some
139139
requirements:
140140
* Send as many complete traces as possible. Sending just a subset of the spans from a trace is
141-
less useful because in this case the interaction between the spans may miss.
141+
less useful because in this case the interaction between the spans may be missing.
142142
* Allow application operator to configure the sampling frequency.
143143

144-
For new modern systems that need to collect all the Spans and later may or may not do a deferred
144+
For new modern systems that need to collect all the Spans and later may or may not make a deferred
145145
sampling decision, OpenTelemetry needs to natively support a way to configure the library to
146-
collect and export all the Spans. This is possible even though OpenTelemetry supports sampling by
146+
collect and export all the Spans. This is possible (even though OpenTelemetry supports sampling) by
147147
setting a default config to always collect all the spans.
148148

149149
### Sampling flags
@@ -174,11 +174,11 @@ instrumenting code and never access `SampledFlag` unless used in context propaga
174174
This is a new concept added in the OpenTelemetry API that allows to suggest sampling hints to the
175175
implementation of the API:
176176
* `NOT_RECORD`
177-
* Suggest to not `RecordEvents = false` and not propagate `SampledFlag = false`.
177+
* Suggest to not set (`RecordEvents = false`) and not propagate (`SampledFlag = false`).
178178
* `RECORD`
179-
* Suggest `RecordEvents = true` and `SampledFlag = false`.
179+
* Suggest to set (`RecordEvents = true`) but not propagate (`SampledFlag = false`).
180180
* `RECORD_AND_PROPAGATE`
181-
* Suggest to `RecordEvents = true` and propagate `SampledFlag = true`.
181+
* Suggest to set (`RecordEvents = true`) and propagate (`SampledFlag = true`).
182182

183183
The default option for the span creation is to not have any suggestion (or suggestion is not
184184
specified). This can be implemented by using `null` as the default option or any language specific
@@ -195,7 +195,7 @@ The interface for the Sampler class that is available only in the OpenTelemetry
195195
* `SpanKind`
196196
* Initial set of `Attributes` for the `Span` being constructed
197197

198-
It produces as an output called `SamplingResult`:
198+
It produces an output called `SamplingResult` that includes:
199199
* A `SamplingDecision` enum [`NOT_RECORD`, `RECORD`, `RECORD_AND_PROPAGATE`].
200200
* A set of span Attributes that will also be added to the `Span`.
201201
* These attributes will be added after the initial set of `Attributes`.
@@ -263,7 +263,7 @@ There are two important use-cases to be considered:
263263
* Some information that may be used for sampling decision are NOT available at the moment when the
264264
logical `Span` operation should start (e.g. `http.route` may be determine later).
265265

266-
The current [span creation logic][span-creation] facilitates very well the first use-case, but
266+
The current [span creation logic][span-creation] facilitates the first use-case very well, but
267267
the second use-case requires users to record the logical `start_time` and collect all the
268268
information necessarily to start the `Span` in custom objects, then when all the properties are
269269
available call the span creation API.

0 commit comments

Comments
 (0)