Documentation
¶
Index ¶
- type AuthEvent
- type BackupManagerInterface
- type BackupMetrics
- type ExporterConfig
- type HighFrequencyCollector
- type LoadBalancerHealth
- type MetricSample
- type MigrationMetric
- type NetworkManagerInterface
- type NetworkMetrics
- type NovaCronExporter
- func (e *NovaCronExporter) Collect(ch chan<- prometheus.Metric)
- func (e *NovaCronExporter) Describe(ch chan<- *prometheus.Desc)
- func (e *NovaCronExporter) RecordAuthenticationEvent(eventType, source string, success bool)
- func (e *NovaCronExporter) RecordSecurityViolation(violationType, severity string)
- func (e *NovaCronExporter) SetBackupManager(manager BackupManagerInterface)
- func (e *NovaCronExporter) SetNetworkManager(manager NetworkManagerInterface)
- func (e *NovaCronExporter) SetSecurityManager(manager SecurityManagerInterface)
- func (e *NovaCronExporter) SetStorageManager(manager StorageManagerInterface)
- func (e *NovaCronExporter) SetVMManager(manager VMManagerInterface)
- func (e *NovaCronExporter) UpdateMigrationMetric(sourceNode, targetNode, migrationType string, duration time.Duration, ...)
- type PrometheusConfig
- type PrometheusIntegration
- func (p *PrometheusIntegration) BuildQuery(metric string, labels map[string]string, function string, ...) string
- func (p *PrometheusIntegration) GetConfig(ctx context.Context) (v1.ConfigResult, error)
- func (p *PrometheusIntegration) GetLabelValues(ctx context.Context, labelName string) ([]string, error)
- func (p *PrometheusIntegration) GetMetricLabels(ctx context.Context, metricName string) ([]string, error)
- func (p *PrometheusIntegration) GetTargets(ctx context.Context) (v1.TargetsResult, error)
- func (p *PrometheusIntegration) Query(ctx context.Context, query string, timestamp time.Time) (*QueryResult, error)
- func (p *PrometheusIntegration) QueryRange(ctx context.Context, query string, startTime, endTime time.Time, ...) (*QueryResult, error)
- func (p *PrometheusIntegration) RegisterCollector(name string, collector prometheus.Collector) error
- func (p *PrometheusIntegration) Start() error
- func (p *PrometheusIntegration) StartHighFrequencyCollection(name, query string, interval time.Duration) (<-chan *MetricSample, error)
- func (p *PrometheusIntegration) Stop() error
- func (p *PrometheusIntegration) StopHighFrequencyCollection(name string) error
- func (p *PrometheusIntegration) UnregisterCollector(name string) error
- type QueryResult
- type ReplicationMetrics
- type SecurityManagerInterface
- type SecurityViolation
- type StorageManagerInterface
- type StorageMetrics
- type TieringMetrics
- type VMInfo
- type VMManagerInterface
- type VMMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupManagerInterface ¶
type BackupManagerInterface interface {
GetBackupMetrics(ctx context.Context) (BackupMetrics, error)
GetReplicationMetrics(ctx context.Context) (ReplicationMetrics, error)
}
type BackupMetrics ¶
type ExporterConfig ¶
type ExporterConfig struct {
CollectionInterval time.Duration `json:"collection_interval"`
EnableVMMetrics bool `json:"enable_vm_metrics"`
EnableStorageMetrics bool `json:"enable_storage_metrics"`
EnableNetworkMetrics bool `json:"enable_network_metrics"`
EnableSecurityMetrics bool `json:"enable_security_metrics"`
EnableBackupMetrics bool `json:"enable_backup_metrics"`
EnableSystemMetrics bool `json:"enable_system_metrics"`
MetricRetention time.Duration `json:"metric_retention"`
}
ExporterConfig represents the configuration for the exporter
func DefaultExporterConfig ¶
func DefaultExporterConfig() *ExporterConfig
DefaultExporterConfig returns default exporter configuration
type HighFrequencyCollector ¶
type HighFrequencyCollector struct {
// contains filtered or unexported fields
}
HighFrequencyCollector collects metrics at high frequency
type LoadBalancerHealth ¶
type MetricSample ¶
type MetricSample struct {
Metric map[string]string `json:"metric"`
Value float64 `json:"value"`
Timestamp time.Time `json:"timestamp"`
}
MetricSample represents a single metric sample
type MigrationMetric ¶
type NetworkManagerInterface ¶
type NetworkManagerInterface interface {
GetNetworkMetrics(ctx context.Context) (NetworkMetrics, error)
GetLoadBalancerHealth(ctx context.Context) (LoadBalancerHealth, error)
}
type NetworkMetrics ¶
type NovaCronExporter ¶
type NovaCronExporter struct {
// contains filtered or unexported fields
}
NovaCronExporter provides Prometheus metrics for NovaCron components
func NewNovaCronExporter ¶
func NewNovaCronExporter(config *ExporterConfig) *NovaCronExporter
NewNovaCronExporter creates a new NovaCron Prometheus exporter
func (*NovaCronExporter) Collect ¶
func (e *NovaCronExporter) Collect(ch chan<- prometheus.Metric)
Collect implements the prometheus.Collector interface
func (*NovaCronExporter) Describe ¶
func (e *NovaCronExporter) Describe(ch chan<- *prometheus.Desc)
Describe implements the prometheus.Collector interface
func (*NovaCronExporter) RecordAuthenticationEvent ¶
func (e *NovaCronExporter) RecordAuthenticationEvent(eventType, source string, success bool)
RecordAuthenticationEvent records an authentication event
func (*NovaCronExporter) RecordSecurityViolation ¶
func (e *NovaCronExporter) RecordSecurityViolation(violationType, severity string)
RecordSecurityViolation records a security violation
func (*NovaCronExporter) SetBackupManager ¶
func (e *NovaCronExporter) SetBackupManager(manager BackupManagerInterface)
SetBackupManager sets the backup manager interface
func (*NovaCronExporter) SetNetworkManager ¶
func (e *NovaCronExporter) SetNetworkManager(manager NetworkManagerInterface)
SetNetworkManager sets the network manager interface
func (*NovaCronExporter) SetSecurityManager ¶
func (e *NovaCronExporter) SetSecurityManager(manager SecurityManagerInterface)
SetSecurityManager sets the security manager interface
func (*NovaCronExporter) SetStorageManager ¶
func (e *NovaCronExporter) SetStorageManager(manager StorageManagerInterface)
SetStorageManager sets the storage manager interface
func (*NovaCronExporter) SetVMManager ¶
func (e *NovaCronExporter) SetVMManager(manager VMManagerInterface)
SetVMManager sets the VM manager interface
func (*NovaCronExporter) UpdateMigrationMetric ¶
func (e *NovaCronExporter) UpdateMigrationMetric(sourceNode, targetNode, migrationType string, duration time.Duration, success bool)
UpdateMigrationMetric updates a migration metric
type PrometheusConfig ¶
type PrometheusConfig struct {
// Server configuration
ServerURL string `json:"server_url"`
ListenAddress string `json:"listen_address"`
MetricsPath string `json:"metrics_path"`
// Query configuration
QueryTimeout time.Duration `json:"query_timeout"`
QueryStep time.Duration `json:"query_step"`
MaxSamples int `json:"max_samples"`
// High-frequency collection
HighFrequencyEnabled bool `json:"high_frequency_enabled"`
HighFrequencyInterval time.Duration `json:"high_frequency_interval"`
HighFrequencyRetention time.Duration `json:"high_frequency_retention"`
// Federation
FederationEnabled bool `json:"federation_enabled"`
FederationTargets []string `json:"federation_targets"`
// Storage
LocalStorageEnabled bool `json:"local_storage_enabled"`
LocalStoragePath string `json:"local_storage_path"`
LocalRetentionPeriod time.Duration `json:"local_retention_period"`
// Security
EnableBasicAuth bool `json:"enable_basic_auth"`
Username string `json:"username"`
Password string `json:"password"`
TLSCertFile string `json:"tls_cert_file"`
TLSKeyFile string `json:"tls_key_file"`
}
PrometheusConfig represents the configuration for Prometheus integration
func DefaultPrometheusConfig ¶
func DefaultPrometheusConfig() *PrometheusConfig
DefaultPrometheusConfig returns a default configuration
type PrometheusIntegration ¶
type PrometheusIntegration struct {
// contains filtered or unexported fields
}
PrometheusIntegration handles Prometheus metrics collection and exposition
func NewPrometheusIntegration ¶
func NewPrometheusIntegration(config *PrometheusConfig) (*PrometheusIntegration, error)
NewPrometheusIntegration creates a new Prometheus integration
func (*PrometheusIntegration) BuildQuery ¶
func (p *PrometheusIntegration) BuildQuery(metric string, labels map[string]string, function string, duration time.Duration) string
BuildQuery builds a Prometheus query with common patterns
func (*PrometheusIntegration) GetConfig ¶
func (p *PrometheusIntegration) GetConfig(ctx context.Context) (v1.ConfigResult, error)
GetConfig retrieves Prometheus configuration
func (*PrometheusIntegration) GetLabelValues ¶
func (p *PrometheusIntegration) GetLabelValues(ctx context.Context, labelName string) ([]string, error)
GetLabelValues retrieves the values for a specific label
func (*PrometheusIntegration) GetMetricLabels ¶
func (p *PrometheusIntegration) GetMetricLabels(ctx context.Context, metricName string) ([]string, error)
GetMetricLabels retrieves the labels for a metric
func (*PrometheusIntegration) GetTargets ¶
func (p *PrometheusIntegration) GetTargets(ctx context.Context) (v1.TargetsResult, error)
GetTargets retrieves Prometheus targets
func (*PrometheusIntegration) Query ¶
func (p *PrometheusIntegration) Query(ctx context.Context, query string, timestamp time.Time) (*QueryResult, error)
Query executes a Prometheus query
func (*PrometheusIntegration) QueryRange ¶
func (p *PrometheusIntegration) QueryRange(ctx context.Context, query string, startTime, endTime time.Time, step time.Duration) (*QueryResult, error)
QueryRange executes a Prometheus range query
func (*PrometheusIntegration) RegisterCollector ¶
func (p *PrometheusIntegration) RegisterCollector(name string, collector prometheus.Collector) error
RegisterCollector registers a custom Prometheus collector
func (*PrometheusIntegration) Start ¶
func (p *PrometheusIntegration) Start() error
Start starts the Prometheus integration
func (*PrometheusIntegration) StartHighFrequencyCollection ¶
func (p *PrometheusIntegration) StartHighFrequencyCollection(name, query string, interval time.Duration) (<-chan *MetricSample, error)
StartHighFrequencyCollection starts high-frequency collection for a query
func (*PrometheusIntegration) Stop ¶
func (p *PrometheusIntegration) Stop() error
Stop stops the Prometheus integration
func (*PrometheusIntegration) StopHighFrequencyCollection ¶
func (p *PrometheusIntegration) StopHighFrequencyCollection(name string) error
StopHighFrequencyCollection stops high-frequency collection for a query
func (*PrometheusIntegration) UnregisterCollector ¶
func (p *PrometheusIntegration) UnregisterCollector(name string) error
UnregisterCollector unregisters a custom Prometheus collector
type QueryResult ¶
type QueryResult struct {
Type model.ValueType `json:"type"`
Result model.Value `json:"result"`
Error string `json:"error,omitempty"`
}
QueryResult represents the result of a Prometheus query
type ReplicationMetrics ¶
type SecurityViolation ¶
type StorageManagerInterface ¶
type StorageManagerInterface interface {
GetStorageMetrics(ctx context.Context) (StorageMetrics, error)
GetTieringMetrics(ctx context.Context) (TieringMetrics, error)
}
type StorageMetrics ¶
type TieringMetrics ¶
type VMManagerInterface ¶
type VMManagerInterface interface {
GetVMCount(ctx context.Context) (int, error)
GetVMMetrics(ctx context.Context, vmID string) (VMMetrics, error)
ListVMs(ctx context.Context) ([]VMInfo, error)
GetMigrationMetrics(ctx context.Context) ([]MigrationMetric, error)
}
Interfaces for data sources
type VMMetrics ¶
type VMMetrics struct {
VMID string `json:"vm_id"`
CPUUsage float64 `json:"cpu_usage"`
MemoryUsage float64 `json:"memory_usage"`
DiskUsage float64 `json:"disk_usage"`
NetworkRxBytes int64 `json:"network_rx_bytes"`
NetworkTxBytes int64 `json:"network_tx_bytes"`
Status string `json:"status"`
}
Data structures