service

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 50 Imported by: 49

Documentation

Overview

Package service handles the command-line, configuration, and runs the OpenTelemetry Collector.

Index

Constants

View Source
const AddCollectorVersionTag = true

AddCollectorVersionTag indicates if the collector version tag should be added to all telemetry metrics

Variables

This section is empty.

Functions

func NewCommand added in v0.36.0

func NewCommand(set CollectorSettings) *cobra.Command

NewCommand constructs a new cobra.Command using the given Collector. TODO: Make this independent of the collector internals.

Types

type Collector added in v0.29.0

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

Collector represents a server providing the OpenTelemetry Collector service.

func New

func New(set CollectorSettings) (*Collector, error)

New creates and returns a new instance of Collector.

func (*Collector) GetLogger added in v0.29.0

func (col *Collector) GetLogger() *zap.Logger

GetLogger returns logger used by the Collector. The logger is initialized after collector server start.

func (*Collector) GetStateChannel added in v0.29.0

func (col *Collector) GetStateChannel() chan State

GetStateChannel returns state channel of the collector server.

func (*Collector) Run added in v0.29.0

func (col *Collector) Run(ctx context.Context) error

Run starts the collector according to the given configuration given, and waits for it to complete. Consecutive calls to Run are not allowed, Run shouldn't be called once a collector is shut down.

func (*Collector) Shutdown added in v0.29.0

func (col *Collector) Shutdown()

Shutdown shuts down the collector server.

type CollectorSettings added in v0.29.0

type CollectorSettings struct {
	// Factories component factories.
	Factories component.Factories

	// BuildInfo provides collector start information.
	BuildInfo component.BuildInfo

	// DisableGracefulShutdown disables the automatic graceful shutdown
	// of the collector on SIGINT or SIGTERM.
	// Users who want to handle signals themselves can disable this behavior
	// and manually handle the signals to shutdown the collector.
	DisableGracefulShutdown bool

	// ConfigMapProvider provides the configuration's config.Map.
	// If it is not provided a default provider is used. The default provider loads the configuration
	// from a config file define by the --config command line flag and overrides component's configuration
	// properties supplied via --set command line flag.
	// If the provider is parserprovider.Watchable, collector may reload the configuration upon error.
	ConfigMapProvider parserprovider.MapProvider

	// ConfigUnmarshaler unmarshalls the configuration's Parser into the service configuration.
	// If it is not provided a default unmarshaler is used.
	ConfigUnmarshaler configunmarshaler.ConfigUnmarshaler

	// LoggingOptions provides a way to change behavior of zap logging.
	LoggingOptions []zap.Option
}

CollectorSettings holds configuration for creating a new Collector.

type State

type State int

State defines Collector's state.

const (
	Starting State = iota
	Running
	Closing
	Closed
)

Directories

Path Synopsis
Package defaultcomponents composes the default set of components used by the otel service
Package defaultcomponents composes the default set of components used by the otel service
builder
Package builder handles the options to build the OpenTelemetry collector pipeline.
Package builder handles the options to build the OpenTelemetry collector pipeline.
fanoutconsumer
Package fanoutconsumer contains implementations of Traces/Metrics/Logs consumers that fan out the data to multiple other consumers.
Package fanoutconsumer contains implementations of Traces/Metrics/Logs consumers that fan out the data to multiple other consumers.

Jump to

Keyboard shortcuts

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