Documentation
¶
Overview ¶
Package healthexporter provides functionality to export health data from local SQLite to a global health endpoint for centralized monitoring and long-term storage using OTLP format.
This package follows Go best practices with separated concerns: - collector: Data collection from various sources - converter: Conversion to different formats (OTLP, CSV) - writer: Output to files or HTTP endpoints
Index ¶
- type Exporter
- type ExporterOption
- func WithComponentsRegistry(registry components.Registry) ExporterOption
- func WithConfig(config *config.HealthExporterConfig) ExporterOption
- func WithDCGMGPUIndexes(m map[string]string) ExporterOption
- func WithDatabaseConnections(dbRW, dbRO *sql.DB) ExporterOption
- func WithEventStore(store eventstore.Store) ExporterOption
- func WithFullConfig(cfg *config.Config) ExporterOption
- func WithHTTPClient(client *http.Client) ExporterOption
- func WithMachineID(machineID string) ExporterOption
- func WithMetricsStore(store pkgmetrics.Store) ExporterOption
- func WithNVMLInstance(instance nvidianvml.Instance) ExporterOption
- func WithTimeout(timeout time.Duration) ExporterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter interface {
// Start begins the periodic export process
Start() error
// Stop gracefully shuts down the exporter
Stop() error
// ExportNow triggers an immediate export (for testing/manual use)
ExportNow(ctx context.Context) error
}
Exporter defines the interface for health data export functionality
type ExporterOption ¶
type ExporterOption func(*exporterOptions) error
ExporterOption defines a function that configures the health exporter Note: For configuration values, use config.HealthExporterConfig only. This options struct is strictly for wiring dependencies and runtime options.
func WithComponentsRegistry ¶
func WithComponentsRegistry(registry components.Registry) ExporterOption
WithComponentsRegistry sets the components registry
func WithConfig ¶
func WithConfig(config *config.HealthExporterConfig) ExporterOption
WithConfig sets the health exporter configuration
func WithDCGMGPUIndexes ¶ added in v1.1.0
func WithDCGMGPUIndexes(m map[string]string) ExporterOption
WithDCGMGPUIndexes sets the UUID→DCGM-device-ID mapping so that MachineInfo GPU indices match the "gpu" label emitted by DCGM metrics.
func WithDatabaseConnections ¶
func WithDatabaseConnections(dbRW, dbRO *sql.DB) ExporterOption
WithDatabaseConnections sets the database connections for metadata access
func WithEventStore ¶
func WithEventStore(store eventstore.Store) ExporterOption
WithEventStore sets the event store
func WithFullConfig ¶
func WithFullConfig(cfg *config.Config) ExporterOption
WithFullConfig sets the full agent configuration for daily config export
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ExporterOption
WithHTTPClient sets a custom HTTP client
func WithMachineID ¶
func WithMachineID(machineID string) ExporterOption
WithMachineID sets the machine ID for the exporter This should be the stable agent identity initialized by the server
func WithMetricsStore ¶
func WithMetricsStore(store pkgmetrics.Store) ExporterOption
WithMetricsStore sets the metrics store
func WithNVMLInstance ¶
func WithNVMLInstance(instance nvidianvml.Instance) ExporterOption
WithNVMLInstance sets the NVML instance
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ExporterOption
WithTimeout sets a custom timeout (overrides config timeout)
Directories
¶
| Path | Synopsis |
|---|---|
|
Package collector handles health data collection from various sources
|
Package collector handles health data collection from various sources |
|
Package converter handles conversion of health data to different formats
|
Package converter handles conversion of health data to different formats |
|
Package writer handles writing health data to various outputs
|
Package writer handles writing health data to various outputs |