Skip to content

Commit 5a0e1b4

Browse files
authored
Add TraceOptions (open-telemetry#60)
* TraceOptions * export TRACE_OPTIONS_SAMPLED and TRACE_OPTIONS_UNSAMPLED * Fix review comments * Rename TRACE_OPTIONS_SAMPLED -> SAMPLED * Add SampleOptions enum * Add TraceOptions as enum
1 parent 7b629d6 commit 5a0e1b4

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/opentelemetry-types/src/trace/span_context.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ export interface SpanContext {
3939
* Trace options to propagate.
4040
*
4141
* It is represented as 1 byte (bitmap). Bit to represent whether trace is
42-
* sampled or not.
43-
* SAMPLED_VALUE = 0x1 and NOT_SAMPLED_VALUE = 0x0;
42+
* sampled or not. When set, the least significant bit documents that the
43+
* caller may have recorded trace data. A caller who does not record trace
44+
* data out-of-band leaves this flag unset.
45+
*
46+
* SAMPLED = 0x1 and UNSAMPLED = 0x0;
4447
*/
4548
traceOptions?: TraceOptions;
4649
/**

packages/opentelemetry-types/src/trace/trace_options.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
export interface TraceOptions {
18-
// TODO
17+
export enum TraceOptions {
18+
/** Bit to represent whether trace is unsampled in trace options. */
19+
UNSAMPLED = 0x0,
20+
/** Bit to represent whether trace is sampled in trace options. */
21+
SAMPLED = 0x1,
1922
}

0 commit comments

Comments
 (0)