Giter VIP home page Giter VIP logo

mongodb_exporter's Introduction

Mongodb Exporter

MongoDB exporter for prometheus.io, written in go.

screenshot

Grafana Dashboard

Installing

Download a release

Building

Requires glide for dependency management

git clone [email protected]:dcu/mongodb_exporter.git $GOPATH/src/github.com/dcu/mongodb_exporter
cd $GOPATH/src/github.com/dcu/mongodb_exporter
make build
./mongodb_exporter -h

Building Docker image

Build the Docker image

docker build -t mongodb_exporter .

Verify Docker image runs

docker run --rm mongodb_exporter -h

The mongodb url can contain credentials which can be seen by other users on the system when passed in as command line flag. To pass in the mongodb url securely, you can set the MONGODB_URL environment variable instead.

Available groups of data

Name Description
asserts The asserts group reports the number of asserts on the database. While assert errors are typically uncommon, if there are non-zero values for the asserts, you should check the log file for the mongod process for more information. In many cases these errors are trivial, but are worth investigating.
durability The durability group contains data regarding the mongod's journaling-related operations and performance. mongod must be running with journaling for these data to appear in the output of "serverStatus".
background_flushing mongod periodically flushes writes to disk. In the default configuration, this happens every 60 seconds. The background_flushing group contains data regarding these operations. Consider these values if you have concerns about write performance and journaling.
connections The connections groups contains data regarding the current status of incoming connections and availability of the database server. Use these values to assess the current load and capacity requirements of the server.
extra_info The extra_info group holds data collected by the mongod instance about the underlying system. Your system may only report a subset of these fields.
global_lock The global_lock group contains information regarding the database’s current lock state, historical lock status, current operation queue, and the number of active clients.
index_counters The index_counters groupp reports information regarding the state and use of indexes in MongoDB.
network The network group contains data regarding MongoDB’s network use.
op_counters The op_counters group provides an overview of database operations by type and makes it possible to analyze the load on the database in more granular manner. These numbers will grow over time and in response to database use. Analyze these values over time to track database utilization.
op_counters_repl The op_counters_repl group, similar to the op_counters data structure, provides an overview of database replication operations by type and makes it possible to analyze the load on the replica in more granular manner. These values only appear when the current host has replication enabled. These values will differ from the opcounters values because of how MongoDB serializes operations during replication. These numbers will grow over time in response to database use. Analyze these values over time to track database utilization.
memory The memory group holds information regarding the target system architecture of mongod and current memory use
locks The locks group containsdata that provides a granular report on MongoDB database-level lock use
metrics The metrics group holds a number of statistics that reflect the current use and state of a running mongod instance.
cursors The cursors group contains data regarding cursor state and use. This group is disabled by default because it is deprecated in mongodb >= 2.6.
top The top group provides an overview of database operations by type for each database collections and makes it possible to analyze the load on the database in more granular manner. These numbers will grow over time and in response to database use. Analyze these values over time to track database utilization. For more information see the official documentation.

For more information see the official documentation.

Roadmap

mongodb_exporter's People

Contributors

avishefi avatar axinojolais avatar bamarni avatar bewt85 avatar blaubaer avatar dcu avatar deepthawtz avatar discordianfish avatar edwardbetts avatar georgelee1 avatar jacksontj avatar kuadrosx avatar mattyw avatar raul-te avatar saada avatar simonrondelez avatar tux21b avatar vgarcia-te avatar zerok avatar zhihuifan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mongodb_exporter's Issues

MongoDB exporter fails

Cant launch mongodb exporter , on my local MogoDB log -
15:06:54.295 [initandlisten] connection accepted from 127.0.0.1:35964 #7 (1 connection now open)
15:06:54.302 [conn7] end connection 127.0.0.1:35964 (0 connections now open)

System - Debian GNU/Linux 8

mongod debian

List all commands | Replica set status

Mongo
db version v2.4.10
git hash: nogitversion
sys info: Linux brahms 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 i686 BOOST_LIB_VERSION=1_55
uptime: 7500 seconds

root@debian:/etc# go version
go version go1.4.2 linux/386

root@debian:/etc# go-bindata -version
go-bindata 3.1.0 (Go runtime go1.4.2).
Copyright (c) 2010-2013, Jim Teeuwen.

konsole output
root@debian:/home/dima/Downloads/adds/mongodb_exporter-master# mongodb_exporter
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1 pc=0x809862c]

goroutine 1 [running]:
github.com/dcu/mongodb_exporter/collector.(_StorageStats).Export(0x0, 0x187c6420, 0x25)
/usr/local/go/src/github.com/dcu/mongodb_exporter/collector/metrics.go:155 +0x4c
github.com/dcu/mongodb_exporter/collector.(_MetricsStats).Export(0x187ba400, 0x83a48e8, 0x7)
/usr/local/go/src/github.com/dcu/mongodb_exporter/collector/metrics.go:177 +0x1c6
github.com/dcu/mongodb_exporter/collector.exportData(0xb75007d8, 0x187ba400, 0x83a48e8, 0x7)
/usr/local/go/src/github.com/dcu/mongodb_exporter/collector/server_status.go:79 +0x11d
github.com/dcu/mongodb_exporter/collector.(_ServerStatus).Export(0x18740840, 0x83b2f78, 0x8)
/usr/local/go/src/github.com/dcu/mongodb_exporter/collector/server_status.go:68 +0x3ed
github.com/dcu/mongodb_exporter/collector.(_MongodbCollector).collectServerStatus(0x187ab780, 0x0, 0x83e7268)
/usr/local/go/src/github.com/dcu/mongodb_exporter/collector/mongodb_collector.go:42 +0x53
github.com/dcu/mongodb_exporter/collector.NewMongodbCollector(0x83e7268, 0x19, 0x8563efc)
/usr/local/go/src/github.com/dcu/mongodb_exporter/collector/mongodb_collector.go:21 +0x69
main.main()
/usr/local/go/src/github.com/dcu/mongodb_exporter/mongodb_exporter.go:76 +0x74

goroutine 7 [chan receive]:
github.com/golang/glog.(*loggingT).flushDaemon(0x8564a60)
/usr/local/go/src/github.com/golang/glog/glog.go:879 +0x76
created by github.com/golang/glog.init·1
/usr/local/go/src/github.com/golang/glog/glog.go:410 +0x1ff

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_386.s:2287 +0x1

goroutine 8 [sleep]:
gopkg.in/mgo%2ev2.(*mongoCluster).syncServersLoop(0x18730990)
/usr/local/go/src/gopkg.in/mgo.v2/cluster.go:366 +0x20f
created by gopkg.in/mgo%2ev2.newCluster
/usr/local/go/src/gopkg.in/mgo.v2/cluster.go:76 +0x1b4

goroutine 12 [runnable]:
net.(_pollDesc).Wait(0x187294f8, 0x72, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:84 +0x42
net.(_pollDesc).WaitRead(0x187294f8, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:89 +0x40
net.(_netFD).Read(0x187294c0, 0x18782d50, 0x24, 0x24, 0x0, 0xb74fed58, 0x1879898c)
/usr/local/go/src/net/fd_unix.go:242 +0x2f0
net.(_conn).Read(0x187ab840, 0x18782d50, 0x24, 0x24, 0x0, 0x0, 0x0)
/usr/local/go/src/net/net.go:121 +0xba
gopkg.in/mgo%2ev2.fill(0xb7500468, 0x187ab840, 0x18782d50, 0x24, 0x24, 0x0, 0x0)
/usr/local/go/src/gopkg.in/mgo.v2/socket.go:504 +0x58
gopkg.in/mgo%2ev2.(*mongoSocket).readLoop(0x18794f80)
/usr/local/go/src/gopkg.in/mgo.v2/socket.go:521 +0x11f
created by gopkg.in/mgo%2ev2.newSocket
/usr/local/go/src/gopkg.in/mgo.v2/socket.go:168 +0x2f6

goroutine 13 [sleep]:
gopkg.in/mgo%2ev2.(*mongoServer).pinger(0x18701220, 0x1)
/usr/local/go/src/gopkg.in/mgo.v2/server.go:297 +0x138
created by gopkg.in/mgo%2ev2.newServer
/usr/local/go/src/gopkg.in/mgo.v2/server.go:90 +0x159
root@debian:/home/dima/Downloads/adds/mongodb_exporter-master#

Please consider cutting a release

Hi!

I see that there has been quite some activity since the last release. Are there plans for a new release soon, or are you not planning in doing more releases?

Thanks!

git tags

@dcu let's start tagging releases. it is getting difficult to tell what version people are deploying and issues and fixes are related to.

How do you feel about setting HEAD to v1.0.0 and going from there?

error: unknown shared.MongoSessionOpts field

Hello!

Trying to compile latest master, got this error:

collector/mongodb_collector.go:30: unknown shared.MongoSessionOpts field 'TlsCertificateFile' in struct literal
collector/mongodb_collector.go:31: unknown shared.MongoSessionOpts field 'TlsPrivateKeyFile' in struct literal
collector/mongodb_collector.go:32: unknown shared.MongoSessionOpts field 'TlsCaFile' in struct literal
collector/mongodb_collector.go:33: unknown shared.MongoSessionOpts field 'TlsHostnameValidation' in struct literal

Compile using this container docker container tag 1.6

P.S. install missing dependence with command

go get -u github.com/golang/glog

Huge info log files

We run the exporter since 2/3 weeks and we noticed that the exporter writes massive info logs. This should be optional. Is there actual a way to deactivate the logs?

Here the output from a server

root@db33:/var/lib/docker/aufs/mnt/d1f20f50bd4ff60948f2fdb3b770e1588cbbe2b9e19aa625273efbdff5901e05/tmp# ls -lah
insgesamt 2,2G
drwxrwxrwt  2 root root 4,0K Dez 21 17:53 .
drwxr-xr-x 31 root root 4,0K Dez  8 22:23 ..
-rw-r--r--  1 root root  42M Dez  8 22:16 mongodb_exporter.db33.root.log.INFO.20151208-140732.1
-rw-r--r--  1 root root 1,8G Dez 21 17:53 mongodb_exporter.db33.root.log.INFO.20151208-212356.1
-rw-r--r--  1 root root 366M Dez 24 08:21 mongodb_exporter.db33.root.log.INFO.20151221-165349.1
lrwxrwxrwx  1 root root   53 Dez 21 17:53 mongodb_exporter.INFO -> mongodb_exporter.db33.root.log.INFO.20151221-165349.1

Some error occured while retrieving from mongodb.

Hi, I found some error to tell you.
I can connect "http://127.0.0.1:9001/metrics".
and I can see the metrics about mongodb.
But some errors occured. My mongo DB version is 3.4.7
Here is error message.

E0828 10:38:49.825895 21966 replset_status.go:232] Failed to get replSet status. E0828 10:38:49.826988 21966 oplog_status.go:127] Failed to get local.oplog_rs collection stats. E0828 10:48:17.029035 21966 replset_status.go:232] Failed to get replSet status. E0828 10:48:17.029788 21966 oplog_status.go:127] Failed to get local.oplog_rs collection stats.

cant build

Hi,

Build fails with

~/Prometheus/mongo_exporter/src/github.com/dcu/mongodb_exporter$ make build
go get -u github.com/prometheus/client_golang/prometheus
# github.com/prometheus/common/model
../../prometheus/common/model/signature.go:33:17: error: reference to undefined identifier ‘sync.Pool’
  hashAndBufPool sync.Pool
                 ^
make: *** [deps] Error 2

ideas?

(still on Mongo 2.4)

travis CI setup

Could we set up a Travis CI project for this repo? Would be helpful to track test coverage + run CI against pull requests

Get http://10.25.167.139:9001/metrics: dial tcp 10.25.167.139:9001: getsockopt: connection refused

./mongodb_exporter-linux-amd64 -mongodb.uri=mongodb://10.25.167.139:24000/ssf_h5 -auth.pass=zqbs@2017 -auth.user=deployop
cnsz142414:24000:hybrid >Listening on :9001 (scheme=HTTP, secured=no, clientValidation=no)

cnsz142414:24000:hybrid >netstat -an|grep 9001
tcp 0 0 0.0.0.0:9001 0.0.0.0:* LISTEN
tcp 0 0 10.25.167.139:9001 10.25.167.129:37895 TIME_WAIT
tcp 0 0 10.25.167.139:9001 10.25.167.129:38014 TIME_WAIT

the mongodb server has listen the port 9001,and prometheusServer can telnet 10.25.167.139 9001
why it happend?

My mongodb has any promble?

Not seeing the correct stats

I am not seeing any of the stats for the actual database..
examples of what I am seeing.. NO OP counters etc - Do I need to create an ID that can get the stats see startup below..

http_response_size_bytes{handler="prometheus",quantile="0.5"} 1365
http_response_size_bytes{handler="prometheus",quantile="0.9"} 1368
http_response_size_bytes{handler="prometheus",quantile="0.99"} 1368
http_response_size_bytes_sum{handler="prometheus"} 34427
http_response_size_bytes_count{handler="prometheus"} 22

HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.

TYPE process_cpu_seconds_total counter

process_cpu_seconds_total 0.09

HELP process_max_fds Maximum number of open file descriptors.

TYPE process_max_fds gauge

process_max_fds 1024

HELP process_open_fds Number of open file descriptors.

TYPE process_open_fds gauge

process_open_fds 7

HELP process_resident_memory_bytes Resident memory size in bytes.

TYPE process_resident_memory_bytes gauge

process_resident_memory_bytes 9.928704e+06

HELP process_start_time_seconds Start time of the process since unix epoch in seconds.

TYPE process_start_time_seconds gauge

process_start_time_seconds 1.52547184559e+09

HELP process_virtual_memory_bytes Virtual memory size in bytes.

TYPE process_virtual_memory_bytes gauge

./mongodb_exporter-linux-amd64 -groups.enabled 'asserts,durability,background_flusshing,connections,extra_info,global_lock,index_counters,network,op_counters,op_counters_repl,memory,locks,metrics' -mongodb.collect.database -mongodb.collect.oplog -logtostderr -mongodb.tls-disable-hostname-validation -mongodb.uri mongdb:/admin:[email protected]:27017

I am seeing this message in the log.

6773 connection.go:48] Cannot connect to server using url mongdb:/admin:[email protected]:27017: server returned error on SASL authentication step: Authentication failed.

monogdb_exporter crashed

As a test, I compiled the master branch on Amazon Linux ec2 using golang 1.10.1, and ran exporter on two ec2 instances. But they crashed. I checked the log directory, but no any info logged since started.

I tested a few times. It always crashes in a few hours.

how to troubleshoot this problem? Thanks.

Metrics when mongodb is not available

It would be nice if this plugin exported a new metric signaling mongodb availability. There are other exporters doing that (ex. haproxy_exporter). Following the convention, it would be:

mongodb_up x ; where x=0 mongo is down; x=1 mongodb is avaialable.

What is the metrics to find the db is down or not?

I see a lot of metrics, but is there any metric which helps to find whether the db is down or not?
Uptime doesn't do the job. (or am i missing something?) I thought if the connection goes to 0, then it potentially means the db is down. Is there a better way?
Thanks.

Add logRotate to mongodb_exporter

Hi @dcu
Currently I'm using mongodb_expoerter in my environment, and I don't want to install too many agents. Now I want a feature to a different url path.

  1. allow a user to logRotate regularly. Like once per day
  2. configure a log retention policy so that the old log can be purged automatically.

I know it is not part of Prometheus agent, so I want to know if it is welcome to send such PR to this repo. Personally, I do want add it.

Thanks

SASL Authentication failed

Hi,

I cannot connect to MongoDB instance that has authentication enabled in it.
MongoDB version 3.2.6, Debian Wheezy.

Best regards

Mongo SSL support

I have the following mongo url

mongodb://user:[email protected],10.136.68.125,10.136.67.178:27017/admin?replicaSet=demo-rs0&ssl=true

This however gives me the error

connection.go:35] Cannot connect to server using url "mongodb://user:[email protected],10.136.68.125,10.136.67.178:27017/admin?replicaSet=demo-rs0&ssl=true" : unsupported connection URL option: ssl=true

Is it possible to connect to a mongo replicaset with ssl enabled?

monitore several replica sets

Hi,

I tweaked the mongodb.uri parameter in many ways but I am not able to monitore several replica sets on a same machine with one mongodb_exporter.

Should we use one exporter by RS ?

Compatibility with latest prometheus client

Unfortunately the latest client does not allow one to set counters to specific values anymore, which breaks mongodb_exporter. There are two different branches around, one trying to solve the problem with Reset()s and recreating counters, the other vendors the old client.

It would be nice to get at least one of the approaches merged, so that other features can be developed/updated in the respective way.

Stale / Incorrect replset_member_state metrics

Hi,

I have a replica set setup with three nodes (deployed to rancher). The mongodb exporter is a sidekick to my mongodb container, meaning for each mongo instance there is also an exporter instance that is being scraped. However i'm seeing some strange behaviour in the replset_member_state metric.

The issue is, if a member of the replica set goes to any state, this is reported as a new series which then stays forever in the exporter. E.g. after taking my mongo_3 node down and bringing it back up the metrics endpoint reports the following for member_state:

mongodb_replset_member_state{name="MongoDB_mongo_1:27017",set="rs0",state="PRIMARY"} 1
mongodb_replset_member_state{name="MongoDB_mongo_2:27017",set="rs0",state="SECONDARY"} 2
mongodb_replset_member_state{name="MongoDB_mongo_2:27017",set="rs0",state="STARTUP"} 0
mongodb_replset_member_state{name="MongoDB_mongo_3:27017",set="rs0",state="(not reachable/healthy)"} 8
mongodb_replset_member_state{name="MongoDB_mongo_3:27017",set="rs0",state="SECONDARY"} 2

This means it's not possible to write a query that tells you the current state of each member, as there will be a series for each state that the member has been in, and the series is never removed from the metrics endpoint.

I suppose the fix for this is to remove the state label from this metric, as the integer value of the metric is the actual state. I.e. the only labels for this metric should be set name and name of the member. Then we could write a query to tell us the current state of all members, which AFAICT is not possible at the moment.

glide.sh has broken.

Hi, guys~
here is one problem: when I up the mongodb_exporter, it's broken~, it said:
curl: (6) Couldn't resolve host 'glide.sh'
So I tired to curl https://glide.sh/get, ok ~ it still down :(

Error during `Docker build`

Hello, I'm getting an error during Docker build

git clone https://github.com/dcu/mongodb_exporter.git
cd mongodb_exporter
$ docker build -t mongodb_exporter .
...
Step 5/11 : RUN cd /go/src/github.com/dcu/mongodb_exporter && make release
 ---> Running in fc15077416cc
glide install
...
[INFO]	Replacing existing vendor dependencies
mkdir -p release
perl -p -i -e 's/{{VERSION}}/v1.0.0/g' mongodb_exporter.go
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/{{ <-- HERE VERSION}}/ at -e line 1.
make: *** [Makefile:19: release] Error 255
The command '/bin/sh -c cd /go/src/github.com/dcu/mongodb_exporter && make release' returned a non-zero code: 2

Suggest using alpine:latest in the Dockerfile

I suggest to use latest (stable) version of alpine instead of edge. Otherwise, it will get the following error:

$ docker build -t my-mongodb-exporter:latest .
Sending build context to Docker daemon 534.5 kB
Step 0 : FROM alpine:edge
 ---> 809d1eb48c44
... (skipped)
Step 6 : 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     && apk del --purge build-deps && rm -rf $GOPATH
 ---> Running in 8492375aae69
fetch http://dl-4.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  build-deps-0:
    masked in: cache
    satisfies: world[build-deps]
  go (missing):
    required by:
The command '/bin/sh -c apk add --update -t build-deps go git mercurial libc-dev gcc libgcc     && cd $APPPATH && go get -d && go build -o /bin/mongodb_exporter     && apk del --purge build-deps && rm -rf $GOPATH' returned a non-zero code: 2

After I change it into latest, everything goes just fine.

metrics broken down by mongodb host

When providing a -mongodb.uri argument w/ multiple hosts there is no breakdown of metrics per host/instance, only aggregate.

Not sure if this is a problem for anyone else but I think it would be nice to see which host in sharded cluster is experiencing issues (cpu, memory, etc).

Are there workarounds or plans to add an instance label to metrics?

Race condition when requesting `/metrics` more than once at the same time

If you start up the exporter and run curl http://localhost:9001/metrics & curl http://localhost:9001/metrics you will get back at least one 500 error.

The error messages all look like

collected metric mongodb_db_indexes_total label:<name:"db" value:"my-db" > label:<name:"shard" value:"" > gauge:<value:2 >  was collected before with the same name and label values

This is a problem for us because our HA Prometheus setup tends to hit the exporter again while the exporter is still processing a request for another Prometheus instance.

Thanks!

Hidden node

I dont see metrics from a hidden node in my replset.

Is that by design or am I doing something wrong?

data collecting interval

Hello,

image
Can someone help me why I am seeing spikes of data rather than continuous data?
I have spike in numbers from prometheus.
image

it seems mongodb server status is not constantly updated.

I appreciate your help.

Rock

Monitor collection statistics

Is there a way to monitor activity on a per-collection basis?

Something like operations per second, but per collection too.

This would help to follow and investigate which collection triggers system load, or even dependencies between collections.

Thank you!

Mongo3 support.

This works really well with mongo 2, but crashes with mongo3. Mongo 3 support would be super awesome.

Metrics don't seem right

I'm running mongodb_exporter on a three node mongodb cluster, so there are thee instances of mongodb_exporter which are being scraped by prometheus.
It looks as at least some of the metrics rerieved by mongodb_exporter are not correct. Let's consider mongodb_op_counters_repl_total, mongodb_exporter is given the exact same value on all three servers:

 mongodb_op_counters_repl_total{type="command"} 1
 mongodb_op_counters_repl_total{type="delete"} 20194
 mongodb_op_counters_repl_total{type="getmore"} 0
 mongodb_op_counters_repl_total{type="insert"} 40110
 mongodb_op_counters_repl_total{type="query"} 0
 mongodb_op_counters_repl_total{type="update"} 158048

But db.serverStatus() in mongo shell gives different values
On server 1:

"opcountersRepl" : {
                "insert" : 11187,
                "query" : 0,
                "update" : 88010,
                "delete" : 8595,
                "getmore" : 0,
                "command" : 1
        },

On server 2:

"opcountersRepl" : {
                "insert" : 40110,
                "query" : 0,
                "update" : 158054,
                "delete" : 20194,
                "getmore" : 0,
                "command" : 1
        },

On server 3:

"opcountersRepl" : {
                "insert" : 28948,
                "query" : 0,
                "update" : 70113,
                "delete" : 11600,
                "getmore" : 0,
                "command" : 0
        },

It looks like all three exporter instances return values from server 2 (which is currenlty not the primary, btw).

Maybe I'm having some fundamental misunderstanding?

./mongodb_exporter.go:39: r.BasicAuth undefined

Hi -
Could you please advise on the below.

[root@localhost:~/go/packages/src/github.com/dcu/mongodb_exporter]# go build

github.com/dcu/mongodb_exporter

./mongodb_exporter.go:39: r.BasicAuth undefined (type *http.Request has no field or method BasicAuth)

Hope to get an advise at the earliest.

Thanks!

Grafana Dashboard

Hello!

Does anybody have grafana dashboard for that exporter?

It will be really cool if somebody can share it.

Thanks a lot!

Dashboard mongodb_replset_oplog_head_timestamp => mongodb_replset_oplog_tail_timestamp

In the dashboard you referenced, I noticed that the oplog lag was based on mongodb_replset_oplog_head_timestamp but IMO it should use use the tail counterpart mongodb_replset_oplog_tail_timestamp no?

The head according to collector/oplog_status.go is calling GetOplogTimestamp(.., false) which will show the oldest value instead of the newest.

Btw, head should be the most recent and tail the oldest oplog entry don't you think?

It might not have it's place here but I don't know how to contact the one maintaining the dashboard and you referenced it.

Stale/wrong values for (at least) mongodb_network_bytes_total

Hi,

I'm trying to use the mongodb_exporter but realize some odd issues. It's somehow not exposing the actual numbers for the mongodb_network_bytes_total sometimes. This is the output of curling the exporter every second:

mongodb_network_bytes_total{state="in_bytes"} 1.8038162909e+10
mongodb_network_bytes_total{state="in_bytes"} 1.8038213018e+10
mongodb_network_bytes_total{state="in_bytes"} 1.8038257311e+10
mongodb_network_bytes_total{state="in_bytes"} 1.8038289814e+10
mongodb_network_bytes_total{state="in_bytes"} 1.8038336711e+10
mongodb_network_bytes_total{state="in_bytes"} 1.22594549377e+11
mongodb_network_bytes_total{state="in_bytes"} 1.803846286e+10
mongodb_network_bytes_total{state="in_bytes"} 1.8038546902e+10
mongodb_network_bytes_total{state="in_bytes"} 1.8038588227e+10
mongodb_network_bytes_total{state="in_bytes"} 1.8038659031e+10
mongodb_network_bytes_total{state="in_bytes"} 4.974604715e+09
mongodb_network_bytes_total{state="in_bytes"} 5.00446282153e+11
mongodb_network_bytes_total{state="in_bytes"} 5.00446395761e+11
mongodb_network_bytes_total{state="in_bytes"} 4.974617148e+09
mongodb_network_bytes_total{state="in_bytes"} 5.00446665747e+11
mongodb_network_bytes_total{state="in_bytes"} 1.8039037928e+10
mongodb_network_bytes_total{state="in_bytes"} 5.00446920076e+11
mongodb_network_bytes_total{state="in_bytes"} 1.22597290424e+11

I've checked mongodb and those aren't counter resets or something. I suspect there is some issues with the shared/, maybe it creates two counters with the same name or something.
Will investigate this more next week.

deployment question

how are people using mongodb_exporter to monitor several different mongodb clusters? Do you A) deploy a single mongodb_exporter with one big long -mongodb.uri option or B) deploy a separate mongodb_exporter instance per cluster?

I'm leaning toward option B since that would allow me to easily segment and tag each scrape source.

Thanks.

Metric Namespacing

I noticed an issue that was opened to allow namespacing of the metrics from the mongodb exporter. Is this functionality now part of the exporter?

If not is there any plans to make it so?

Thanks

Abel

Multiple gauge entries for replset members

In replset_status.go state is being included as part of the label which can result in multiple gauge entries for a single host if it changes status.

For example, when a node has become unreachable it's state is set as "(not reachable/healthy)". When it reverts to it's usual "PRIMARY" or "SECONDARY" the old entry for the not reachable status persists in the /metrics endpoint.

mongodb_replset_member_health{name="<mongodbhost>",set="<myreplset>",state="(not reachable/healthy)"} 0
mongodb_replset_member_health{name="<mongodbhost>",set="<myreplset>",state="SECONDARY"} 1

state should be part of the label for the replset gauges as it is a changeable value.

How can I see the wiredTiger metrics?

Hi, I just have a question about mongodb_exporter.
I installed mongodb_exporter and executed it like this.

./mongodb_exporter -groups.enabled "asserts,durability,background_flushing,connections,extra_info,global_lock,index_counters,network,op_counters,op_counters_repl,memory,locks,metrics,wiredTiger" -mongodb.collect.database -mongodb.collect.top -mongodb.collect.connpoolstats -mongodb.collect.collection

But I could not find wiredTiger metrics on "http://localhost:9001/metrics".
How can I find or see the wiredTiger metrics on mongodb_exporter?

Get replication lag in an easy way

Currently we have some metrics like

mongodb_replset_member_optime_date{name="a:27017",set="stgResource",state="SECONDARY"} 1.494836609e+09
mongodb_replset_member_optime_date{name="b:27017",set="stgResource",state="PRIMARY"} 1.494836609e+09

but I can't the the replication lag easily with Prometheus recording rule. Do you have any suggestion on this?

is it ok to expose the replication_lag for current instance directly?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.