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.
Receivers, Exporters and Processors typically have common configuration settings, however sometimes specific implementations will have extra configuration settings. This requires the configuration data for these entities to be polymorphic.
To satisfy these requirements we declare interfaces Receiver, Exporter, Processor, which define the behavior. We also provide helper structs ReceiverSettings, ExporterSettings, ProcessorSettings, which define the common settings and un-marshaling from config files.
Specific Receivers/Exporters/Processors are expected to at the minimum implement the corresponding interface and if they have additional settings they must also extend the corresponding common settings struct (the easiest approach is to embed the common struct).
Index ¶
- type Config
- type DataType
- type Exporter
- type ExporterSettings
- type Exporters
- type Extension
- type ExtensionSettings
- type Extensions
- type NamedEntity
- type Pipeline
- type Pipelines
- type Processor
- type ProcessorSettings
- type Processors
- type Receiver
- type ReceiverSettings
- type Receivers
- type Service
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Receivers Exporters Processors Extensions Service }
Config defines the configuration for the various elements of collector or agent.
func (*Config) Validate ¶ added in v0.23.0
Validate returns an error if the config is invalid.
This function performs basic validation of configuration. There may be more subtle invalid cases that we currently don't check for but which we may want to add in the future (e.g. disallowing receiving and exporting on the same endpoint).
type DataType ¶
type DataType string
DataType is the data type that is supported for collection. We currently support collecting metrics, traces and logs, this can expand in the future.
const ( // TracesDataType is the data type tag for traces. TracesDataType DataType = "traces" // MetricsDataType is the data type tag for metrics. MetricsDataType DataType = "metrics" // LogsDataType is the data type tag for logs. LogsDataType DataType = "logs" )
Currently supported data types. Add new data types here when new types are supported in the future.
type Exporter ¶
type Exporter interface { NamedEntity }
Exporter is the configuration of an exporter.
type ExporterSettings ¶
ExporterSettings defines common settings for an exporter configuration. Specific exporters can embed this struct and extend it with more fields if needed.
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) Type ¶
func (es *ExporterSettings) Type() Type
Type sets the exporter type.
type Extension ¶
type Extension interface { NamedEntity }
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 ¶
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) 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) Type ¶
func (ext *ExtensionSettings) Type() Type
Type sets the extension type.
type NamedEntity ¶
NamedEntity is a configuration entity that has a type and a name.
type Pipeline ¶
type Pipeline struct { Name string InputType DataType Receivers []string Processors []string Exporters []string }
Pipeline defines a single pipeline.
type Processor ¶
type Processor interface { NamedEntity }
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 ¶
ProcessorSettings defines common settings for a processor configuration. Specific processors can embed this struct and extend it with more fields if needed.
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) Type ¶
func (proc *ProcessorSettings) Type() Type
Type sets the processor type.
type Receiver ¶
type Receiver interface { NamedEntity }
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 ¶
ReceiverSettings defines common settings for a receiver configuration. Specific receivers can embed this struct and extend it with more fields if needed.
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) Type ¶
func (rs *ReceiverSettings) Type() Type
Type sets the receiver type.