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

Fix input plugin MongoDB server connection info #5048

Merged

Conversation

otherpirate
Copy link
Contributor

The MongoDB plugin currently showing the connection information, example:

./telegraf --config telegraf.conf --test
2018-11-27T20:32:59Z I! Starting Telegraf
> mongodb,host=muraritele-01-154333202752 commands_per_sec=8i,connections_available=0i,connections_current=0i,deletes_per_sec=0i,flushes_per_sec=0i,getmores_per_sec=0i,inserts_per_sec=0i,queries_per_sec=2i,resident_megabytes=49i,updates_per_sec=0i,vsize_megabytes=307i 1543350780000000000
> mongodb_db_stats,db_name=admin,host=muraritele-01-154333202752 avg_obj_size=310.7,collections=3i,data_size=3107i,index_size=81920i,indexes=4i,num_extents=0i,objects=10i,ok=1i,storage_size=65536i,type="db_stat" 1543350780000000000
> mongodb_db_stats,db_name=local,host=muraritele-01-154333202752 avg_obj_size=1826.3333333333333,collections=1i,data_size=5479i,index_size=36864i,indexes=1i,num_extents=0i,objects=3i,ok=1i,storage_size=36864i,type="db_stat" 1543350780000000000
> mongodb_db_stats,db_name=murari_telegraf,host=muraritele-01-154333202752 avg_obj_size=0,collections=1i,data_size=0i,index_size=4096i,indexes=1i,num_extents=0i,objects=0i,ok=1i,storage_size=4096i,type="db_stat" 1543350780000000000

This PR fix #4664

./telegraf --config telegraf.conf --test
2018-11-27T20:39:44Z I! Starting Telegraf
> mongodb,host=muraritele-01-154333202752 commands_per_sec=8i,connections_available=26197i,connections_current=7i,deletes_per_sec=0i,flushes_per_sec=0i,getmores_per_sec=0i,inserts_per_sec=0i,queries_per_sec=2i,resident_megabytes=49i,updates_per_sec=0i,vsize_megabytes=311i 1543351185000000000
> mongodb_db_stats,db_name=admin,host=muraritele-01-154333202752 avg_obj_size=310.7,collections=3i,data_size=3107i,index_size=81920i,indexes=4i,num_extents=0i,objects=10i,ok=1i,storage_size=65536i,type="db_stat" 1543351185000000000
> mongodb_db_stats,db_name=local,host=muraritele-01-154333202752 avg_obj_size=1826.3333333333333,collections=1i,data_size=5479i,index_size=36864i,indexes=1i,num_extents=0i,objects=3i,ok=1i,storage_size=36864i,type="db_stat" 1543351185000000000
> mongodb_db_stats,db_name=murari_telegraf,host=muraritele-01-154333202752 avg_obj_size=0,collections=1i,data_size=0i,index_size=4096i,indexes=1i,num_extents=0i,objects=0i,ok=1i,storage_size=4096i,type="db_stat" 1543351185000000000

As u can see, the connections_current, connections_available and connections_total_created are right after this fix.

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

Copy link
Contributor

@glinton glinton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@glinton glinton added this to the 1.9.1 milestone Nov 28, 2018
@glinton glinton added fix pr to fix corresponding bug area/mongodb labels Nov 28, 2018
@danielnelson danielnelson merged commit 9bc92c5 into influxdata:master Nov 28, 2018
@danielnelson danielnelson mentioned this pull request Nov 28, 2018
3 tasks
danielnelson pushed a commit that referenced this pull request Nov 29, 2018
otherpirate added a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
otherpirate added a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
dupondje pushed a commit to dupondje/telegraf that referenced this pull request Apr 22, 2019
bitcharmer pushed a commit to bitcharmer/telegraf that referenced this pull request Oct 18, 2019
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mongodb fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mongodb input connection metrics
3 participants