Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

file_exporter can't append  #113

@cjd9023

Description

@cjd9023

from opencensus.trace.exporters import file_exporter
from opencensus.trace.tracer import context_tracer (not tracers)

exporter = file_exporter.FileExporter(file_name='/tmp/traces')
tracer = context_tracer.ContextTracer(exporter=exporter)

lib/python2.7/site-packages/opencensus/trace/exporters/file_exporter.py

   with open(self.file_name, 'w+') as file:
        trace_str = json.dumps(trace)
        file.write(trace_str)

i change to :

    with open(self.file_name, 'a+') as file:
        trace_str = json.dumps(trace)
        file.write(trace_str)
        file.write('\n')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions