Documentation ¶
Overview ¶
+kubebuilder:validation:Optional
+kubebuilder:validation:Optional
Index ¶
- func AddAlertsPipeline(config *Config, cfg CommonOTelConfig, extraProcessors ...string)
- func AddHighCardinalityMetricsFilterProcessor(config *Config)
- func AddPrometheusRemoteWriteExporter(config *Config, promClient promapi.Client)
- func BuildApertureSelfScrapeConfig(name string, tlsConfig *tls.Config, lis *listener.Listener) map[string]any
- func BuildOTelScrapeConfig(name string, cfg CommonOTelConfig) map[string]any
- type BatchAlertsConfig
- type CommonOTelConfig
- type Config
- func (o *Config) AddBatchProcessor(name string, timeout time.Duration, sendBatchSize uint32, ...)
- func (o *Config) AddConnector(name string, value interface{})
- func (o *Config) AddDebugExtensions(userCfg *CommonOTelConfig)
- func (o *Config) AddExporter(name string, value interface{})
- func (o *Config) AddExtension(name string, value interface{})
- func (o *Config) AddProcessor(name string, value interface{})
- func (o *Config) AddReceiver(name string, value interface{})
- func (o *Config) AsMap() map[string]interface{}
- func (o *Config) Copy() (*Config, error)
- func (o *Config) MustCopy() *Config
- func (o *Config) SetDebugPort(userCfg *CommonOTelConfig)
- type Pipeline
- type PortsConfig
- type Provider
- func (p *Provider) AddMutatingHook(hook func(*Config))
- func (p *Provider) MustGetConfig() *Config
- func (p *Provider) Retrieve(_ context.Context, _ string, watchFn confmap.WatcherFunc) (*confmap.Retrieved, error)
- func (p *Provider) Scheme() string
- func (p *Provider) Shutdown(ctx context.Context) error
- func (p *Provider) UpdateConfig(config *Config)
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAlertsPipeline ¶
func AddAlertsPipeline(config *Config, cfg CommonOTelConfig, extraProcessors ...string)
AddAlertsPipeline adds reusable alerts pipeline.
func AddHighCardinalityMetricsFilterProcessor ¶ added in v2.5.0
func AddHighCardinalityMetricsFilterProcessor(config *Config)
AddHighCardinalityMetricsFilterProcessor adds filter processor which filters out high cardinality Aperture platform metrics.
func AddPrometheusRemoteWriteExporter ¶
AddPrometheusRemoteWriteExporter adds Prometheus remote write exporter which writes to controller Prometheus instance.
func BuildApertureSelfScrapeConfig ¶
func BuildApertureSelfScrapeConfig( name string, tlsConfig *tls.Config, lis *listener.Listener, ) map[string]any
BuildApertureSelfScrapeConfig is a helper to create prometheus configuration which scrapes localhost.
func BuildOTelScrapeConfig ¶
func BuildOTelScrapeConfig(name string, cfg CommonOTelConfig) map[string]any
BuildOTelScrapeConfig is a helper to create prometheus sonfiguration which scrapes OTel instance running on localhost.
Types ¶
type BatchAlertsConfig ¶
type BatchAlertsConfig struct { // Timeout sets the time after which a batch will be sent regardless of size. Timeout config.Duration `json:"timeout" validate:"gt=0" default:"1s"` // SendBatchSize is the size of a batch which after hit, will trigger it to be sent. SendBatchSize uint32 `json:"send_batch_size" validate:"gt=0" default:"100"` // SendBatchMaxSize is the upper limit of the batch size. Bigger batches will be split // into smaller units. SendBatchMaxSize uint32 `json:"send_batch_max_size" validate:"gte=0" default:"100"` }
BatchAlertsConfig defines configuration for OTel batch processor. swagger:model +kubebuilder:object:generate=true
func (*BatchAlertsConfig) DeepCopy ¶
func (in *BatchAlertsConfig) DeepCopy() *BatchAlertsConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BatchAlertsConfig.
func (*BatchAlertsConfig) DeepCopyInto ¶
func (in *BatchAlertsConfig) DeepCopyInto(out *BatchAlertsConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CommonOTelConfig ¶
type CommonOTelConfig struct { // BatchAlerts configures batch alerts processor. BatchAlerts BatchAlertsConfig `json:"batch_alerts"` // Ports configures debug, health and extension ports values. Ports PortsConfig `json:"ports"` }
CommonOTelConfig is the configuration for the OTel collector. swagger:model +kubebuilder:object:generate=true
func NewDefaultCommonOTelConfig ¶
func NewDefaultCommonOTelConfig() *CommonOTelConfig
NewDefaultCommonOTelConfig creates CommonOTelConfig with all the default values set.
func (*CommonOTelConfig) DeepCopy ¶
func (in *CommonOTelConfig) DeepCopy() *CommonOTelConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonOTelConfig.
func (*CommonOTelConfig) DeepCopyInto ¶
func (in *CommonOTelConfig) DeepCopyInto(out *CommonOTelConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Config ¶ added in v2.3.1
type Config struct { Extensions map[string]interface{} `json:"extensions,omitempty"` Receivers map[string]interface{} `json:"receivers,omitempty"` Processors map[string]interface{} `json:"processors,omitempty"` Exporters map[string]interface{} `json:"exporters,omitempty"` Connectors map[string]interface{} `json:"connectors,omitempty"` Service *Service `json:"service"` }
Config represents OTel Collector configuration.
func (*Config) AddBatchProcessor ¶ added in v2.3.1
func (o *Config) AddBatchProcessor( name string, timeout time.Duration, sendBatchSize uint32, sendBatchMaxSize uint32, )
AddBatchProcessor is a helper function for adding batch processor.
func (*Config) AddConnector ¶ added in v2.3.1
AddConnector adds connector to OTel config.
func (*Config) AddDebugExtensions ¶ added in v2.3.1
func (o *Config) AddDebugExtensions(userCfg *CommonOTelConfig)
AddDebugExtensions adds common debug extensions and enables them.
func (*Config) AddExporter ¶ added in v2.3.1
AddExporter adds exporter to OTel config.
func (*Config) AddExtension ¶ added in v2.3.1
AddExtension adds given extension and enables it in service.
func (*Config) AddProcessor ¶ added in v2.3.1
AddProcessor adds processor to OTel config.
func (*Config) AddReceiver ¶ added in v2.3.1
AddReceiver adds receiver to OTel config.
func (*Config) Copy ¶ added in v2.3.1
Copy returns a deep copy of the config.
This should error only in pathological cases.
func (*Config) SetDebugPort ¶ added in v2.3.1
func (o *Config) SetDebugPort(userCfg *CommonOTelConfig)
SetDebugPort configures debug port on which OTel server /metrics as specified by user.
type PortsConfig ¶
type PortsConfig struct { // Port on which OTel collector exposes Prometheus metrics on /metrics path. DebugPort uint32 `json:"debug_port" validate:"gte=0" default:"8888"` // Port on which health check extension in exposed. HealthCheckPort uint32 `json:"health_check_port" validate:"gte=0" default:"13133"` // Port on which `pprof` extension in exposed. PprofPort uint32 `json:"pprof_port" validate:"gte=0" default:"1777"` // Port on which `zpages` extension in exposed. ZpagesPort uint32 `json:"zpages_port" validate:"gte=0" default:"55679"` }
PortsConfig defines configuration for OTel debug and extension ports. swagger:model +kubebuilder:object:generate=true
func (*PortsConfig) DeepCopy ¶
func (in *PortsConfig) DeepCopy() *PortsConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortsConfig.
func (*PortsConfig) DeepCopyInto ¶
func (in *PortsConfig) DeepCopyInto(out *PortsConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Provider ¶ added in v2.3.1
type Provider struct {
// contains filtered or unexported fields
}
Provider is an OTel config map provider.
It allows updating the config and registering hooks.
func NewProvider ¶ added in v2.3.1
NewProvider creates a new OTelConfigProvider.
func (*Provider) AddMutatingHook ¶ added in v2.3.1
AddMutatingHook adds a hook to be run before applying config.
The hook should treat the given config as temporary. The hook will also be executed immediately, to ensure that current config was passed through all the added hooks.
func (*Provider) MustGetConfig ¶ added in v2.3.1
MustGetConfig returns a snapshot of the current config.
func (*Provider) Retrieve ¶ added in v2.3.1
func (p *Provider) Retrieve( _ context.Context, _ string, watchFn confmap.WatcherFunc, ) (*confmap.Retrieved, error)
Retrieve implements confmap.Provider.
func (*Provider) UpdateConfig ¶ added in v2.3.1
UpdateConfig sets the new config, replacing the old one. Before new config is set, hooks are allowed to modify the config. Collector update is triggered asynchronously.
Note: Caller should not use the passed config object after calling this function.
type Service ¶ added in v2.3.1
type Service struct { Telemetry map[string]interface{} Pipelines map[string]Pipeline Extensions []string }
Service represents service in OTel Config.
func NewService ¶ added in v2.3.1
func NewService() *Service
NewService returns new empty OTel Service.
func (*Service) AddPipeline ¶ added in v2.3.1
AddPipeline adds pipeline to OTel Service.
func (*Service) DeletePipeline ¶ added in v2.8.0
DeletePipeline deletes pipeline from the OTel Service.