Documentation ¶
Overview ¶
Package collector provides the core functionality of this exporter.
It implements the Prometheus collector interface, providing `monero` metrics whenever a request hits this exporter, allowing us to not have to rely on a particular interval defined in this exporter (instead, rely on prometheus' scrape interval).
Index ¶
- func Register(client *daemon.Client, opts ...Option) error
- func WithCountryMapper(v CountryMapper) func(c *Collector)
- type CollectFunc
- type Collector
- type ConnectionsCollector
- type CountryMapper
- type CustomCollector
- type LastBlockStatsCollector
- type NetStatsCollector
- type Option
- type OverallCollector
- type PeersCollector
- type RPCCollector
- type Summary
- type SummaryOption
- type TransactionPoolCollector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register registers this collector with the global prometheus collectors registry making it available for an exporter to collect our metrics.
func WithCountryMapper ¶
func WithCountryMapper(v CountryMapper) func(c *Collector)
WithCountryMapper is a functional argument that overrides the default no-op country mapper.
Types ¶
type CollectFunc ¶
type CollectFunc func(ctx context.Context, ch chan<- prometheus.Metric) error
CollectFunc defines a standardized signature for functions that want to expose metrics for collection.
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector implements the prometheus Collector interface, providing monero metrics whenever a prometheus scrape is received.
func (*Collector) Collect ¶
func (c *Collector) Collect(ch chan<- prometheus.Metric)
Collect implements the Collect function of the Collector interface.
Here is where all of the calls to a monero rpc endpoint is made, each being wrapped in its own function, all being called concurrently.
func (*Collector) Describe ¶
func (c *Collector) Describe(ch chan<- *prometheus.Desc)
Describe implements the Describe function of the Collector interface.
type ConnectionsCollector ¶
type ConnectionsCollector struct {
// contains filtered or unexported fields
}
func NewConnectionsCollector ¶
func NewConnectionsCollector( client *daemon.Client, metricsC chan<- prometheus.Metric, ) *ConnectionsCollector
func (*ConnectionsCollector) Collect ¶
func (c *ConnectionsCollector) Collect(ctx context.Context) error
func (*ConnectionsCollector) Name ¶
func (c *ConnectionsCollector) Name() string
type CountryMapper ¶
CountryMapper defines the signature of a function that given an IP, translates it into a country name.
f(ip) -> CN
type CustomCollector ¶
type LastBlockStatsCollector ¶
type LastBlockStatsCollector struct {
// contains filtered or unexported fields
}
func NewLastBlockStatsCollector ¶
func NewLastBlockStatsCollector( client *daemon.Client, metricsC chan<- prometheus.Metric, ) *LastBlockStatsCollector
func (*LastBlockStatsCollector) Collect ¶
func (c *LastBlockStatsCollector) Collect(ctx context.Context) error
func (*LastBlockStatsCollector) Name ¶
func (c *LastBlockStatsCollector) Name() string
type NetStatsCollector ¶
type NetStatsCollector struct {
// contains filtered or unexported fields
}
func NewNetStatsCollector ¶
func NewNetStatsCollector( client *daemon.Client, metricsC chan<- prometheus.Metric, ) *NetStatsCollector
func (*NetStatsCollector) Name ¶
func (c *NetStatsCollector) Name() string
type Option ¶
type Option func(c *Collector)
Option is a type used by functional arguments to mutate the collector to override default behavior.
type OverallCollector ¶
type OverallCollector struct {
// contains filtered or unexported fields
}
func NewOverallCollector ¶
func NewOverallCollector( client *daemon.Client, metricsC chan<- prometheus.Metric, ) *OverallCollector
func (*OverallCollector) Name ¶
func (c *OverallCollector) Name() string
type PeersCollector ¶
type PeersCollector struct {
// contains filtered or unexported fields
}
func NewPeersCollector ¶
func NewPeersCollector( client *daemon.Client, metricsC chan<- prometheus.Metric, ) *PeersCollector
func (*PeersCollector) Name ¶
func (c *PeersCollector) Name() string
type RPCCollector ¶
type RPCCollector struct {
// contains filtered or unexported fields
}
func NewRPCCollector ¶
func NewRPCCollector( client *daemon.Client, metricsC chan<- prometheus.Metric, ) *RPCCollector
func (*RPCCollector) Name ¶
func (c *RPCCollector) Name() string
type Summary ¶
type Summary struct {
// contains filtered or unexported fields
}
func NewSummary ¶
func NewSummary(opts ...SummaryOption) *Summary
type SummaryOption ¶
type SummaryOption func(s *Summary)
func WithQuantiles ¶
func WithQuantiles(v map[float64]float64) SummaryOption
type TransactionPoolCollector ¶
type TransactionPoolCollector struct {
// contains filtered or unexported fields
}
func NewTransactionPoolCollector ¶
func NewTransactionPoolCollector( client *daemon.Client, metricsC chan<- prometheus.Metric, ) *TransactionPoolCollector
func (*TransactionPoolCollector) Collect ¶
func (c *TransactionPoolCollector) Collect(ctx context.Context) error
func (*TransactionPoolCollector) Name ¶
func (c *TransactionPoolCollector) Name() string