Skip to content

Commit

Permalink
Add TraceOptions (open-telemetry#60)
Browse files Browse the repository at this point in the history
* TraceOptions

* export TRACE_OPTIONS_SAMPLED and TRACE_OPTIONS_UNSAMPLED

* Fix review comments

* Rename TRACE_OPTIONS_SAMPLED -> SAMPLED

* Add SampleOptions enum

* Add TraceOptions as enum
  • Loading branch information
mayurkale22 authored Jul 2, 2019
1 parent 7b629d6 commit 5a0e1b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/opentelemetry-types/src/trace/span_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ export interface SpanContext {
* Trace options to propagate.
*
* It is represented as 1 byte (bitmap). Bit to represent whether trace is
* sampled or not.
* SAMPLED_VALUE = 0x1 and NOT_SAMPLED_VALUE = 0x0;
* sampled or not. When set, the least significant bit documents that the
* caller may have recorded trace data. A caller who does not record trace
* data out-of-band leaves this flag unset.
*
* SAMPLED = 0x1 and UNSAMPLED = 0x0;
*/
traceOptions?: TraceOptions;
/**
Expand Down
7 changes: 5 additions & 2 deletions packages/opentelemetry-types/src/trace/trace_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* limitations under the License.
*/

export interface TraceOptions {
// TODO
export enum TraceOptions {
/** Bit to represent whether trace is unsampled in trace options. */
UNSAMPLED = 0x0,
/** Bit to represent whether trace is sampled in trace options. */
SAMPLED = 0x1,
}

0 comments on commit 5a0e1b4

Please sign in to comment.