Documentation ¶
Index ¶
- Variables
- func BsonMongoTimestampToUnix(timestamp bson.MongoTimestamp) float64
- func CollectCollectionStatus(session *mgo.Session, db string, ch chan<- prometheus.Metric)
- func CollectProfileStatus(session *mgo.Session, db string, ch chan<- prometheus.Metric)
- func GetOplogTimestamp(session *mgo.Session, returnTail bool) (float64, error)
- type ApplyStats
- type AssertsStats
- type BenchmarkStats
- type BufferStats
- type ClientStats
- type CollectionStatus
- type ConnPoolStats
- type ConnectionStats
- type CursorStats
- type CursorStatsOpen
- type Cursors
- type DatabaseStatus
- type DocumentStats
- type DurStats
- type DurTiming
- type ExtraInfo
- type FlushStats
- type GetLastErrorStats
- type GlobalLockStats
- type HostConnPoolStats
- type IndexCounterStats
- type LockStats
- type LockStatsMap
- type MemStats
- type Member
- type MetricsNetworkStats
- type MetricsStats
- type MongodbCollector
- type MongodbCollectorOpts
- type NetworkStats
- type OpcountersReplStats
- type OpcountersStats
- type OperationStats
- type OplogCollectionStats
- type OplogStatus
- type PreloadStats
- type ProfileStatus
- type QueryExecutorStats
- type QueueStats
- type RawStatus
- type ReadWriteLockTimes
- type RecordStats
- type ReplSetStatus
- type ReplStats
- type ServerStatus
- type StorageEngineStats
- type StorageStats
- type TopStats
- type TopStatsMap
- type TopStatus
- type TopcounterStats
- type WTBlockManagerStats
- type WTCacheStats
- type WTConcurrentTransactionsStats
- type WTConcurrentTransactionsTypeStats
- type WTLogStats
- type WTSessionStats
- type WTTransactionStats
- type WiredTigerStats
Constants ¶
This section is empty.
Variables ¶
var (
// Namespace is the namespace of the metrics
Namespace = "mongodb"
)
Functions ¶
func BsonMongoTimestampToUnix ¶
func BsonMongoTimestampToUnix(timestamp bson.MongoTimestamp) float64
BsonMongoTimestampToUnix converts a mongo timestamp to UNIX time there's gotta be a better way to do this, but it works for now :/
func CollectCollectionStatus ¶ added in v1.1.0
func CollectCollectionStatus(session *mgo.Session, db string, ch chan<- prometheus.Metric)
func CollectProfileStatus ¶ added in v1.1.0
func CollectProfileStatus(session *mgo.Session, db string, ch chan<- prometheus.Metric)
func GetOplogTimestamp ¶
GetOplogTimestamp fetches the latest oplog timestamp
Types ¶
type ApplyStats ¶
type ApplyStats struct { Batches *BenchmarkStats `bson:"batches"` Ops float64 `bson:"ops"` }
ApplyStats are the stats associated with the apply operation.
func (*ApplyStats) Export ¶
func (applyStats *ApplyStats) Export(ch chan<- prometheus.Metric)
Export exports the apply stats
type AssertsStats ¶
type AssertsStats struct { Regular float64 `bson:"regular"` Warning float64 `bson:"warning"` Msg float64 `bson:"msg"` User float64 `bson:"user"` Rollovers float64 `bson:"rollovers"` }
AssertsStats has the assets metrics
func (*AssertsStats) Describe ¶
func (asserts *AssertsStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*AssertsStats) Export ¶
func (asserts *AssertsStats) Export(ch chan<- prometheus.Metric)
Export exports the metrics to prometheus.
type BenchmarkStats ¶
BenchmarkStats is bechmark info about an operation.
type BufferStats ¶
type BufferStats struct { Count float64 `bson:"count"` MaxSizeBytes float64 `bson:"maxSizeBytes"` SizeBytes float64 `bson:"sizeBytes"` }
BufferStats are the stats associated with the buffer
func (*BufferStats) Export ¶
func (bufferStats *BufferStats) Export(ch chan<- prometheus.Metric)
Export exports the buffer stats.
type ClientStats ¶
type ClientStats struct { Total float64 `bson:"total"` Readers float64 `bson:"readers"` Writers float64 `bson:"writers"` }
ClientStats metrics for client stats
func (*ClientStats) Export ¶
func (clientStats *ClientStats) Export(ch chan<- prometheus.Metric)
Export exports the metrics to prometheus
type CollectionStatus ¶ added in v1.1.0
type CollectionStatus struct { Name string `bson:"ns"` Count int32 `bson:"count"` Size int32 `bson:"size"` AvgSize int32 `bson:"avgObjSize"` StorageSize int32 `bson:"storageSize"` IndexSize int32 `bson:"totalIndexSize"` }
func GetCollectionStatus ¶ added in v1.1.0
func GetCollectionStatus(session *mgo.Session, db string, collection string) *CollectionStatus
func (*CollectionStatus) Describe ¶ added in v1.1.0
func (collStatus *CollectionStatus) Describe(ch chan<- *prometheus.Desc)
func (*CollectionStatus) Export ¶ added in v1.1.0
func (collStatus *CollectionStatus) Export(ch chan<- prometheus.Metric)
type ConnPoolStats ¶ added in v1.1.0
type ConnPoolStats struct { SyncClientConnections float64 `bson:"numClientConnections"` ASScopedConnections float64 `bson:"numAScopedConnections"` TotalInUse float64 `bson:"totalInUse"` TotalAvailable float64 `bson:"totalAvailable"` TotalCreated float64 `bson:"totalCreated"` Hosts map[string]*HostConnPoolStats `bson:hosts"` }
ServerStatus keeps the data returned by the serverStatus() method.
func GetConnPoolStats ¶ added in v1.1.0
func GetConnPoolStats(session *mgo.Session) *ConnPoolStats
GetServerStatus returns the server status info.
func (*ConnPoolStats) Describe ¶ added in v1.1.0
func (stats *ConnPoolStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the server status for prometheus.
func (*ConnPoolStats) Export ¶ added in v1.1.0
func (stats *ConnPoolStats) Export(ch chan<- prometheus.Metric)
Export exports the server status to be consumed by prometheus.
type ConnectionStats ¶
type ConnectionStats struct { Current float64 `bson:"current"` Available float64 `bson:"available"` TotalCreated float64 `bson:"totalCreated"` }
ConnectionStats are connections metrics
func (*ConnectionStats) Describe ¶
func (connectionStats *ConnectionStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*ConnectionStats) Export ¶
func (connectionStats *ConnectionStats) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.
type CursorStats ¶
type CursorStats struct { TimedOut float64 `bson:"timedOut"` Open *CursorStatsOpen `bson:"open"` }
CursorStats are the stats for cursors
func (*CursorStats) Export ¶
func (cursorStats *CursorStats) Export(ch chan<- prometheus.Metric)
Export exports the cursor stats.
type CursorStatsOpen ¶
type CursorStatsOpen struct { NoTimeout float64 `bson:"noTimeout"` Pinned float64 `bson:"pinned"` Total float64 `bson:"total"` }
CursorStatsOpen are the stats for open cursors
type Cursors ¶
type Cursors struct { TotalOpen float64 `bson:"totalOpen"` TimeOut float64 `bson:"timedOut"` TotalNoTimeout float64 `bson:"totalNoTimeout"` Pinned float64 `bson:"pinned"` }
Cursors are the cursor metrics
func (*Cursors) Describe ¶
func (cursors *Cursors) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*Cursors) Export ¶
func (cursors *Cursors) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.
type DatabaseStatus ¶
type DatabaseStatus struct { Name string `bson:"db,omitempty"` IndexSize int `bson:"indexSize,omitempty"` DataSize int `bson:"dataSize,omitempty"` Collections int `bson:"collections,omitempty"` Objects int `bson:"objects,omitempty"` Indexes int `bson:"indexes,omitempty"` Shards map[string]*RawStatus `bson:"raw,omitempty"` }
DatabaseStatus represents stats about a database
func GetDatabaseStatus ¶
func GetDatabaseStatus(session *mgo.Session, db string) *DatabaseStatus
GetDatabaseStatus returns stats for a given database
func (*DatabaseStatus) Describe ¶
func (dbStatus *DatabaseStatus) Describe(ch chan<- *prometheus.Desc)
Describe describes database stats for prometheus
func (*DatabaseStatus) Export ¶
func (dbStatus *DatabaseStatus) Export(ch chan<- prometheus.Metric)
Export exports database stats to prometheus
type DocumentStats ¶
type DocumentStats struct { Deleted float64 `bson:"deleted"` Inserted float64 `bson:"inserted"` Returned float64 `bson:"returned"` Updated float64 `bson:"updated"` }
DocumentStats are the stats associated to a document.
func (*DocumentStats) Export ¶
func (documentStats *DocumentStats) Export(ch chan<- prometheus.Metric)
Export exposes the document stats to be consumed by the prometheus server.
type DurStats ¶
type DurStats struct { Commits float64 `bson:"commits"` JournaledMB float64 `bson:"journaledMB"` WriteToDataFilesMB float64 `bson:"writeToDataFilesMB"` Compression float64 `bson:"compression"` CommitsInWriteLock float64 `bson:"commitsInWriteLock"` EarlyCommits float64 `bson:"earlyCommits"` TimeMs DurTiming `bson:"timeMs"` }
DurStats are the stats related to durability.
func (*DurStats) Collect ¶
func (durStats *DurStats) Collect(ch chan<- prometheus.Metric)
Collect collects the metrics for prometheus
func (*DurStats) Describe ¶
func (durStats *DurStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*DurStats) Export ¶
func (durStats *DurStats) Export(ch chan<- prometheus.Metric)
Export export the durability stats for the prometheus server.
type DurTiming ¶
type DurTiming struct { Dt float64 `bson:"dt"` PrepLogBuffer float64 `bson:"prepLogBuffer"` WriteToJournal float64 `bson:"writeToJournal"` WriteToDataFiles float64 `bson:"writeToDataFiles"` RemapPrivateView float64 `bson:"remapPrivateView"` }
DurTiming is the information about durability returned from the server.
func (*DurTiming) Export ¶
func (durTiming *DurTiming) Export(ch chan<- prometheus.Metric)
Export exports the data for the prometheus server.
type ExtraInfo ¶
type ExtraInfo struct { HeapUsageBytes float64 `bson:"heap_usage_bytes"` PageFaults float64 `bson:"page_faults"` }
ExtraInfo has extra info metrics
func (*ExtraInfo) Describe ¶
func (extraInfo *ExtraInfo) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*ExtraInfo) Export ¶
func (extraInfo *ExtraInfo) Export(ch chan<- prometheus.Metric)
Export exports the metrics to prometheus.
type FlushStats ¶
type FlushStats struct { Flushes float64 `bson:"flushes"` TotalMs float64 `bson:"total_ms"` AverageMs float64 `bson:"average_ms"` LastMs float64 `bson:"last_ms"` LastFinished time.Time `bson:"last_finished"` }
FlushStats is the flush stats metrics
func (*FlushStats) Describe ¶
func (flushStats *FlushStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*FlushStats) Export ¶
func (flushStats *FlushStats) Export(ch chan<- prometheus.Metric)
Export exports the metrics for prometheus.
type GetLastErrorStats ¶
type GetLastErrorStats struct { Wtimeouts float64 `bson:"wtimeouts"` Wtime *BenchmarkStats `bson:"wtime"` }
GetLastErrorStats are the last error stats.
func (*GetLastErrorStats) Export ¶
func (getLastErrorStats *GetLastErrorStats) Export(ch chan<- prometheus.Metric)
Export exposes the get last error stats.
type GlobalLockStats ¶
type GlobalLockStats struct { TotalTime float64 `bson:"totalTime"` LockTime float64 `bson:"lockTime"` Ratio float64 `bson:"ratio"` CurrentQueue *QueueStats `bson:"currentQueue"` ActiveClients *ClientStats `bson:"activeClients"` }
GlobalLockStats global lock stats
func (*GlobalLockStats) Describe ¶
func (globalLock *GlobalLockStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*GlobalLockStats) Export ¶
func (globalLock *GlobalLockStats) Export(ch chan<- prometheus.Metric)
Export exports the metrics to prometheus
type HostConnPoolStats ¶ added in v1.1.0
type HostConnPoolStats struct { InUse float64 `bson:"inUse"` Available float64 `bson:"available"` Created float64 `bson:"created"` }
ServerStatus keeps the data returned by the serverStatus() method.
func (*HostConnPoolStats) Describe ¶ added in v1.1.0
func (stats *HostConnPoolStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the server status for prometheus.
func (*HostConnPoolStats) Export ¶ added in v1.1.0
func (stats *HostConnPoolStats) Export(hostname string, ch chan<- prometheus.Metric)
Export exports the server status to be consumed by prometheus.
type IndexCounterStats ¶
type IndexCounterStats struct { Accesses float64 `bson:"accesses"` Hits float64 `bson:"hits"` Misses float64 `bson:"misses"` Resets float64 `bson:"resets"` MissRatio float64 `bson:"missRatio"` }
IndexCounterStats index counter stats
func (*IndexCounterStats) Describe ¶
func (indexCountersStats *IndexCounterStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*IndexCounterStats) Export ¶
func (indexCountersStats *IndexCounterStats) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.
type LockStats ¶
type LockStats struct { TimeLockedMicros ReadWriteLockTimes `bson:"timeLockedMicros"` TimeAcquiringMicros ReadWriteLockTimes `bson:"timeAcquiringMicros"` }
LockStats lock stats
type LockStatsMap ¶
LockStatsMap is a map of lock stats
func (LockStatsMap) Describe ¶
func (locks LockStatsMap) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (LockStatsMap) Export ¶
func (locks LockStatsMap) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.
type MemStats ¶
type MemStats struct { Bits float64 `bson:"bits"` Resident float64 `bson:"resident"` Virtual float64 `bson:"virtual"` Mapped float64 `bson:"mapped"` MappedWithJournal float64 `bson:"mappedWithJournal"` }
MemStats tracks the mem stats metrics.
func (*MemStats) Describe ¶
func (memStats *MemStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*MemStats) Export ¶
func (memStats *MemStats) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.
type Member ¶
type Member struct { Name string `bson:"name"` Self *bool `bson:"self,omitempty"` Health *int32 `bson:"health,omitempty"` State int32 `bson:"state"` StateStr string `bson:"stateStr"` Uptime float64 `bson:"uptime"` Optime interface{} `bson:"optime"` OptimeDate time.Time `bson:"optimeDate"` ElectionTime *time.Time `bson:"electionTime,omitempty"` ElectionDate *time.Time `bson:"electionDate,omitempty"` LastHeartbeat *time.Time `bson:"lastHeartbeat,omitempty"` LastHeartbeatRecv *time.Time `bson:"lastHeartbeatRecv,omitempty"` LastHeartbeatMessage *string `bson:"lastHeartbeatMessage,omitempty"` PingMs *float64 `bson:"pingMs,omitempty"` SyncingTo *string `bson:"syncingTo,omitempty"` ConfigVersion *int32 `bson:"configVersion,omitempty"` }
Member represents an array element of ReplSetStatus.Members
type MetricsNetworkStats ¶
type MetricsNetworkStats struct { Bytes float64 `bson:"bytes"` Ops float64 `bson:"ops"` GetMores *BenchmarkStats `bson:"getmores"` ReadersCreated float64 `bson:"readersCreated"` }
MetricsNetworkStats are the network stats.
func (*MetricsNetworkStats) Export ¶
func (metricsNetworkStats *MetricsNetworkStats) Export(ch chan<- prometheus.Metric)
Export exposes the network stats.
type MetricsStats ¶
type MetricsStats struct { Document *DocumentStats `bson:"document"` GetLastError *GetLastErrorStats `bson:"getLastError"` Operation *OperationStats `bson:"operation"` QueryExecutor *QueryExecutorStats `bson:"queryExecutor"` Record *RecordStats `bson:"record"` Repl *ReplStats `bson:"repl"` Storage *StorageStats `bson:"storage"` Cursor *CursorStats `bson:"cursor"` }
MetricsStats are all stats associated with metrics of the system
func (*MetricsStats) Describe ¶
func (metricsStats *MetricsStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*MetricsStats) Export ¶
func (metricsStats *MetricsStats) Export(ch chan<- prometheus.Metric)
Export exports the metrics stats.
type MongodbCollector ¶
type MongodbCollector struct {
Opts MongodbCollectorOpts
}
MongodbCollector is in charge of collecting mongodb's metrics.
func NewMongodbCollector ¶
func NewMongodbCollector(opts MongodbCollectorOpts) *MongodbCollector
NewMongodbCollector returns a new instance of a MongodbCollector.
func (*MongodbCollector) Collect ¶
func (exporter *MongodbCollector) Collect(ch chan<- prometheus.Metric)
Collect collects all mongodb's metrics.
func (*MongodbCollector) Describe ¶
func (exporter *MongodbCollector) Describe(ch chan<- *prometheus.Desc)
Describe describes all mongodb's metrics.
type MongodbCollectorOpts ¶
type MongodbCollectorOpts struct { URI string TLSCertificateFile string TLSPrivateKeyFile string TLSCaFile string TLSHostnameValidation bool CollectReplSet bool CollectOplog bool CollectTopMetrics bool CollectDatabaseMetrics bool CollectCollectionMetrics bool CollectProfileMetrics bool CollectConnPoolStats bool UserName string AuthMechanism string }
MongodbCollectorOpts is the options of the mongodb collector.
type NetworkStats ¶
type NetworkStats struct { BytesIn float64 `bson:"bytesIn"` BytesOut float64 `bson:"bytesOut"` NumRequests float64 `bson:"numRequests"` }
NetworkStats network stats
func (*NetworkStats) Describe ¶
func (networkStats *NetworkStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*NetworkStats) Export ¶
func (networkStats *NetworkStats) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus
type OpcountersReplStats ¶
type OpcountersReplStats struct { Insert float64 `bson:"insert"` Query float64 `bson:"query"` Update float64 `bson:"update"` Delete float64 `bson:"delete"` GetMore float64 `bson:"getmore"` Command float64 `bson:"command"` }
OpcountersReplStats opcounters stats
func (*OpcountersReplStats) Describe ¶
func (opCounters *OpcountersReplStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*OpcountersReplStats) Export ¶
func (opCounters *OpcountersReplStats) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.
type OpcountersStats ¶
type OpcountersStats struct { Insert float64 `bson:"insert"` Query float64 `bson:"query"` Update float64 `bson:"update"` Delete float64 `bson:"delete"` GetMore float64 `bson:"getmore"` Command float64 `bson:"command"` }
OpcountersStats opcounters stats
func (*OpcountersStats) Describe ¶
func (opCounters *OpcountersStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*OpcountersStats) Export ¶
func (opCounters *OpcountersStats) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.
type OperationStats ¶
type OperationStats struct { Fastmod float64 `bson:"fastmod"` Idhack float64 `bson:"idhack"` ScanAndOrder float64 `bson:"scanAndOrder"` }
OperationStats are the stats for some kind of operations.
func (*OperationStats) Export ¶
func (operationStats *OperationStats) Export(ch chan<- prometheus.Metric)
Export exports the operation stats.
type OplogCollectionStats ¶
type OplogCollectionStats struct { Count float64 `bson:"count"` Size float64 `bson:"size"` StorageSize float64 `bson:"storageSize"` }
OplogCollectionStats represents metrics about an oplog collection
func GetOplogCollectionStats ¶
func GetOplogCollectionStats(session *mgo.Session) (*OplogCollectionStats, error)
GetOplogCollectionStats fetches oplog collection stats
type OplogStatus ¶
type OplogStatus struct { TailTimestamp float64 HeadTimestamp float64 CollectionStats *OplogCollectionStats }
OplogStatus represents oplog metrics
func GetOplogStatus ¶
func GetOplogStatus(session *mgo.Session) *OplogStatus
GetOplogStatus fetches oplog collection stats
func (*OplogStatus) Describe ¶
func (status *OplogStatus) Describe(ch chan<- *prometheus.Desc)
Describe describes metrics collected
func (*OplogStatus) Export ¶
func (status *OplogStatus) Export(ch chan<- prometheus.Metric)
Export exports metrics to Prometheus
type PreloadStats ¶
type PreloadStats struct { Docs *BenchmarkStats `bson:"docs"` Indexes *BenchmarkStats `bson:"indexes"` }
PreloadStats are the stats associated with preload operation.
func (*PreloadStats) Export ¶
func (preloadStats *PreloadStats) Export(ch chan<- prometheus.Metric)
Export exposes the preload stats.
type ProfileStatus ¶ added in v1.1.0
func (*ProfileStatus) Describe ¶ added in v1.1.0
func (profileStatus *ProfileStatus) Describe(ch chan<- *prometheus.Desc)
func (*ProfileStatus) Export ¶ added in v1.1.0
func (profileStatus *ProfileStatus) Export(ch chan<- prometheus.Metric)
type QueryExecutorStats ¶
type QueryExecutorStats struct { Scanned float64 `bson:"scanned"` ScannedObjects float64 `bson:"scannedObjects"` }
QueryExecutorStats are the stats associated with a query execution.
func (*QueryExecutorStats) Export ¶
func (queryExecutorStats *QueryExecutorStats) Export(ch chan<- prometheus.Metric)
Export exports the query executor stats.
type QueueStats ¶
type QueueStats struct { Total float64 `bson:"total"` Readers float64 `bson:"readers"` Writers float64 `bson:"writers"` }
QueueStats queue stats
func (*QueueStats) Export ¶
func (queueStats *QueueStats) Export(ch chan<- prometheus.Metric)
Export exports the metrics to prometheus
type RawStatus ¶
type RawStatus struct { Name string `bson:"db,omitempty"` IndexSize int `bson:"indexSize,omitempty"` DataSize int `bson:"dataSize,omitempty"` Collections int `bson:"collections,omitempty"` Objects int `bson:"objects,omitempty"` Indexes int `bson:"indexes,omitempty"` }
RawStatus represents stats about a database shard
type ReadWriteLockTimes ¶
type ReadWriteLockTimes struct { Read float64 `bson:"R"` Write float64 `bson:"W"` ReadLower float64 `bson:"r"` WriteLower float64 `bson:"w"` }
ReadWriteLockTimes information about the lock
type RecordStats ¶
type RecordStats struct {
Moves float64 `bson:"moves"`
}
RecordStats are stats associated with a record.
func (*RecordStats) Export ¶
func (recordStats *RecordStats) Export(ch chan<- prometheus.Metric)
Export exposes the record stats.
type ReplSetStatus ¶
type ReplSetStatus struct { Set string `bson:"set"` Date time.Time `bson:"date"` MyState int32 `bson:"myState"` Term *int32 `bson:"term,omitempty"` HeartbeatIntervalMillis *float64 `bson:"heartbeatIntervalMillis,omitempty"` Members []Member `bson:"members"` }
ReplSetStatus keeps the data returned by the GetReplSetStatus method
func GetReplSetStatus ¶
func GetReplSetStatus(session *mgo.Session) *ReplSetStatus
GetReplSetStatus returns the replica status info
func (*ReplSetStatus) Describe ¶
func (replStatus *ReplSetStatus) Describe(ch chan<- *prometheus.Desc)
Describe describes the replSetGetStatus metrics for prometheus
func (*ReplSetStatus) Export ¶
func (replStatus *ReplSetStatus) Export(ch chan<- prometheus.Metric)
Export exports the replSetGetStatus stati to be consumed by prometheus
type ReplStats ¶
type ReplStats struct { Apply *ApplyStats `bson:"apply"` Buffer *BufferStats `bson:"buffer"` Network *MetricsNetworkStats `bson:"network"` PreloadStats *PreloadStats `bson:"preload"` }
ReplStats are the stats associated with the replication process.
func (*ReplStats) Export ¶
func (replStats *ReplStats) Export(ch chan<- prometheus.Metric)
Export exposes the replication stats.
type ServerStatus ¶
type ServerStatus struct { Uptime float64 `bson:"uptime"` UptimeEstimate float64 `bson:"uptimeEstimate"` LocalTime time.Time `bson:"localTime"` Asserts *AssertsStats `bson:"asserts"` Dur *DurStats `bson:"dur"` BackgroundFlushing *FlushStats `bson:"backgroundFlushing"` Connections *ConnectionStats `bson:"connections"` ExtraInfo *ExtraInfo `bson:"extra_info"` GlobalLock *GlobalLockStats `bson:"globalLock"` IndexCounter *IndexCounterStats `bson:"indexCounters"` Locks LockStatsMap `bson:"locks,omitempty"` Network *NetworkStats `bson:"network"` Opcounters *OpcountersStats `bson:"opcounters"` OpcountersRepl *OpcountersReplStats `bson:"opcountersRepl"` Mem *MemStats `bson:"mem"` Metrics *MetricsStats `bson:"metrics"` Cursors *Cursors `bson:"cursors"` StorageEngine *StorageEngineStats `bson:"storageEngine"` WiredTiger *WiredTigerStats `bson:"wiredTiger"` }
ServerStatus keeps the data returned by the serverStatus() method.
func GetServerStatus ¶
func GetServerStatus(session *mgo.Session) *ServerStatus
GetServerStatus returns the server status info.
func (*ServerStatus) Describe ¶
func (status *ServerStatus) Describe(ch chan<- *prometheus.Desc)
Describe describes the server status for prometheus.
func (*ServerStatus) Export ¶
func (status *ServerStatus) Export(ch chan<- prometheus.Metric)
Export exports the server status to be consumed by prometheus.
type StorageEngineStats ¶ added in v1.1.0
type StorageEngineStats struct {
Name string `bson:"name"`
}
StorageEngineStats
func (*StorageEngineStats) Describe ¶ added in v1.1.0
func (stats *StorageEngineStats) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (*StorageEngineStats) Export ¶ added in v1.1.0
func (stats *StorageEngineStats) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.
type StorageStats ¶
type StorageStats struct { BucketExhausted float64 `bson:"freelist.search.bucketExhausted"` Requests float64 `bson:"freelist.search.requests"` Scanned float64 `bson:"freelist.search.scanned"` }
StorageStats are the stats associated with the storage.
func (*StorageStats) Export ¶
func (storageStats *StorageStats) Export(ch chan<- prometheus.Metric)
Export exports the storage stats.
type TopStats ¶ added in v1.1.0
type TopStats struct { Total TopcounterStats `bson:"total"` ReadLock TopcounterStats `bson:"readLock"` WriteLock TopcounterStats `bson:"writeLock"` Queries TopcounterStats `bson:"queries"` GetMore TopcounterStats `bson:"getmore"` Insert TopcounterStats `bson:"insert"` Update TopcounterStats `bson:"update"` Remove TopcounterStats `bson:"remove"` Commands TopcounterStats `bson:"commands"` }
TopCollectionStats top collection stats
type TopStatsMap ¶ added in v1.1.0
TopStatsMap is a map of top stats
func (TopStatsMap) Describe ¶ added in v1.1.0
func (tops TopStatsMap) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics for prometheus
func (TopStatsMap) Export ¶ added in v1.1.0
func (topStats TopStatsMap) Export(ch chan<- prometheus.Metric)
Export exports the data to prometheus.
type TopStatus ¶ added in v1.1.0
type TopStatus struct {
TopStats TopStatsMap `bson:"totals,omitempty"`
}
TopStatus represents top metrics
func GetTopStats ¶ added in v1.1.0
GetTopStats fetches top stats
func GetTopStatus ¶ added in v1.1.0
func GetTopStatus(session *mgo.Session) *TopStatus
GetTopStatus fetches top stats
func (*TopStatus) Describe ¶ added in v1.1.0
func (status *TopStatus) Describe(ch chan<- *prometheus.Desc)
Describe describes metrics collected
func (*TopStatus) Export ¶ added in v1.1.0
func (status *TopStatus) Export(ch chan<- prometheus.Metric)
Export exports metrics to Prometheus
type TopcounterStats ¶ added in v1.1.0
TopcountersStats topcounters stats
type WTBlockManagerStats ¶ added in v1.1.0
type WTBlockManagerStats struct { MappedBytesRead float64 `bson:"mapped bytes read"` BytesRead float64 `bson:"bytes read"` BytesWritten float64 `bson:"bytes written"` MappedBlocksRead float64 `bson:"mapped blocks read"` BlocksPreLoaded float64 `bson:"blocks pre-loaded"` BlocksRead float64 `bson:"blocks read"` BlocksWritten float64 `bson:"blocks written"` }
blockmanager stats
func (*WTBlockManagerStats) Describe ¶ added in v1.1.0
func (stats *WTBlockManagerStats) Describe(ch chan<- *prometheus.Desc)
func (*WTBlockManagerStats) Export ¶ added in v1.1.0
func (stats *WTBlockManagerStats) Export(ch chan<- prometheus.Metric)
type WTCacheStats ¶ added in v1.1.0
type WTCacheStats struct { BytesTotal float64 `bson:"bytes currently in the cache"` BytesDirty float64 `bson:"tracked dirty bytes in the cache"` BytesInternalPages float64 `bson:"tracked bytes belonging to internal pages in the cache"` BytesLeafPages float64 `bson:"tracked bytes belonging to leaf pages in the cache"` MaxBytes float64 `bson:"maximum bytes configured"` BytesReadInto float64 `bson:"bytes read into cache"` BytesWrittenFrom float64 `bson:"bytes written from cache"` EvictedUnmodified float64 `bson:"unmodified pages evicted"` EvictedModified float64 `bson:"modified pages evicted"` PercentOverhead float64 `bson:"percentage overhead"` PagesTotal float64 `bson:"pages currently held in the cache"` PagesReadInto float64 `bson:"pages read into cache"` PagesWrittenFrom float64 `bson:"pages written from cache"` PagesDirty float64 `bson:"tracked dirty pages in the cache"` }
cache stats
func (*WTCacheStats) Describe ¶ added in v1.1.0
func (stats *WTCacheStats) Describe(ch chan<- *prometheus.Desc)
func (*WTCacheStats) Export ¶ added in v1.1.0
func (stats *WTCacheStats) Export(ch chan<- prometheus.Metric)
type WTConcurrentTransactionsStats ¶ added in v1.1.0
type WTConcurrentTransactionsStats struct { Write *WTConcurrentTransactionsTypeStats `bson:"read"` Read *WTConcurrentTransactionsTypeStats `bson:"write"` }
func (*WTConcurrentTransactionsStats) Describe ¶ added in v1.1.0
func (stats *WTConcurrentTransactionsStats) Describe(ch chan<- *prometheus.Desc)
func (*WTConcurrentTransactionsStats) Export ¶ added in v1.1.0
func (stats *WTConcurrentTransactionsStats) Export(ch chan<- prometheus.Metric)
type WTConcurrentTransactionsTypeStats ¶ added in v1.1.0
type WTConcurrentTransactionsTypeStats struct { Out float64 `bson:"out"` Available float64 `bson:"available"` TotalTickets float64 `bson:"totalTickets"` }
concurrenttransaction stats
type WTLogStats ¶ added in v1.1.0
type WTLogStats struct { TotalBufferSize float64 `bson:"total log buffer size"` TotalSizeCompressed float64 `bson:"total size of compressed records"` BytesPayloadData float64 `bson:"log bytes of payload data"` BytesWritten float64 `bson:"log bytes written"` RecordsUncompressed float64 `bson:"log records not compressed"` RecordsCompressed float64 `bson:"log records compressed"` RecordsProcessedLogScan float64 `bson:"records processed by log scan"` MaxLogSize float64 `bson:"maximum log file size"` LogFlushes float64 `bson:"log flush operations"` LogReads float64 `bson:"log read operations"` LogScansDouble float64 `bson:"log scan records requiring two reads"` LogScans float64 `bson:"log scan operations"` LogSyncs float64 `bson:"log sync operations"` LogSyncDirs float64 `bson:"log sync_dir operations"` LogWrites float64 `bson:"log write operations"` }
log stats
func (*WTLogStats) Describe ¶ added in v1.1.0
func (stats *WTLogStats) Describe(ch chan<- *prometheus.Desc)
func (*WTLogStats) Export ¶ added in v1.1.0
func (stats *WTLogStats) Export(ch chan<- prometheus.Metric)
type WTSessionStats ¶ added in v1.1.0
type WTSessionStats struct { Cursors float64 `bson:"open cursor count"` Sessions float64 `bson:"open session count"` }
session stats
func (*WTSessionStats) Describe ¶ added in v1.1.0
func (stats *WTSessionStats) Describe(ch chan<- *prometheus.Desc)
func (*WTSessionStats) Export ¶ added in v1.1.0
func (stats *WTSessionStats) Export(ch chan<- prometheus.Metric)
type WTTransactionStats ¶ added in v1.1.0
type WTTransactionStats struct { Begins float64 `bson:"transaction begins"` Checkpoints float64 `bson:"transaction checkpoints"` CheckpointsRunning float64 `bson:"transaction checkpoint currently running"` CheckpointMaxMs float64 `bson:"transaction checkpoint max time (msecs)"` CheckpointMinMs float64 `bson:"transaction checkpoint min time (msecs)"` CheckpointLastMs float64 `bson:"transaction checkpoint most recent time (msecs)"` CheckpointTotalMs float64 `bson:"transaction checkpoint total time (msecs)"` Committed float64 `bson:"transactions committed"` CacheOverflowFailure float64 `bson:"transaction failures due to cache overflow"` RolledBack float64 `bson:"transactions rolled back"` }
transaction stats
func (*WTTransactionStats) Describe ¶ added in v1.1.0
func (stats *WTTransactionStats) Describe(ch chan<- *prometheus.Desc)
func (*WTTransactionStats) Export ¶ added in v1.1.0
func (stats *WTTransactionStats) Export(ch chan<- prometheus.Metric)
type WiredTigerStats ¶ added in v1.1.0
type WiredTigerStats struct { BlockManager *WTBlockManagerStats `bson:"block-manager"` Cache *WTCacheStats `bson:"cache"` Log *WTLogStats `bson:"log"` Session *WTSessionStats `bson:"session"` Transaction *WTTransactionStats `bson:"transaction"` ConcurrentTransactions *WTConcurrentTransactionsStats `bson:"concurrentTransactions"` }
WiredTiger stats
func (*WiredTigerStats) Describe ¶ added in v1.1.0
func (stats *WiredTigerStats) Describe(ch chan<- *prometheus.Desc)
func (*WiredTigerStats) Export ¶ added in v1.1.0
func (stats *WiredTigerStats) Export(ch chan<- prometheus.Metric)
Source Files ¶
- asserts.go
- background_flushing.go
- collection_status.go
- conn_pool_stats.go
- conn_pool_stats_hosts.go
- connections.go
- cursors.go
- database_status.go
- durability.go
- extra_info.go
- global_lock.go
- index_counters.go
- locks.go
- memory.go
- metrics.go
- mongodb_collector.go
- network.go
- op_counters.go
- oplog_status.go
- profile_status.go
- replset_status.go
- server_status.go
- storage_engine.go
- top_counters.go
- top_status.go
- wiredtiger.go