Documentation ¶
Overview ¶
Package observiq provides models and functions for interacting with managed observIQ OTel agents.
Index ¶
- Constants
- type AgentConfiguration
- func (c AgentConfiguration) Empty() bool
- func (c *AgentConfiguration) HasLabels(labels string) bool
- func (c *AgentConfiguration) Raw() (raw RawAgentConfiguration)
- func (c *AgentConfiguration) ReplaceLabels(labels string)
- func (c *AgentConfiguration) Scan(value interface{}) error
- func (c AgentConfiguration) Value() (driver.Value, error)
- type ManagerConfig
- type ManagerTLSConfig
- type RawAgentConfiguration
- func (raw *RawAgentConfiguration) ApplyUpdates(update *RawAgentConfiguration) RawAgentConfiguration
- func (raw *RawAgentConfiguration) Hash() []byte
- func (raw *RawAgentConfiguration) Parse() (*AgentConfiguration, error)
- func (raw *RawAgentConfiguration) Scan(value interface{}) error
- func (raw RawAgentConfiguration) Value() (driver.Value, error)
Constants ¶
const ( CollectorFilename = "collector.yaml" LoggingFilename = "logging.yaml" ManagerFilename = "manager.yaml" )
Names of configuration files in the agent
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentConfiguration ¶
type AgentConfiguration struct { // Collector is the opentelemetry configuration in collector.yaml Collector string `mapstructure:"collector"` // Logging isn't currently managed by BindPlane and is stored as a string for reference. Logging string `mapstructure:"logging"` // Manager is the agent configuration in manager.yaml Manager *ManagerConfig `mapstructure:"manager"` }
AgentConfiguration represents the configuration files of the observiq-agent
func ComputeConfigurationUpdates ¶
func ComputeConfigurationUpdates(server *AgentConfiguration, agent *AgentConfiguration) (diff AgentConfiguration)
ComputeConfigurationUpdates returns the modified agent configuration if the agent's AgentConfiguration contains different settings for any of the configs. Only the parts of the config that are different are included in the resulting AgentConfiguration.
func DecodeAgentConfiguration ¶
func DecodeAgentConfiguration(configuration interface{}) (*AgentConfiguration, error)
DecodeAgentConfiguration will map a generic interface{} to an AgentConfiguration
func (AgentConfiguration) Empty ¶
func (c AgentConfiguration) Empty() bool
Empty returns true if the configuration has empty collector, logging, and manager configs.
func (*AgentConfiguration) HasLabels ¶
func (c *AgentConfiguration) HasLabels(labels string) bool
HasLabels returns true if the existing configuration has a manager.yaml with the same labels
func (*AgentConfiguration) Raw ¶
func (c *AgentConfiguration) Raw() (raw RawAgentConfiguration)
Raw will marshal a structured configuration into a raw configuration of []byte that can be sent to the agent.
func (*AgentConfiguration) ReplaceLabels ¶
func (c *AgentConfiguration) ReplaceLabels(labels string)
ReplaceLabels replaces the labels in the manager.yaml. If manager.yaml doesn't exist an empty one will be created.
func (*AgentConfiguration) Scan ¶ added in v1.16.0
func (c *AgentConfiguration) Scan(value interface{}) error
Scan is used to translate from a JSONB field in postgres to AgentConfiguration
type ManagerConfig ¶
type ManagerConfig struct { Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint,omitempty"` SecretKey string `mapstructure:"secret_key" json:"secret_key" yaml:"secret_key,omitempty"` AgentID string `mapstructure:"agent_id" json:"agent_id" yaml:"agent_id,omitempty"` Labels string `mapstructure:"labels" json:"labels" yaml:"labels,omitempty"` AgentName string `mapstructure:"agent_name" json:"agent_name" yaml:"agent_name,omitempty"` TLS *ManagerTLSConfig `mapstructure:"tls_config" json:"tls_config" yaml:"tls_config,omitempty"` }
ManagerConfig is the unmarshaled contents of manager.yaml This comes from https://github.com/observIQ/bindplane-agent/blob/main/opamp/config.go
type ManagerTLSConfig ¶ added in v1.13.0
type ManagerTLSConfig struct { InsecureSkipVerify bool `mapstructure:"insecure_skip_verify" json:"insecure_skip_verify" yaml:"insecure_skip_verify,omitempty"` KeyFile *string `mapstructure:"key_file" json:"key_file" yaml:"key_file,omitempty"` CertFile *string `mapstructure:"cert_file" json:"cert_file" yaml:"cert_file,omitempty"` CAFile *string `mapstructure:"ca_file" json:"ca_file" yaml:"ca_file,omitempty"` }
ManagerTLSConfig is tls configuration for the collector's manager config
type RawAgentConfiguration ¶
RawAgentConfiguration represents the raw configuration from the agent
func (*RawAgentConfiguration) ApplyUpdates ¶
func (raw *RawAgentConfiguration) ApplyUpdates(update *RawAgentConfiguration) RawAgentConfiguration
ApplyUpdates applies a partial configuration to a configuration, returning a new configuration and leaving the existing configuration unmodified.
func (*RawAgentConfiguration) Hash ¶
func (raw *RawAgentConfiguration) Hash() []byte
Hash returns a sha256 hash of the 3 configuration files in alphabetical order.
func (*RawAgentConfiguration) Parse ¶
func (raw *RawAgentConfiguration) Parse() (*AgentConfiguration, error)
Parse will parse a raw configuration of []byte received from the agent to a structured configuration
func (*RawAgentConfiguration) Scan ¶ added in v1.16.0
func (raw *RawAgentConfiguration) Scan(value interface{}) error
Scan is used to translate from a JSONB field in postgres to AgentConfiguration