pmm-admin add mongodb:queries
doesn't enable Profiling
for MongoDB server
so it may leave user confused why queries are not monitored, or in other words, why graphs are empty. He will also need to enable Profiling
for every database
he wants to monitor so this might me unnecessary overhead for the user.
Document how to Enable Database Profiling and Set the Profiling Level for all databases
.
For example
$ mongo --quiet --eval '
db.getMongo().getDBNames().forEach(function(dbname) {
r = db.getSiblingDB(dbname).setProfilingLevel(2)
print("db:", dbname)
print(JSON.stringify(r))
print()
});
'
db: admin
{"was":0,"slowms":100,"ok":1}
db: local
{"was":0,"slowms":100,"ok":1}
db: samples
{"was":0,"slowms":100,"ok":1}
db: test
{"was":0,"slowms":100,"ok":1}
Enable Database Profiling and Set the Profiling Level automatically with some safe defaults (e.g. slow queries only) while user adds monitor with pmm-admin
, later he can fine tune it manually.
Enable Database Profiling and Set the Profiling Level automatically if flag --auto-set-profiling-level
is set and parameters were provided. This will allow user to decide if Profiling
should be enabled automatically or not and with what defaults (e.g. slow queries only, or all queries, or all queries but with Percona's rate limiting).
Let me know if you have other ideas and feel free to add them here.