otlplog

package
v2.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {

	// Start should establish connection(s) to endpoint(s). It is
	// called just once by the exporter, so the implementation
	// does not need to worry about idempotence and locking.
	Start(ctx context.Context) error

	// Stop should close the connections. The function is called
	// only once by the exporter, so the implementation does not
	// need to worry about idempotence, but it may be called
	// concurrently with UploadTraces, so proper
	// locking is required. The function serves as a
	// synchronization point - after the function returns, the
	// process of closing connections is assumed to be finished.
	Stop(ctx context.Context) error

	// UploadLogs should transform the passed traces to the wire
	// format and send it to the collector. May be called
	// concurrently.
	UploadLogs(ctx context.Context, protoSpans *tracepb.ResourceLogs) error
}

Client manages connections to the collector, handles the transformation of data into wire format, and the transmission of that data to the collector.

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

Exporter exports trace data in the OTLP wire format.

func New

func New(ctx context.Context, client Client, res *resource.Resource) (*Exporter, error)

New constructs a new Exporter and starts it.

func NewUnstarted

func NewUnstarted(client Client, res *resource.Resource) *Exporter

NewUnstarted constructs a new Exporter and does not start it.

func (*Exporter) ExportLogs

func (e *Exporter) ExportLogs(ctx context.Context, in []logskd.Log) error

ExportLogs exports a batch of spans.

func (*Exporter) Shutdown

func (e *Exporter) Shutdown(ctx context.Context) error

Shutdown flushes all exports and closes all connections to the receiving endpoint.

func (*Exporter) Start

func (e *Exporter) Start(ctx context.Context) error

Start establishes a connection to the receiving endpoint.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL