Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureTracing ¶
ConfigureTracing configures the OpenTelemetry trace provider for CLI commands. Projects using troubleshoot as a library would need to register troubleshoot's exporter like so.
var tp *trace.TracerProvider // client application's trace provider tp.RegisterSpanProcessor( trace.NewSimpleSpanProcessor( traces.GetExporterInstance(), // Troubleshoot's exporter ), )
The client application is responsible for constructing the trace provider and registering the exporter. Multiple exporters can be registered.
Types ¶
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter is an implementation of trace.SpanExporter that writes to a destination.
func GetExporterInstance ¶
func GetExporterInstance() *Exporter
GetExporterInstance creates a singleton exporter instance
func (*Exporter) ExportSpans ¶
ExportSpans writes spans to an in-memory cache This function can/will be called on every span.End() at worst.
func (*Exporter) GetSummary ¶
GetSummary returns the runtime summary of the execution so far. Call this function after your "root" span has ended and the program operations needing tracing have completed.
func (*Exporter) MarshalLog ¶
func (e *Exporter) MarshalLog() interface{}
MarshalLog is the marshaling function used by the logging system to represent this exporter.