Documentation ¶
Overview ¶
Package exporter implements the collectors and metrics handlers.
Index ¶
- Constants
- Variables
- func Connect(ctx context.Context, dsn string, directConnect bool) (*mongo.Client, error)
- func GetNodeType(ctx context.Context, client *mongo.Client) (mongoDBNodeType, error)
- func NewTopologyInfo(ctx context.Context, client *mongo.Client) (*topologyInfo, error)
- type CollstatsCollector
- type DiagnosticDataCollector
- type Exporter
- type GeneralCollector
- type IndexstatsCollector
- type LabelsGetter
- type Opts
- type ReplSetGetStatusCollector
- type ServerStatusCollector
- type ShardingChangelogStats
- type ShardingChangelogSummary
- type ShardingChangelogSummaryID
Constants ¶
View Source
const ( LabelClusterRole = "cl_role" LabelClusterID = "cl_id" LabelReplicasetName = "rs_nm" LabelReplicasetState = "rs_state" TypeIsDBGrid = "isdbgrid" TypeMongos mongoDBNodeType = "mongos" TypeMongod mongoDBNodeType = "mongod" TypeShardServer mongoDBNodeType = "shardsvr" )
Variables ¶
View Source
var ErrCannotGetTopologyLabels = fmt.Errorf("cannot get topology labels")
ErrCannotGetTopologyLabels Cannot read topology labels.
Functions ¶
func GetNodeType ¶
Types ¶
type CollstatsCollector ¶
type CollstatsCollector struct { Ctx context.Context Client *mongo.Client Collections []string CompatibleMode bool DiscoveringMode bool Logger log.Logger TopologyInfo LabelsGetter }
func (*CollstatsCollector) Collect ¶
func (d *CollstatsCollector) Collect(ch chan<- prometheus.Metric)
func (*CollstatsCollector) Describe ¶
func (d *CollstatsCollector) Describe(ch chan<- *prometheus.Desc)
type DiagnosticDataCollector ¶
type DiagnosticDataCollector struct { Ctx context.Context Client *mongo.Client CompatibleMode bool Logger log.Logger TopologyInfo LabelsGetter }
func (*DiagnosticDataCollector) Collect ¶
func (d *DiagnosticDataCollector) Collect(ch chan<- prometheus.Metric)
func (*DiagnosticDataCollector) Describe ¶
func (d *DiagnosticDataCollector) Describe(ch chan<- *prometheus.Desc)
type Exporter ¶
type Exporter struct { Path string Client *mongo.Client Logger logger.Logger Opts *Opts WebListenAddress string TopologyInfo LabelsGetter }
Exporter holds Exporter methods and attributes.
type GeneralCollector ¶
This collector is always enabled and it is not directly related to any particular MongoDB command to gather stats.
func (*GeneralCollector) Collect ¶
func (d *GeneralCollector) Collect(ch chan<- prometheus.Metric)
func (*GeneralCollector) Describe ¶
func (d *GeneralCollector) Describe(ch chan<- *prometheus.Desc)
type IndexstatsCollector ¶
type IndexstatsCollector struct { Ctx context.Context Client *mongo.Client Collections []string DiscoveringMode bool Logger log.Logger TopologyInfo LabelsGetter }
func (*IndexstatsCollector) Collect ¶
func (d *IndexstatsCollector) Collect(ch chan<- prometheus.Metric)
func (*IndexstatsCollector) Describe ¶
func (d *IndexstatsCollector) Describe(ch chan<- *prometheus.Desc)
type LabelsGetter ¶
type LabelsGetter interface {
// contains filtered or unexported methods
}
type Opts ¶
type Opts struct { CompatibleMode bool DiscoveringMode bool GlobalConnPool bool DirectConnect bool URI string Path string WebListenAddress string IndexStatsCollections []string CollStatsCollections []string Logger logger.Logger DisableDiagnosticData bool DisableReplicasetStatus bool }
Opts holds new exporter options.
type ReplSetGetStatusCollector ¶
type ReplSetGetStatusCollector struct { Ctx context.Context Client *mongo.Client CompatibleMode bool Logger log.Logger TopologyInfo LabelsGetter }
func (*ReplSetGetStatusCollector) Collect ¶
func (d *ReplSetGetStatusCollector) Collect(ch chan<- prometheus.Metric)
func (*ReplSetGetStatusCollector) Describe ¶
func (d *ReplSetGetStatusCollector) Describe(ch chan<- *prometheus.Desc)
type ServerStatusCollector ¶
type ServerStatusCollector struct { Ctx context.Context Client *mongo.Client CompatibleMode bool Logger log.Logger TopologyInfo LabelsGetter }
func (*ServerStatusCollector) Collect ¶
func (d *ServerStatusCollector) Collect(ch chan<- prometheus.Metric)
func (*ServerStatusCollector) Describe ¶
func (d *ServerStatusCollector) Describe(ch chan<- *prometheus.Desc)
type ShardingChangelogStats ¶
type ShardingChangelogStats struct {
Items *[]ShardingChangelogSummary
}
ShardingChangelogStats is an array of Sharding changelog stats.
type ShardingChangelogSummary ¶
type ShardingChangelogSummary struct { ID *ShardingChangelogSummaryID `bson:"_id"` Count float64 `bson:"count"` }
ShardingChangelogSummary Sharding Changelog Summary.
type ShardingChangelogSummaryID ¶
ShardingChangelogSummaryID Sharding Changelog Summary ID.
Click to show internal directories.
Click to hide internal directories.