lokireceiver

package module
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 21 Imported by: 3

README

Loki Receiver

Status
Stability alpha: logs
Distributions contrib
Issues Open issues Closed issues
Code Owners @mar4uk, @jpkrohling

The Loki receiver implements the Loki push api as specified here. It allows Promtail instances to specify the open telemetry collector as their lokiAddress.

This receiver runs HTTP and GRPC servers to ingest log entries in Loki format.

Getting Started

The settings are:

  • endpoint (required, default = 0.0.0.0:3500 for HTTP protocol, 0.0.0.0:3600 gRPC protocol): host:port to which the receiver is going to receive data. The component.UseLocalHostAsDefaultHost feature gate changes these to localhost:3500 and localhost:3600. These will become the default in a future release.
  • use_incoming_timestamp (optional, default = false) if set true the timestamp from Loki log entry is used

Example:

receivers:
  loki:
    protocols:
      http:
        endpoint: 0.0.0.0:3500
      grpc:
        endpoint: 0.0.0.0:3600
    use_incoming_timestamp: true

Advanced Configuration

Several helper files are leveraged to provide additional capabilities automatically:

Documentation

Index

Constants

View Source
const ErrAtLeastOneEntryFailedToProcess = "at least one entry in the push request failed to process"

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory return a new receiver.Factory for loki receiver.

Types

type Config

type Config struct {
	// Protocols is the configuration for the supported protocols, currently gRPC and HTTP (Proto and JSON).
	Protocols     `mapstructure:"protocols"`
	KeepTimestamp bool `mapstructure:"use_incoming_timestamp"`
}

Config defines configuration for the lokireceiver receiver.

func (*Config) Unmarshal

func (cfg *Config) Unmarshal(conf *confmap.Conf) error

Unmarshal a confmap.Conf into the config struct.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks the receiver configuration is valid

type Protocols

type Protocols struct {
	GRPC *configgrpc.ServerConfig `mapstructure:"grpc"`
	HTTP *confighttp.ServerConfig `mapstructure:"http"`
}

Protocols is the configuration for the supported protocols.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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