observiq

package
v1.51.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package observiq contains OpAmp structures compatible with the observiq client

Package observiq contains OpAmp structures compatible with the observiq client

Index

Constants

View Source
const (
	// CollectorConfigName is the key of the collector config in OpAmp
	CollectorConfigName = "collector.yaml"
	// ManagerConfigName is the key of the manager config in OpAmp
	ManagerConfigName = "manager.yaml"
	// LoggingConfigName is the key of the logging config in OpAmp
	LoggingConfigName = "logging.yaml"
	// ReportConfigName is the key of the report config in OpAmp
	ReportConfigName = "report.yaml"
)

Variables

View Source
var (
	// ErrUnsupportedURL is error returned when creating a client with an unsupported URL scheme
	ErrUnsupportedURL = errors.New("unsupported URL")
)

Functions

func NewClient

func NewClient(args *NewClientArgs) (opamp.Client, error)

NewClient creates a new OpAmp client

Types

type AgentConfigManager

type AgentConfigManager struct {
	// contains filtered or unexported fields
}

AgentConfigManager keeps track of active configs for the agent

func NewAgentConfigManager

func NewAgentConfigManager(defaultLogger *zap.Logger) *AgentConfigManager

NewAgentConfigManager creates a new AgentConfigManager

func (*AgentConfigManager) AddConfig

func (a *AgentConfigManager) AddConfig(configName string, managedConfig *opamp.ManagedConfig)

AddConfig adds a config to be tracked by the config manager. If the config already is tracked it'll be overwritten with the new managed config

func (*AgentConfigManager) ApplyConfigChanges

func (a *AgentConfigManager) ApplyConfigChanges(remoteConfig *protobufs.AgentRemoteConfig) (changed bool, returnErr error)

ApplyConfigChanges compares the remoteConfig to the existing and applies changes

func (*AgentConfigManager) ComposeEffectiveConfig

func (a *AgentConfigManager) ComposeEffectiveConfig() (*protobufs.EffectiveConfig, error)

ComposeEffectiveConfig reads in all config files and calculates the effective config

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a client that is connected to Iris via OpAmp

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) error

Connect initiates a connection to the OpAmp server

func (*Client) Disconnect

func (c *Client) Disconnect(ctx context.Context) error

Disconnect disconnects from the server

type DownloadableFileManager

type DownloadableFileManager struct {
	// contains filtered or unexported fields
}

DownloadableFileManager handles DownloadableFile's from a PackagesAvailable message

func (DownloadableFileManager) CleanupArtifacts

func (m DownloadableFileManager) CleanupArtifacts()

CleanupArtifacts removes previous installation artifacts by removing the temporary directory.

func (DownloadableFileManager) FetchAndExtractArchive

func (m DownloadableFileManager) FetchAndExtractArchive(file *protobufs.DownloadableFile) error

FetchAndExtractArchive fetches the archive at the specified URL, placing it into dir. It then checks to see if it matches the "expectedHash", a hex-encoded string representing the expected sha256 sum of the file. If it matches, the archive is extracted into the $dir/latest directory. If the archive cannot be extracted, downloaded, or verified, then an error is returned.

type NewClientArgs

type NewClientArgs struct {
	DefaultLogger *zap.Logger
	Config        opamp.Config
	Collector     collector.Collector
	Version       string

	TmpPath             string
	ManagerConfigPath   string
	CollectorConfigPath string
	LoggerConfigPath    string
}

NewClientArgs arguments passed when creating a new client

Jump to

Keyboard shortcuts

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