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

feat(inputs.mongodb): Add metrics about files currently open and currently active data handles #7896

Merged
merged 6 commits into from
Apr 5, 2022
Merged

feat(inputs.mongodb): Add metrics about files currently open and currently active data handles #7896

merged 6 commits into from
Apr 5, 2022

Conversation

DrissTM
Copy link
Contributor

@DrissTM DrissTM commented Jul 25, 2020

resolve: #7895

This PR is adding two metrics in the mongodb plugin:

  • wt_connection_files_currently_open (can be obtained with the following command: db.serverStatus()["wiredTiger"]["connection"]["files currently open"])
  • wt_data_handles_currently_active (can be obtained with the following command: db.serverStatus()["wiredTiger"]["data-handle"]["connection data handles currently active"])

These metrics are bound to the number of actively used collections/indexes (the more collections/indexes you actively use the more files currently open/connection data handles currently active you'll have), high values of these can cause checkpoints to hold the schemaLock longer than usual and result in global database locks every 60 seconds (see #7895 for more details and link to mongodb jira issue)

Required for all PRs:

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

@srebhan
Copy link
Member

srebhan commented Oct 20, 2021

@DrissTM can you please resolve the merge conflict. Will review afterwards.

@srebhan srebhan self-assigned this Oct 20, 2021
@srebhan srebhan added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Oct 20, 2021
@srebhan
Copy link
Member

srebhan commented Nov 30, 2021

@DrissTM are you still interested in this PR?

@srebhan srebhan added the waiting for response waiting for response from contributor label Nov 30, 2021
@srebhan
Copy link
Member

srebhan commented Feb 4, 2022

Anyone willing to work on this PR?

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Feb 4, 2022
@srebhan srebhan added the help wanted Request for community participation, code, contribution label Feb 4, 2022
@DrissTM DrissTM changed the title mongodb add metrics about files currently open and currently active data handles feat(inputs.mongodb): add metrics about files currently open and currently active data handles (#7895) Mar 16, 2022
@DrissTM
Copy link
Contributor Author

DrissTM commented Mar 16, 2022

hi @srebhan I'm working again on this PR, there's one last conflict to solve and it should be ready for review

@sspaink sspaink added ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. and removed help wanted Request for community participation, code, contribution labels Mar 22, 2022
Comment on lines 309 to 310
```shell
mongodb,hostname=127.0.0.1:27017 active_reads=3i,active_writes=0i,aggregate_command_failed=0i,aggregate_command_total=87210i,assert_msg=0i,assert_regular=0i,assert_rollovers=0i,assert_user=0i,assert_warning=0i,available_reads=125i,available_writes=128i,commands=218126i,commands_per_sec=1876i,connections_available=838853i,connections_current=7i,connections_total_created=8i,count_command_failed=0i,count_command_total=7i,cursor_no_timeout=0i,cursor_no_timeout_count=0i,cursor_pinned=0i,cursor_pinned_count=0i,cursor_timed_out=0i,cursor_timed_out_count=0i,cursor_total=0i,cursor_total_count=0i,delete_command_failed=0i,delete_command_total=0i,deletes=0i,deletes_per_sec=0i,distinct_command_failed=0i,distinct_command_total=87190i,document_deleted=0i,document_inserted=0i,document_returned=7i,document_updated=43595i,find_and_modify_command_failed=0i,find_and_modify_command_total=43595i,find_command_failed=0i,find_command_total=348819i,flushes=1i,flushes_per_sec=0i,flushes_total_time_ns=5000000i,get_more_command_failed=0i,get_more_command_total=0i,getmores=7i,getmores_per_sec=1i,insert_command_failed=0i,insert_command_total=0i,inserts=0i,inserts_per_sec=0i,jumbo_chunks=0i,latency_commands=44179i,latency_commands_count=122i,latency_reads=36662189i,latency_reads_count=523229i,latency_writes=6768713i,latency_writes_count=87190i,net_in_bytes=837378i,net_in_bytes_count=97692502i,net_out_bytes=690836i,net_out_bytes_count=75377383i,open_connections=7i,operation_scan_and_order=87193i,operation_write_conflicts=7i,page_faults=0i,percent_cache_dirty=0.9,percent_cache_used=1,queries=348816i,queries_per_sec=2988i,queued_reads=0i,queued_writes=0i,resident_megabytes=77i,storage_freelist_search_bucket_exhausted=0i,storage_freelist_search_requests=0i,storage_freelist_search_scanned=0i,tcmalloc_central_cache_free_bytes=280136i,tcmalloc_current_allocated_bytes=77677288i,tcmalloc_current_total_thread_cache_bytes=1222608i,tcmalloc_heap_size=142659584i,tcmalloc_max_total_thread_cache_bytes=260046848i,tcmalloc_pageheap_commit_count=1898i,tcmalloc_pageheap_committed_bytes=130084864i,tcmalloc_pageheap_decommit_count=889i,tcmalloc_pageheap_free_bytes=50610176i,tcmalloc_pageheap_reserve_count=50i,tcmalloc_pageheap_scavenge_count=884i,tcmalloc_pageheap_total_commit_bytes=13021937664i,tcmalloc_pageheap_total_decommit_bytes=12891852800i,tcmalloc_pageheap_total_reserve_bytes=142659584i,tcmalloc_pageheap_unmapped_bytes=12574720i,tcmalloc_spinlock_total_delay_ns=9767500i,tcmalloc_thread_cache_free_bytes=1222608i,tcmalloc_total_free_bytes=1797400i,tcmalloc_transfer_cache_free_bytes=294656i,total_available=0i,total_created=0i,total_docs_scanned=43595i,total_in_use=0i,total_keys_scanned=130805i,total_refreshing=0i,total_tickets_reads=128i,total_tickets_writes=128i,ttl_deletes=0i,ttl_deletes_per_sec=0i,ttl_passes=0i,ttl_passes_per_sec=0i,update_command_failed=0i,update_command_total=43595i,updates=43595i,updates_per_sec=372i,uptime_ns=60023000000i,version="3.6.17",vsize_megabytes=1048i,wtcache_app_threads_page_read_count=108i,wtcache_app_threads_page_read_time=25995i,wtcache_app_threads_page_write_count=0i,wtcache_bytes_read_into=2487250i,wtcache_bytes_written_from=74i,wtcache_current_bytes=5014530i,wtcache_internal_pages_evicted=0i,wtcache_max_bytes_configured=505413632i,wtcache_modified_pages_evicted=0i,wtcache_pages_evicted_by_app_thread=0i,wtcache_pages_queued_for_eviction=0i,wtcache_pages_read_into=139i,wtcache_pages_requested_from=699135i,wtcache_server_evicting_pages=0i,wtcache_tracked_dirty_bytes=4797426i,wtcache_unmodified_pages_evicted=0i,wtcache_worker_thread_evictingpages=0i 1586379818000000000
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this original example output be removed? Looks like the one you added replaces this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, that's the merge conflict I missed when updating my branch, I fixed it in b47a434

@sspaink
Copy link
Contributor

sspaink commented Mar 31, 2022

@DrissTM were these values already been grabbed but just ignored by the plugin? Wondering if adding these metrics would cause extra calls for every user or if it makes use of an existing request.

@DrissTM
Copy link
Contributor Author

DrissTM commented Apr 5, 2022

@DrissTM were these values already been grabbed but just ignored by the plugin? Wondering if adding these metrics would cause extra calls for every user or if it makes use of an existing request.

yep these values were already been grabbed by the plugin but were ignored until now (it's part of the data we retrieve using the db.serverStatus() command)

@sspaink sspaink changed the title feat(inputs.mongodb): add metrics about files currently open and currently active data handles (#7895) feat(inputs.mongodb): Add metrics about files currently open and currently active data handles Apr 5, 2022
@sspaink sspaink merged commit 6cb2520 into influxdata:master Apr 5, 2022
MyaLongmire pushed a commit that referenced this pull request Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mongodb feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mongodb plugin] Add metrics about files currently open and active data handle
4 participants