service

package module
v0.152.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 25 Imported by: 58

README

Service

Status
Stability development: traces, metrics, logs, profiles
Issues Open issues Closed issues

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate added in v0.124.0

func Validate(ctx context.Context, set Settings, cfg Config) error

Validate verifies the graph by calling the internal graph.Build.

Types

type Config

type Config struct {
	// Telemetry is the configuration for collector's own telemetry.
	Telemetry component.Config `mapstructure:"telemetry"`

	// Extensions are the ordered list of extensions configured for the service.
	Extensions extensions.Config `mapstructure:"extensions,omitempty"`

	// Pipelines are the set of data pipelines configured for the service.
	Pipelines pipelines.Config `mapstructure:"pipelines"`
	// contains filtered or unexported fields
}

Config defines the configurable components of the Service.

type ModuleInfo added in v0.120.0

type ModuleInfo = moduleinfo.ModuleInfo

ModuleInfo describes the Go module for a particular component.

type ModuleInfos added in v0.120.0

type ModuleInfos = moduleinfo.ModuleInfos

ModuleInfos describes the go module for all components.

type Service

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

Service represents the implementation of a component.Host.

func New

func New(ctx context.Context, set Settings, cfg Config) (_ *Service, resultErr error)

New creates a new Service, its telemetry, and Components.

func (*Service) Logger

func (srv *Service) Logger() *zap.Logger

Logger returns the logger created for this service. This is a temporary API that may be removed soon after investigating how the collector should record different events.

func (*Service) Shutdown

func (srv *Service) Shutdown(ctx context.Context) error

Shutdown the service. Shutdown will do the following steps in order: 1. Notify extensions that the pipeline is shutting down. 2. Shutdown all pipelines. 3. Shutdown all extensions. 4. Shutdown telemetry.

func (*Service) Start

func (srv *Service) Start(ctx context.Context) error

Start starts the extensions and pipelines. If Start fails Shutdown should be called to ensure a clean state. Start does the following steps in order: 1. Start all extensions. 2. Notify extensions about Collector configuration 3. Start all pipelines. 4. Notify extensions that the pipeline is ready.

type Settings

type Settings struct {
	// BuildInfo provides collector start information.
	BuildInfo component.BuildInfo

	// CollectorConf contains the Collector's current configuration
	CollectorConf *confmap.Conf

	// Receivers configuration to its builder.
	ReceiversConfigs   map[component.ID]component.Config
	ReceiversFactories map[component.Type]receiver.Factory

	// Processors configuration to its builder.
	ProcessorsConfigs   map[component.ID]component.Config
	ProcessorsFactories map[component.Type]processor.Factory

	// exporters configuration to its builder.
	ExportersConfigs   map[component.ID]component.Config
	ExportersFactories map[component.Type]exporter.Factory

	// Connectors configuration to its builder.
	ConnectorsConfigs   map[component.ID]component.Config
	ConnectorsFactories map[component.Type]connector.Factory

	// Extensions builder for extensions.
	Extensions builders.Extension

	// Extensions configuration to its builder.
	ExtensionsConfigs   map[component.ID]component.Config
	ExtensionsFactories map[component.Type]extension.Factory

	// ModuleInfo describes the go module for each component.
	ModuleInfos ModuleInfos

	// AsyncErrorChannel is the channel that is used to report fatal errors.
	AsyncErrorChannel chan error

	// LoggingOptions provides a way to change behavior of zap logging.
	//
	// These options will be appended to any options passed to BuildZapLogger.
	//
	// Deprecated [v0.142.0]: use BuildZapLogger instead. This field will be
	// removed in the future, and options must be injected through BuildZapLogger.
	LoggingOptions []zap.Option

	// BuildZapLogger holds an optional function for creating a Zap logger from
	// a zap.Config and options. If this is unspecified, zap.Config.Build will
	// be used.
	//
	// NOTE: in the future this field will be required.
	BuildZapLogger func(zap.Config, ...zap.Option) (*zap.Logger, error)

	// TelemetryFactory is the factory for creating internal telemetry providers.
	TelemetryFactory telemetry.Factory
}

Settings holds configuration for building a new Service.

Directories

Path Synopsis
internal
graph
Package graph contains the internal graph representation of the pipelines.
Package graph contains the internal graph representation of the pipelines.
Package telemetry provides an abstract interface for creating telemetry providers.
Package telemetry provides an abstract interface for creating telemetry providers.
telemetrytest module

Jump to

Keyboard shortcuts

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