Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.build
dependencies-stamp
mongodb_exporter
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MAINTAINER David Cuadrado <dacuad@facebook.com>
EXPOSE 9001

ENV GOPATH /go
ENV APPPATH $GOPATH/src/github.com/dcu/mongodb_exporter
ENV APPPATH $GOPATH/src/github.com/Percona-Lab/prometheus_mongodb_exporter
COPY . $APPPATH
RUN apk add --update -t build-deps go git mercurial libc-dev gcc libgcc \
&& cd $APPPATH && go get -d && go build -o /bin/mongodb_exporter \
Expand Down
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,45 @@
# Mongodb Exporter

Based on MongoDB exporter for prometheus.io, written in go (https://github.com/dcu/mongodb_exporter), but forked for full sharded support and structure changes.
Based on MongoDB exporter for prometheus.io, written in go (https://github.com/dcu/mongodb_exporter), but forked for full sharded support and structure changes.

## Building
### Features

- MongoDB Server Status metrics (*cursors, operations, indexes, storage, etc*)
- MongoDB Replica Set metrics (*members, ping, replication lag, etc*)
- MongoDB Replication Oplog metrics (*size, length in time, etc*)
- MongoDB Sharding metrics (*shards, chunks, db/collections, balancer operations*)
- MongoDB WiredTiger storage-engine metrics (*currently in beta/experimental state*)

### Building

export GO_VERSION=1.5.1 # if you wish to use your system version
make

### Usage

The exporter can be started by running the '*mongodb_exporter*' binary that is created in the build step. The exporter will try to connect to '*mongodb://localhost:27017*' (no auth) as default if no options are supplied.

It is recommended to define the following options:

- **-mongodb.uri** - The URI of the MongoDB port (*default: mongodb://localhost:27017*)
- **-auth.user** - The optional auth username (*default: none*)
- **-auth.pass** - The optional auth password (*default: none*)
- **-web.listen-address** - The listen address of the exporter (*default: ":9001"*)
- **-log_dir** - The directory to write the log file (*default: /tmp*)

*For more options see the help page with '-h' or '--help'*

## Note about how this works
### Note about how this works
Point the process to any mongo port and it will detect if it is a mongos, replicaset member, or stand alone mongod and return the appropriate metrics for that type of node. This was done to preent the need to an exporter per type of process.

## Roadmap
### Roadmap

- Document more configurations options here
- Stabilize WiredTiger support (*currently beta/experimental*)
- Add support for PerconaFT and RocksDB storage engines
- Write more go tests

### Contact

- Tim Vaillancourt - <tim.vaillancourt@percona.com>
- David Murphy - <david.murphy@percona.com>
17 changes: 0 additions & 17 deletions collector/mongod/asserts_test.go

This file was deleted.

16 changes: 0 additions & 16 deletions collector/mongod/background_flushing_test.go

This file was deleted.

15 changes: 0 additions & 15 deletions collector/mongod/connections_test.go

This file was deleted.

11 changes: 0 additions & 11 deletions collector/mongod/cursors_test.go

This file was deleted.

13 changes: 0 additions & 13 deletions collector/mongod/durability_test.go

This file was deleted.

11 changes: 0 additions & 11 deletions collector/mongod/extra_info_test.go

This file was deleted.

14 changes: 0 additions & 14 deletions collector/mongod/global_lock_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion collector/mongod/index_counters.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var (

//IndexCounterStats index counter stats
type IndexCounterStats struct {
Accesses float64 `bson:"accesses`
Accesses float64 `bson:"accesses"`
Hits float64 `bson:"hits"`
Misses float64 `bson:"misses"`
Resets float64 `bson:"resets"`
Expand Down
11 changes: 0 additions & 11 deletions collector/mongod/index_counters_test.go

This file was deleted.

16 changes: 0 additions & 16 deletions collector/mongod/locks_test.go

This file was deleted.

11 changes: 0 additions & 11 deletions collector/mongod/memory_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion collector/mongod/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ type CursorStats struct {
// Export exports the cursor stats.
func (cursorStats *CursorStats) Export(ch chan<- prometheus.Metric) {
metricsCursorTimedOutTotal.Set(cursorStats.TimedOut)
metricsCursorOpen.WithLabelValues("noTimeout").Set(cursorStats.Open.NoTimeout)
metricsCursorOpen.WithLabelValues("timed_out").Set(cursorStats.Open.NoTimeout)
metricsCursorOpen.WithLabelValues("pinned").Set(cursorStats.Open.Pinned)
metricsCursorOpen.WithLabelValues("total").Set(cursorStats.Open.Total)
}
Expand Down
33 changes: 0 additions & 33 deletions collector/mongod/metrics_test.go

This file was deleted.

11 changes: 0 additions & 11 deletions collector/mongod/network_test.go

This file was deleted.

11 changes: 0 additions & 11 deletions collector/mongod/op_counters_test.go

This file was deleted.

Loading