otlptcp

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

README

otlptcp receiver

otlptcp is a receiver for opentelemetry-collector-contrib that receives traces, metrics, and logs via a tcp listener.

Config

Example:

receivers:
  otlptcp:
    listen_address: 0.0.0.0:14317

exporters:
  otlp:
    endpoint: otelcol:4317

service:
  pipelines:
    traces:
      receivers: [otlptcp]
      exporters: [otlp]
    metrics:
      receivers: [otlptcp]
      exporters: [otlp]
    logs:
      receivers: [otlptcp]
      exporters: [otlp]

Availible configuration options:

  • listen_address - listening address in the form of <ip>:port. default is 0.0.0.0:14317
  • max_message_size - maximum size of a single message. Default to 1m.
  • listen_network - listent network. Only tcp is supported.

Usage in collector

See https://opentelemetry.io/docs/collector/custom-collector/

Protocol

Each message is prefixed with 5 bytes.

The first byte is an unsigned 8 bit integer that denotes the type of the message. Valid values are:

The next 4 bytes should be an unsigned 32 bit integer in big-endian order.

The message is a protocol buffer encoded request of the appropriate message type.

Documentation

Index

Constants

View Source
const (
	MessageTypeUnset uint8 = iota
	MessageTypeTrace
	MessageTypeMetric
	MessageTypeLog
)
View Source
const (

	// DefaultMaxMessageSize is the max buffer sized used
	// if MaxMessageSize is not set
	DefaultMaxMessageSize = 4 * 1024 * 1024
)

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a new OTLP TCP receiver factory.

Types

type Config

type Config struct {
	ListenAddress  string          `mapstructure:"listen_address,omitempty"`
	MaxMessageSize helper.ByteSize `mapstructure:"max_message_size,omitempty"`
}

Config defines configuration for OTLP TCP receiver.

Directories

Path Synopsis
internal
sharedcomponent
Package sharedcomponent exposes util functionality for receivers and exporters that need to share state between different signal types instances such as net.Listener or os.File.
Package sharedcomponent exposes util functionality for receivers and exporters that need to share state between different signal types instances such as net.Listener or os.File.

Jump to

Keyboard shortcuts

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