devicetelemetry

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Metric names.
	MetricNameErrors          = "doublezero_monitor_device_telemetry_errors_total"
	MetricNameSamples         = "doublezero_monitor_device_telemetry_samples_total"
	MetricNameSuccesses       = "doublezero_monitor_device_telemetry_successes_total"
	MetricNameLosses          = "doublezero_monitor_device_telemetry_losses_total"
	MetricNameAccountNotFound = "doublezero_monitor_device_telemetry_account_not_found_total"

	// Labels.
	MetricLabelErrorType = "error_type"
	MetricLabelCircuit   = "circuit"

	// Error types.
	MetricErrorTypeGetCircuits       = "get_circuits"
	MetricErrorTypeGetEpochInfo      = "get_epoch_info"
	MetricErrorTypeGetLatencySamples = "get_latency_samples"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CircuitTelemetryStats

type CircuitTelemetryStats struct {
	SuccessCount uint32
	LossCount    uint32
}

type Config

type Config struct {
	Logger          *slog.Logger
	Metrics         *Metrics
	LedgerRPCClient LedgerRPCClient
	Serviceability  ServiceabilityClient
	Telemetry       TelemetryProgramClient
	Interval        time.Duration
	MaxConcurrency  int
}

func (*Config) Validate

func (c *Config) Validate() error

type DeviceTelemetryWatcher

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

func NewDeviceTelemetryWatcher

func NewDeviceTelemetryWatcher(cfg *Config) (*DeviceTelemetryWatcher, error)

func (*DeviceTelemetryWatcher) Name

func (w *DeviceTelemetryWatcher) Name() string

func (*DeviceTelemetryWatcher) Run

func (*DeviceTelemetryWatcher) Tick

type LedgerRPCClient

type LedgerRPCClient interface {
	GetEpochInfo(ctx context.Context, commitment solanarpc.CommitmentType) (*solanarpc.GetEpochInfoResult, error)
}

type Metrics added in v0.6.3

type Metrics struct {
	Errors          *prometheus.CounterVec
	Samples         *prometheus.CounterVec
	Successes       *prometheus.CounterVec
	Losses          *prometheus.CounterVec
	AccountNotFound *prometheus.CounterVec
}

func NewMetrics added in v0.6.3

func NewMetrics() *Metrics

NewMetrics creates the collectors but does not auto-register them.

func (*Metrics) Register added in v0.6.3

func (m *Metrics) Register(r prometheus.Registerer)

Register all metrics with the provided registry.

type ServiceabilityClient

type ServiceabilityClient interface {
	GetProgramData(context.Context) (*serviceability.ProgramData, error)
}

type TelemetryProgramClient

type TelemetryProgramClient interface {
	GetDeviceLatencySamples(ctx context.Context, originDevicePubKey, targetDevicePubKey, linkPubKey solana.PublicKey, epoch uint64) (*telemetry.DeviceLatencySamples, error)
}

Jump to

Keyboard shortcuts

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