Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cursor metrics to MongoDB plugin #3480

Closed
torrick opened this issue Nov 16, 2017 · 4 comments
Closed

Add cursor metrics to MongoDB plugin #3480

torrick opened this issue Nov 16, 2017 · 4 comments
Labels
area/mongodb feature request Requests for new plugin and for new features to existing plugins
Milestone

Comments

@torrick
Copy link

torrick commented Nov 16, 2017

Feature Request

Opening a feature request kicks off a discussion.

Proposal:

Add Cursor metrics to MongoDb plugin

Current behavior:

Cursor metrics are not included in the collection process.

Desired behavior:

Cursor metrics would be included in with the MongoDb collection process.

Use case:

Leaking cursors in MongoDB is a fairly common operational problem and it would be nice to collect that metric with telegraf. We're already collecting many things from db.serverStatus() so it would just be including something that's already present in that output.

db.serverStatus().metrics.cursor
{
	"timedOut" : NumberLong(0),
	"open" : {
		"noTimeout" : NumberLong(0),
		"pinned" : NumberLong(0),
		"total" : NumberLong(0)
	}
}
@danielnelson danielnelson added area/mongodb feature request Requests for new plugin and for new features to existing plugins labels Nov 17, 2017
@danielnelson
Copy link
Contributor

@grubernaut Do you have any thoughts on this?

@grubernaut
Copy link
Contributor

@danielnelson sure, I can take a stab at this, depending on $load at work in the next couple days.

grubernaut added a commit to grubernaut/telegraf that referenced this issue May 7, 2018
Fixes: influxdata#3480

```
$ GOCACHE=off go test -v -tags=integration ./...
=== RUN   TestAddNonReplStats
--- PASS: TestAddNonReplStats (0.00s)
=== RUN   TestAddReplStats
--- PASS: TestAddReplStats (0.00s)
=== RUN   TestAddWiredTigerStats
--- PASS: TestAddWiredTigerStats (0.00s)
=== RUN   TestAddShardStats
--- PASS: TestAddShardStats (0.00s)
=== RUN   TestAddShardHostStats
--- PASS: TestAddShardHostStats (0.00s)
=== RUN   TestStateTag
--- PASS: TestStateTag (0.00s)
=== RUN   TestGetDefaultTags
--- PASS: TestGetDefaultTags (0.00s)
=== RUN   TestAddDefaultStats
--- PASS: TestAddDefaultStats (0.01s)
PASS
ok      github.com/influxdata/telegraf/plugins/inputs/mongodb   0.012s
```

```
$ ./telegraf --config ~/tele-conf --test
> mongodb,host=foo,hostname=127.0.0.1:27017 active_reads=1i,active_writes=0i,commands_per_sec=4i,cursor_no_timeout=0i,cursor_pinned=0i,cursor_timed_out=0i,cursor_total=0i,deletes_per_sec=0i,flushes_per_sec=0i,getmores_per_sec=0i,inserts_per_sec=0i,jumbo_chunks=0i,net_in_bytes=639i,net_out_bytes=27185i,open_connections=2i,percent_cache_dirty=0,percent_cache_used=0,queries_per_sec=2i,queued_reads=0i,queued_writes=0i,resident_megabytes=66i,total_available=0i,total_created=0i,total_in_use=0i,total_refreshing=0i,ttl_deletes_per_sec=0i,ttl_passes_per_sec=0i,updates_per_sec=0i,vsize_megabytes=1013i,wtcache_app_threads_page_read_count=0i,wtcache_app_threads_page_read_time=0i,wtcache_app_threads_page_write_count=22i,wtcache_bytes_read_into=0i,wtcache_bytes_written_from=39880i,wtcache_current_bytes=39003i,wtcache_max_bytes_configured=7778336768i,wtcache_pages_evicted_by_app_thread=0i,wtcache_pages_queued_for_eviction=0i,wtcache_server_evicting_pages=0i,wtcache_tracked_dirty_bytes=0i,wtcache_worker_thread_evictingpages=0i 1525703381000000000
```
@grubernaut
Copy link
Contributor

@danielnelson, pushed #4114, sorry for the extra delay in this, $work's been... busy. 😄

@danielnelson danielnelson added this to the 1.7.0 milestone May 7, 2018
@danielnelson
Copy link
Contributor

Thanks @grubernaut, merged for 1.7.0.

@torrick it would be great if you could test it out using the nightly builds before the release, it should be added to the next build automatically so give it a day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mongodb feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

No branches or pull requests

3 participants