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 ¶
func New(l log.Logger, r prometheus.Registerer, next []loki.LogsReceiver) *Converter
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 ¶
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.