Exporter - File Exporter

Export the trace spans to a local file.

class opencensus.trace.file_exporter.FileExporter(file_name='opencensus-traces.json', transport=<class 'opencensus.common.transports.sync.SyncTransport'>, file_mode='w+')[source]

Bases: opencensus.trace.base_exporter.Exporter

Parameters
  • file_name (str) -- The name of the output file.

  • transport (type) -- Class for creating new transport objects. It should extend from the base_exporter Transport type and implement Transport.export(). Defaults to SyncTransport. The other option is AsyncTransport.

  • file_mode (str) -- The file mode to open the output file with. Defaults to w+

emit(span_datas)[source]
Parameters

of opencensus.trace.span_data.SpanData span_datas (list) -- SpanData tuples to emit

export(span_datas)[source]
Parameters

of opencensus.trace.span_data.SpanData span_datas (list) -- SpanData tuples to export