otlplogs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Example
Output:

Index

Examples

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 UploadLogs, 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 logs to the wire
	// format and send it to the collector. May be called
	// concurrently.
	UploadLogs(ctx context.Context, protoLogs []*logspb.ResourceLogs) error
}

type Exporter

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

func New

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

New creates new exporter with client Deprecated: Use NewExporter instead. Will be removed in v0.1.0

func NewExporter

func NewExporter(ctx context.Context, options ...ExporterOption) (*Exporter, error)

NewExporter creates new Exporter

func (*Exporter) Export

func (e *Exporter) Export(ctx context.Context, ll []logssdk.ReadableLogRecord) error

Export exports a batch of logs.

func (*Exporter) Shutdown

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

func (*Exporter) Start

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

Start establishes a connection to the receiving endpoint.

type ExporterConfig

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

func NewExporterConfig

func NewExporterConfig(options ...ExporterOption) ExporterConfig

NewExporterConfig creates new configuration for exporter

type ExporterOption

type ExporterOption interface {
	// contains filtered or unexported methods
}

func WithClient

func WithClient(client Client) ExporterOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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