logs

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: MPL-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LMLogIngest

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

func NewLMLogIngest

func NewLMLogIngest(ctx context.Context, opts ...Option) (*LMLogIngest, error)

NewLMLogIngest initializes LMLogIngest

func (*LMLogIngest) BatchInterval

func (lli *LMLogIngest) BatchInterval() time.Duration

BatchInterval returns the time interval for batching

func (*LMLogIngest) CreateRequestBody

func (lli *LMLogIngest) CreateRequestBody() model.DataPayload

CreateRequestBody prepares log payload from the requests present in cache after batch interval expires

func (*LMLogIngest) ExportData

func (lli *LMLogIngest) ExportData(payloadList model.DataPayload, uri, method string) error

ExportData exports logs to the LM platform

func (*LMLogIngest) SendLogs

func (lli *LMLogIngest) SendLogs(ctx context.Context, logPayload model.LogInput) error

SendLogs is the entry point for receiving log data

func (*LMLogIngest) URI

func (lli *LMLogIngest) URI() string

URI returns the endpoint/uri of log ingest API

type Option added in v0.2.0

type Option func(*LMLogIngest) error

func WithAuthentication added in v0.3.0

func WithAuthentication(authParams utils.AuthParams) Option

WithAuthentication is used for passing authentication token if not set in environment variables.

func WithEndpoint added in v0.6.1

func WithEndpoint(endpoint string) Option

WithEndpoint is used to set Endpoint URL to export logs

func WithGzipCompression added in v0.4.0

func WithGzipCompression(gzip bool) Option

WithGzipCompression can be used to enable/disable gzip compression of log payload Note: By default, gzip compression is enabled.

func WithHTTPClient added in v0.6.0

func WithHTTPClient(client *http.Client) Option

WithHTTPClient is used to set HTTP client

func WithLogBatchingDisabled added in v0.5.0

func WithLogBatchingDisabled() Option

WithLogBatchingDisabled is used for disabling log batching.

func WithLogBatchingInterval added in v0.5.0

func WithLogBatchingInterval(batchingInterval time.Duration) Option

WithLogBatchingInterval is used for passing batching time interval for logs.

func WithRateLimit added in v0.6.0

func WithRateLimit(requestCount int) Option

WithRateLimit is used to limit the log request count per minute

Jump to

Keyboard shortcuts

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