Trace Options

class opencensus.trace.trace_options.TraceOptions(trace_options_byte=None)[source]

Bases: object

A class that represents global trace options.

Parameters

trace_options_byte (str) -- 1 byte bitmap for trace options.

get_enabled()[source]

Get the last bit from the trace options which is the enabled field.

Parameters

trace_options (byte) -- 1 byte field which indicates 8 trace options, currently only have the enabled option. 1 means enabled, 0 means not enabled.

Return type

bool

Returns

Enabled tracing or not.

set_enabled(enabled)[source]

Update the last bit of the trace options byte str.

Parameters

enabled (bool) -- Whether enable tracing in this span context or not.