configmodels

package
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package configmodels defines the data models for entities. This file defines the models for configuration format. The defined entities are: Config (the top-level structure), Receivers, Exporters, Processors, Pipelines.

Index

Constants

View Source
const (
	TracesDataTypeStr  = "traces"
	MetricsDataTypeStr = "metrics"
)

Data type strings.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Receivers  Receivers
	Exporters  Exporters
	Processors Processors
	Extensions Extensions
	Service    Service
}

Config defines the configuration for the various elements of collector or agent.

type DataType

type DataType int

DataType is the data type that is supported for collection. We currently support collecting metrics and traces, this can expand in the future (e.g. logs, events, etc).

const (

	// TracesDataType is the data type tag for traces.
	TracesDataType DataType

	// MetricsDataType is the data type tag for metrics.
	MetricsDataType
)

Currently supported data types. Add new data types here when new types are supported in the future.

func (DataType) GetString

func (dataType DataType) GetString() string

GetString converts data type to string.

type Exporter

type Exporter interface {
	NamedEntity
	IsEnabled() bool
	Type() string
	SetType(typeStr string)
}

Exporter is the configuration of an exporter.

type ExporterSettings

type ExporterSettings struct {
	TypeVal  string `mapstructure:"-"`
	NameVal  string `mapstructure:"-"`
	Disabled bool   `mapstructure:"disabled"`
}

ExporterSettings defines common settings for an exporter configuration. Specific exporters can embed this struct and extend it with more fields if needed.

func (*ExporterSettings) IsEnabled

func (es *ExporterSettings) IsEnabled() bool

IsEnabled returns true if the entity is enabled.

func (*ExporterSettings) Name

func (es *ExporterSettings) Name() string

Name gets the exporter name.

func (*ExporterSettings) SetName

func (es *ExporterSettings) SetName(name string)

SetName sets the exporter name.

func (*ExporterSettings) SetType

func (es *ExporterSettings) SetType(typeStr string)

SetType sets the exporter type.

func (*ExporterSettings) Type

func (es *ExporterSettings) Type() string

Type sets the exporter type.

type Exporters

type Exporters map[string]Exporter

Exporters is a map of names to Exporters.

type Extension

type Extension interface {
	NamedEntity
	IsEnabled() bool
	Type() string
	SetType(typeStr string)
}

Extension is the configuration of a service extension. Specific extensions must implement this interface and will typically embed ExtensionSettings struct or a struct that extends it.

type ExtensionSettings

type ExtensionSettings struct {
	TypeVal  string `mapstructure:"-"`
	NameVal  string `mapstructure:"-"`
	Disabled bool   `mapstructure:"disabled"`
}

ExtensionSettings defines common settings for a service extension configuration. Specific extensions can embed this struct and extend it with more fields if needed.

func (*ExtensionSettings) IsEnabled

func (ext *ExtensionSettings) IsEnabled() bool

IsEnabled returns true if the entity is enabled.

func (*ExtensionSettings) Name

func (ext *ExtensionSettings) Name() string

Name gets the extension name.

func (*ExtensionSettings) SetName

func (ext *ExtensionSettings) SetName(name string)

SetName sets the extension name.

func (*ExtensionSettings) SetType

func (ext *ExtensionSettings) SetType(typeStr string)

SetType sets the extension type.

func (*ExtensionSettings) Type

func (ext *ExtensionSettings) Type() string

Type sets the extension type.

type Extensions

type Extensions map[string]Extension

Extensions is a map of names to extensions.

type NamedEntity

type NamedEntity interface {
	Name() string
	SetName(name string)
}

NamedEntity is a configuration entity that has a name.

type Pipeline

type Pipeline struct {
	Name       string   `mapstructure:"-"`
	InputType  DataType `mapstructure:"-"`
	Receivers  []string `mapstructure:"receivers"`
	Processors []string `mapstructure:"processors"`
	Exporters  []string `mapstructure:"exporters"`
}

Pipeline defines a single pipeline.

type Pipelines

type Pipelines map[string]*Pipeline

Pipelines is a map of names to Pipelines.

type Processor

type Processor interface {
	NamedEntity
	IsEnabled() bool
	Type() string
	SetType(typeStr string)
}

Processor is the configuration of a processor. Specific processors must implement this interface and will typically embed ProcessorSettings struct or a struct that extends it.

type ProcessorSettings

type ProcessorSettings struct {
	TypeVal  string `mapstructure:"-"`
	NameVal  string `mapstructure:"-"`
	Disabled bool   `mapstructure:"disabled"`
}

ProcessorSettings defines common settings for a processor configuration. Specific processors can embed this struct and extend it with more fields if needed.

func (*ProcessorSettings) IsEnabled

func (proc *ProcessorSettings) IsEnabled() bool

IsEnabled returns true if the entity is enabled.

func (*ProcessorSettings) Name

func (proc *ProcessorSettings) Name() string

Name gets the processor name.

func (*ProcessorSettings) SetName

func (proc *ProcessorSettings) SetName(name string)

SetName sets the processor name.

func (*ProcessorSettings) SetType

func (proc *ProcessorSettings) SetType(typeStr string)

SetType sets the processor type.

func (*ProcessorSettings) Type

func (proc *ProcessorSettings) Type() string

Type sets the processor type.

type Processors

type Processors map[string]Processor

Processors is a map of names to Processors.

type Receiver

type Receiver interface {
	NamedEntity
	IsEnabled() bool
	Type() string
	SetType(typeStr string)
}

Receiver is the configuration of a receiver. Specific receivers must implement this interface and will typically embed ReceiverSettings struct or a struct that extends it.

type ReceiverSettings

type ReceiverSettings struct {
	TypeVal string `mapstructure:"-"`
	NameVal string `mapstructure:"-"`
	// Configures if the receiver is disabled and doesn't receive any data.
	// The default value is false(meaning the receiver is enabled by default), and it is expected that receivers
	// continue to use the default value of false.
	Disabled bool `mapstructure:"disabled"`
	// Configures the endpoint in the format 'address:port' for the receiver.
	// The default value is set by the receiver populating the struct.
	Endpoint string `mapstructure:"endpoint"`
}

ReceiverSettings defines common settings for a single-protocol receiver configuration. Specific receivers can embed this struct and extend it with more fields if needed.

func (*ReceiverSettings) IsEnabled

func (rs *ReceiverSettings) IsEnabled() bool

IsEnabled returns true if the entity is enabled.

func (*ReceiverSettings) Name

func (rs *ReceiverSettings) Name() string

Name gets the receiver name.

func (*ReceiverSettings) SetName

func (rs *ReceiverSettings) SetName(name string)

SetName sets the receiver name.

func (*ReceiverSettings) SetType

func (rs *ReceiverSettings) SetType(typeStr string)

SetType sets the receiver type.

func (*ReceiverSettings) Type

func (rs *ReceiverSettings) Type() string

Type sets the receiver type.

type Receivers

type Receivers map[string]Receiver

Receivers is a map of names to Receivers.

type Service

type Service struct {
	// Extensions is the ordered list of extensions configured for the service.
	Extensions []string `mapstructure:"extensions"`

	// Pipelines is the set of data pipelines configured for the service.
	Pipelines Pipelines `mapstructure:"pipelines"`
}

Service defines the configurable components of the service.

Source Files

Jump to

Keyboard shortcuts

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