convert

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package convert implements conversion utilities to convert between OpenTelemetry Collector and Loki data.

It follows the OpenTelemetry Logs Data Model and the loki translator package for implementing the conversion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

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

Converter implements consumer.Logs and converts received OTel logs into Loki-compatible log entries.

func New

New returns a new Converter. Converted logs are passed to the provided list of LogsReceivers.

func (*Converter) Capabilities

func (conv *Converter) Capabilities() consumer.Capabilities

Capabilities implements consumer.Logs.

func (*Converter) ConsumeLogs

func (conv *Converter) ConsumeLogs(ctx context.Context, ld plog.Logs) error

ConsumeLogs converts the provided OpenTelemetry Collector-formatted logs into Loki-compatible entries. Each call to ConsumeLogs will forward converted entries to the list of channels in the `next` field. This is reusing the logic from the OpenTelemetry Collector "contrib" distribution and its LogsToLokiRequests function.

func (*Converter) UpdateFanout

func (conv *Converter) UpdateFanout(fanout []loki.LogsReceiver)

UpdateFanout sets the locations the converter forwards log entries to.

Jump to

Keyboard shortcuts

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