-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Telegraf plugin for mongodb try to gather_col_stats on collection type VIEW #11270
Comments
Hi, The list of collections is made here. The listCollections docs does say these return all collections and views. The listCollections takes a filter where the type field could specify Thanks |
Hello, thank you for response.
Yes, It would be grate to collect gather_col_stats only by collections and timeseries . |
I have PR #11280 up with a potential filter for this. Can you try downloading the artifact from that PR and let me know if it resolves this issue? Thanks! |
Hello, /data/telegraf-1.23.0/usr/bin/telegraf -version No more Error: (CommandNotSupportedOnView) Namespace local.system.tenantMigration.oplogView is a view, not a collection. Now telegraf exlude views. But now telegraf show another errors: /data/telegraf-1.23.0/usr/bin/telegraf --config ./my.conf --debug |
Views do not support the collection stats. The list collection names returns collections, timeseries, and views. This removes views. fixes: influxdata#11270
Thanks for trying it. I've updated the PR, can you give it another attempt once new artifacts are posted? Thanks again! edit: for reference I ran the following commands on a mongo server to setup a couple collections and views:
|
Hello.
|
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.22.3
Docker
No response
Steps to reproduce
1.mongodb 5.0.9
2. telegraf user has root permissions in mangodb
3. Simple config for telegraf to run
Expected behavior
Telegraf mongodb plugin should gather_col_stats on collection "type" : "collection"
Actual behavior
Telegraf mongodb plugin gather gather_col_stats on all types of collections
Additional info
Hello.
MongoDb does not support collStats commad on collectin type view.
Example:
MYRS:PRIMARY> use local
switched to db local
MYRS:PRIMARY> show collections
oplog.rs
replset.election
replset.initialSyncId
replset.minvalid
replset.oplogTruncateAfterPoint
startup_log
system.replset
system.rollback.id
system.tenantMigration.oplogView
system.views
MYRS:PRIMARY> db.runCommand( { collStats : "system.tenantMigration.oplogView" } )
{
"ok" : 0,
"errmsg" : "Namespace local.system.tenantMigration.oplogView is a view, not a collection",
"code" : 166,
"codeName" : "CommandNotSupportedOnView",
"$clusterTime" : {
"clusterTime" : Timestamp(1654680040, 1),
"signature" : {
"hash" : BinData(0,"NqmNCz7AR6ZvHq05VXuEobarqyw="),
"keyId" : NumberLong("7106730213999902725")
}
},
"operationTime" : Timestamp(1654680040, 1)
}
Telegraf plugin try to gather_col_stats on collection type "view" , and also gets error :
2022-06-08T09:13:30Z E! [inputs.mongodb] error getting col stats from "system.tenantMigration.oplogView": (CommandNotSupportedOnView) Namespace local.system.tenantMigration.oplogView is a view, not a collection
The text was updated successfully, but these errors were encountered: