config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// types
	BlackholeSinkType      = "blackhole"
	PrometheusExporterType = "prometheus_exporter"

	// default names
	DefaultSourceName                = "defaultSource"
	DefaultSinkName                  = "defaultSink"
	DefaultInternalMetricsSourceName = "internalMetricsSource"
	DefaultInternalMetricsSinkName   = "internalMetricsSink"
	DefaultAggregatorSourcePort      = 8989
	DefaultNamespace                 = "default"
	DefaultPipelineName              = "default-pipeline"
)
View Source
const (
	// types
	AMQPType                  = "amqp"
	ApacheMetricsType         = "apache_metrics"
	AWSKinesisFirehoseType    = "aws_kinesis_firehose"
	AWSS3Type                 = "aws_s3"
	AWSSQSType                = "aws_sqs"
	DatadogAgentType          = "datadog_agent"
	DemoLogsType              = "demo_logs"
	DNSTapType                = "dnstap"
	DockerLogsType            = "docker_logs"
	EventStoreDBMetricsType   = "eventstoredb_metrics"
	FileType                  = "file"
	FluentType                = "fluent"
	GCPPubSubType             = "gcp_pubsub"
	HerokuLogsType            = "heroku_logs"
	HostMetricsType           = "host_metrics"
	HTTPClientType            = "http_client"
	HTTPServerType            = "http_server"
	InternalLogsType          = "internal_logs"
	InternalMetricsType       = "internal_metrics"
	JournaldType              = "journald"
	KafkaType                 = "kafka"
	KubernetesLogsType        = "kubernetes_logs"
	LogstashType              = "logstash"
	MongoDBMetricsType        = "mongodb_metrics"
	NATSType                  = "nats"
	NginxMetricsType          = "nginx_metrics"
	OpenTelemetryType         = "opentelemetry"
	PostgreSQLMetricsType     = "postgresql_metrics"
	PrometheusPushgatewayType = "prometheus_pushgateway"
	PrometheusRemoteWriteType = "prometheus_remote_write"
	PrometheusScrapeType      = "prometheus_scrape"
	PulsarType                = "pulsar"
	RedisType                 = "redis"
	SocketType                = "socket"
	SplunkHECType             = "splunk_hec"
	StatsDType                = "statsd"
	SyslogType                = "syslog"
	VectorType                = "vector"
)
View Source
const (
	AgentApiPort = 8686
)

Variables

View Source
var (
	ErrNotAllowedSourceType   = errors.New("type kubernetes_logs only allowed")
	ErrClusterScopeNotAllowed = errors.New("logs from external namespace not allowed")
)

Functions

Types

type ApiSpec

type ApiSpec struct {
	Address    string `yaml:"address,omitempty"`
	Enabled    bool   `yaml:"enabled,omitempty"`
	Playground bool   `yaml:"playground,omitempty"`
}

type PipelineConfig

type PipelineConfig struct {
	Sources    map[string]*Source    `yaml:"sources"`
	Transforms map[string]*Transform `yaml:"transforms"`
	Sinks      map[string]*Sink      `yaml:"sinks"`
}

func (*PipelineConfig) VectorRole

type SPGroup

type SPGroup struct {
	PipelineName string
	Namespace    string
	ServiceName  string
}

type ServicePort

type ServicePort struct {
	IsKubernetesEvents bool
	PipelineName       string
	SourceName         string
	Namespace          string
	Port               int32
	Protocol           corev1.Protocol
	ServiceName        string
}

type Sink

type Sink struct {
	Name    string                 `yaml:"-"`
	Type    string                 `mapstructure:"type" yaml:"type"`
	Inputs  []string               `mapstructure:"inputs" yaml:"inputs"`
	Options map[string]interface{} `mapstructure:",remain" yaml:",inline,omitempty"`
}

type Source

type Source struct {
	Name                        string         `yaml:"-"`
	Type                        string         `mapstructure:"type" yaml:"type"`
	ExtraNamespaceLabelSelector string         `mapstructure:"extra_namespace_label_selector" yaml:"extra_namespace_label_selector,omitempty"`
	ExtraLabelSelector          string         `mapstructure:"extra_label_selector" yaml:"extra_label_selector,omitempty"`
	ExtraFieldSelector          string         `mapstructure:"extra_field_selector" yaml:"extra_field_selector,omitempty"`
	UseApiServerCache           bool           `mapstructure:"use_apiserver_cache" yaml:"use_apiserver_cache,omitempty"`
	Options                     map[string]any `mapstructure:",remain" yaml:",inline,omitempty"`
}

type Transform

type Transform struct {
	Name    string                 `yaml:"-"`
	Type    string                 `mapstructure:"type" yaml:"type"`
	Inputs  []string               `mapstructure:"inputs" yaml:"inputs"`
	Options map[string]interface{} `mapstructure:",remain" yaml:",inline,omitempty"`
}

type VectorConfig

type VectorConfig struct {
	DataDir string `yaml:"data_dir"`

	Api            *ApiSpec `yaml:"api"`
	PipelineConfig `yaml:",inline"`
	// contains filtered or unexported fields
}

func BuildAgentConfig

func BuildAgentConfig(p VectorConfigParams, pipelines ...pipeline.Pipeline) (*VectorConfig, []byte, error)

func BuildAggregatorConfig

func BuildAggregatorConfig(params VectorConfigParams, pipelines ...pipeline.Pipeline) (*VectorConfig, error)

func (*VectorConfig) GetEventCollectorConfig added in v0.1.2

func (c *VectorConfig) GetEventCollectorConfig(namespace string) *evcollector.Config

func (*VectorConfig) GetGlobalConfigHash added in v0.2.0

func (c *VectorConfig) GetGlobalConfigHash() *uint32

func (*VectorConfig) GetSourcesServicePorts

func (c *VectorConfig) GetSourcesServicePorts() map[SPGroup][]*ServicePort

func (*VectorConfig) MarshalJSON

func (c *VectorConfig) MarshalJSON() ([]byte, error)

type VectorConfigParams

type VectorConfigParams struct {
	AggregatorName    string
	ApiEnabled        bool
	PlaygroundEnabled bool
	UseApiServerCache bool
	InternalMetrics   bool
	ExpireMetricsSecs *int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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