exporter

package
v0.3.4-rc.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

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

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

func New

func New(ctx context.Context, opts ...ExporterOption) (Exporter, error)

New creates a new health exporter instance using functional options

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 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

Jump to

Keyboard shortcuts

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