promexp

package
v0.0.0-...-b364e49 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: BSD-2-Clause-Patent Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EngineTelemetryPort specifies the default port for engine telemetry.
	EngineTelemetryPort = 9191
	// ClientTelemetryPort specifies the default port for client telemetry.
	ClientTelemetryPort = 9192
)

Variables

This section is empty.

Functions

func StartExporter

func StartExporter(ctx context.Context, log logging.Logger, cfg *ExporterConfig) (func(), error)

StartExporter starts the Prometheus exporter.

Types

type ClientCollector

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

ClientCollector is a metrics collector for DAOS client metrics.

func NewClientCollector

func NewClientCollector(ctx context.Context, log logging.Logger, source *ClientSource, opts *CollectorOpts) (*ClientCollector, error)

NewClientCollector creates a new ClientCollector instance.

func (*ClientCollector) Collect

func (c *ClientCollector) Collect(ch chan<- prometheus.Metric)

func (*ClientCollector) Describe

func (c *ClientCollector) Describe(ch chan<- *prometheus.Desc)

type ClientSource

type ClientSource struct {
	MetricSource
	// contains filtered or unexported fields
}

ClientSource is a metrics source for DAOS client metrics.

func NewClientSource

func NewClientSource(parent context.Context) (context.Context, *ClientSource, error)

NewClientSource creates a new ClientSource for client metrics.

type CollectorOpts

type CollectorOpts struct {
	Ignores        []string
	RetainDuration time.Duration
}

CollectorOpts contains options for the metrics collector.

type EngineCollector

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

EngineCollector collects metrics from DAOS Engine sources.

func NewEngineCollector

func NewEngineCollector(log logging.Logger, opts *CollectorOpts, sources ...*EngineSource) (*EngineCollector, error)

NewEngineCollector initializes a new collector for DAOS Engine sources.

func (*EngineCollector) AddSource

func (c *EngineCollector) AddSource(es *EngineSource, cleanup func())

AddSource adds an EngineSource to the Collector.

func (*EngineCollector) Collect

func (c *EngineCollector) Collect(ch chan<- prometheus.Metric)

func (*EngineCollector) Describe

func (c *EngineCollector) Describe(ch chan<- *prometheus.Desc)

func (*EngineCollector) RemoveSource

func (c *EngineCollector) RemoveSource(engineIdx uint32)

RemoveSource removes an EngineSource with a given index from the Collector.

type EngineSource

type EngineSource struct {
	MetricSource
	Index uint32
	Rank  uint32
}

EngineSource provides metrics for a single DAOS Engine.

func NewEngineSource

func NewEngineSource(parent context.Context, idx uint32, rank uint32) (*EngineSource, func(), error)

NewEngineSource initializes a new metrics source for a DAOS Engine.

type ExporterConfig

type ExporterConfig struct {
	Port     int
	Title    string
	Register RegMonFn
}

ExporterConfig defines the configuration for the Prometheus exporter.

type MetricSource

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

MetricSource encapsulates the logic and data for collecting telemetry from a DAOS metrics source.

func (*MetricSource) Collect

func (s *MetricSource) Collect(log logging.Logger, ch chan<- *sourceMetric)

Collect invokes telemetry.CollectMetrics() for the metrics context managed by this source. The collected metrics are sent to the provided channel.

func (*MetricSource) Disable

func (s *MetricSource) Disable()

Disable disables the source.

func (*MetricSource) Enable

func (s *MetricSource) Enable()

Enable enables the source.

func (*MetricSource) IsEnabled

func (s *MetricSource) IsEnabled() bool

IsEnabled checks if the source is enabled.

func (*MetricSource) PruneSegments

func (s *MetricSource) PruneSegments(log logging.Logger, maxSegAge time.Duration)

PruneSegments prunes unused telemetry segments.

type RegMonFn

type RegMonFn func(context.Context, logging.Logger) error

RegMonFn defines a function signature for registering a Prometheus monitor.

Jump to

Keyboard shortcuts

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