telegraf/plugins/inputs/mongodb
Daniel Nelson b277e6e2d7 Fix support for mongodb/leofs urls without scheme (#2900)
This was broken by changes in go 1.8 to url.Parse.  This change allows
the string but prompts the user to move to the correct url string.
2017-06-08 16:52:01 -07:00
..
README.md Fix support for mongodb/leofs urls without scheme (#2900) 2017-06-08 16:52:01 -07:00
mongodb.go Fix support for mongodb/leofs urls without scheme (#2900) 2017-06-08 16:52:01 -07:00
mongodb_data.go MongoDB input plugin: Improve state data (#2001) 2016-12-16 13:46:32 +00:00
mongodb_data_test.go Fixed inconsistency between HasIntField and IntField (#2813) 2017-05-16 15:25:30 -07:00
mongodb_server.go mongodb: Remove superfluous ReplSet log message 2017-01-11 17:50:01 +00:00
mongodb_server_test.go Fixed inconsistency between HasIntField and IntField (#2813) 2017-05-16 15:25:30 -07:00
mongodb_test.go Use timeout smaller than 10 seconds 2016-04-04 16:10:23 -06:00
mongostat.go Fix panic in mongo input (#2848) 2017-05-30 11:02:26 -07:00

README.md

Telegraf plugin: MongoDB

Configuration

[[inputs.mongodb]]
  ## An array of URLs of the form:
  ##   "mongodb://" [user ":" pass "@"] host [ ":" port]
  ## For example:
  ##   mongodb://user:auth_key@10.10.3.30:27017,
  ##   mongodb://10.10.3.33:18832,
  servers = ["mongodb://127.0.0.1:27017"]
  gather_perdb_stats = false

  ## Optional SSL Config
  # ssl_ca = "/etc/telegraf/ca.pem"
  # ssl_cert = "/etc/telegraf/cert.pem"
  # ssl_key = "/etc/telegraf/key.pem"
  ## Use SSL but skip chain & host verification
  # insecure_skip_verify = false

This connection uri may be different based on your environment and mongodb setup. If the user doesn't have the required privilege to execute serverStatus command the you will get this error on telegraf

Error in input [mongodb]: not authorized on admin to execute command { serverStatus: 1, recordStats: 0 }

Description

The telegraf plugin collects mongodb stats exposed by serverStatus and few more and create a single measurement containing values e.g.

  • active_reads
  • active_writes
  • commands_per_sec
  • deletes_per_sec
  • flushes_per_sec
  • getmores_per_sec
  • inserts_per_sec
  • net_in_bytes
  • net_out_bytes
  • open_connections
  • percent_cache_dirty
  • percent_cache_used
  • queries_per_sec
  • queued_reads
  • queued_writes
  • resident_megabytes
  • updates_per_sec
  • vsize_megabytes
  • ttl_deletes_per_sec
  • ttl_passes_per_sec
  • repl_lag
  • jumbo_chunks (only if mongos or mongo config)

If gather_db_stats is set to true, it will also collect per database stats exposed by db.stats() creating another measurement called mongodb_db_stats and containing values:

  • collections
  • objects
  • avg_obj_size
  • data_size
  • storage_size
  • num_extents
  • indexes
  • index_size
  • ok