LogExporter exports metrics and span to log file
type LogExporter struct {
// contains filtered or unexported fields
}
func NewLogExporter(options Options) (*LogExporter, error)
NewLogExporter creates new log exporter.
func (e *LogExporter) Close()
Close closes any files that were opened for logging.
func (e *LogExporter) ExportMetrics(ctx context.Context, metrics []*metricdata.Metric) error
ExportMetrics exports to log.
func (e *LogExporter) ExportSpan(sd *trace.SpanData)
ExportSpan exports a SpanData to log
func (e *LogExporter) Start() error
Start starts the metric and span data exporter.
func (e *LogExporter) Stop()
Stop stops the metric and span data exporter.
Options provides options for LogExporter
type Options struct { // ReportingInterval is a time interval between two successive metrics // export. ReportingInterval time.Duration // MetricsLogFile is path where exported metrics are logged. // If it is nil then the metrics are logged on console MetricsLogFile string // TracesLogFile is path where exported span data are logged. // If it is nil then the span data are logged on console TracesLogFile string }
PrintExporter is a stats and trace exporter that logs the exported data to the console.
The intent is help new users familiarize themselves with the capabilities of opencensus.
This should NOT be used for production workloads.
type PrintExporter struct{}
func (e *PrintExporter) ExportSpan(vd *trace.SpanData)
ExportSpan logs the trace span.
func (e *PrintExporter) ExportView(vd *view.Data)
ExportView logs the view data.