monitoring

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Subsystem = "MNTR"

Subsystem defines the sub system name of this package.

Variables

This section is empty.

Functions

func GetPromInterceptors

GetPromInterceptors returns the set of interceptors for Prometheus monitoring if monitoring is enabled, else empty slices. Monitoring is currently disabled.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

Types

type PrometheusConfig

type PrometheusConfig struct {
	// Active, if true, then Prometheus metrics will be exported.
	Active bool `long:"active" description:"if true prometheus metrics will be exported"`

	// ListenAddr is the listening address that we should use to allow the
	// main Prometheus server to scrape our metrics.
	ListenAddr string `long:"listenaddr" description:"the interface we should listen on for prometheus"`

	// RPCServer is a pointer to the main RPC server. We use this to export
	// generic RPC metrics to monitor the health of the service.
	RPCServer *grpc.Server

	// UniverseStats is used to collect any stats that are relevant to the
	// universe.
	UniverseStats universe.Telemetry

	// AssetStore is used to collect any stats that are relevant to the
	// asset store.
	AssetStore *tapdb.AssetStore

	// AssetMinter is used to collect any stats that are relevant to the
	// asset minter.
	AssetMinter tapgarden.Planter

	// PerfHistograms indicates if the additional histogram information for
	// latency, and handling time of gRPC calls should be enabled. This
	// generates additional data, and consume more memory for the
	// Prometheus server.
	PerfHistograms bool `long:"perfhistograms" description:"enable additional histogram to track gRPC call processing performance (latency, etc)"`
}

PrometheusConfig is the set of configuration data that specifies if Prometheus metric exporting is activated, and if so the listening address of the Prometheus server.

func DefaultPrometheusConfig

func DefaultPrometheusConfig() PrometheusConfig

DefaultPrometheusConfig is the default configuration for the Prometheus metrics exporter.

type PrometheusExporter

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

PrometheusExporter is a metric exporter that uses Prometheus directly. The internal server will interact with this struct in order to export relevant metrics.

func NewPrometheusExporter

func NewPrometheusExporter(cfg *PrometheusConfig) (*PrometheusExporter, error)

NewPrometheusExporter makes a new instance of the PrometheusExporter given the config.

func (*PrometheusExporter) Start

func (p *PrometheusExporter) Start() error

Start registers all relevant metrics with the Prometheus library, then launches the HTTP server that Prometheus will hit to scrape our metrics.

Jump to

Keyboard shortcuts

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