Documentation ¶
Index ¶
- Constants
- func ConvLvl(in zapcore.Level) tracepb.SeverityNumber
- type Exporter
- type Log
- type LogInstance
- func (l LogInstance) Attributes() []attribute.KeyValue
- func (l LogInstance) KV() []attribute.KeyValue
- func (l LogInstance) Name() string
- func (l *LogInstance) SetSpan(in trace.Span)
- func (l LogInstance) Severity() tracepb.SeverityNumber
- func (l LogInstance) Span() trace.Span
- func (l LogInstance) Time() uint64
- type LogProcessor
Constants ¶
View Source
const ( LevelKey = attribute.Key("level") SpanKey = "__SPAN__" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Exporter ¶
type Exporter interface { // ExportLogs exports a batch of logs. // // This function is called synchronously, so there is no concurrency // safety requirement. However, due to the synchronous calling pattern, // it is critical that all timeouts and cancellations contained in the // passed context must be honored. // // Any retry logic must be contained in this function. The SDK that // calls this function will not implement any retry logic. All errors // returned by this function are considered unrecoverable and will be // reported to a configured error Handler. ExportLogs(ctx context.Context, spans []Log) error // Shutdown notifies the exporter of a pending halt to operations. The // exporter is expected to preform any cleanup or synchronization it // requires while honoring all timeouts and cancellations contained in // the passed context. Shutdown(ctx context.Context) error }
Exporter handles the delivery of spans to external receivers. This is the final component in the trace export pipeline.
type LogInstance ¶ added in v2.2.0
type LogInstance struct {
// contains filtered or unexported fields
}
func (LogInstance) Attributes ¶ added in v2.2.0
func (l LogInstance) Attributes() []attribute.KeyValue
func (LogInstance) KV ¶ added in v2.2.0
func (l LogInstance) KV() []attribute.KeyValue
func (LogInstance) Name ¶ added in v2.2.0
func (l LogInstance) Name() string
func (*LogInstance) SetSpan ¶ added in v2.2.0
func (l *LogInstance) SetSpan(in trace.Span)
func (LogInstance) Severity ¶ added in v2.2.0
func (l LogInstance) Severity() tracepb.SeverityNumber
func (LogInstance) Span ¶ added in v2.2.0
func (l LogInstance) Span() trace.Span
func (LogInstance) Time ¶ added in v2.2.0
func (l LogInstance) Time() uint64
type LogProcessor ¶
type LogProcessor interface { // Write log to processor Write(s Log) // Shutdown is called when the SDK shuts down. Any cleanup or release of // resources held by the processor should be done in this call. // // Calls to OnStart, OnEnd, or ForceFlush after this has been called // should be ignored. // // All timeouts and cancellations contained in ctx must be honored, this // should not block indefinitely. Shutdown(ctx context.Context) error // ForceFlush exports all ended spans to the configured Exporter that have not yet // been exported. It should only be called when absolutely necessary, such as when // using a FaaS provider that may suspend the process after an invocation, but before // the Processor can export the completed spans. ForceFlush(ctx context.Context) error }
func NewBatchLogProcessor ¶
func NewBatchLogProcessor(exporter Exporter, options ...trace.BatchSpanProcessorOption) LogProcessor
NewBatchLogProcessor creates a new LogProcessor that will send completed span batches to the exporter with the supplied options.
If the exporter is nil, the span processor will preform no action.
Click to show internal directories.
Click to hide internal directories.