MongoDB per database information

Description

Problem: Currently, there is a need to inform the user about database statuses. (When the collection is through the MongoS)

One of the important information is - whether the databases are shared or not.

We have now only the number of shared and unshared databases in metrics (
`mongodb_mongos_sharding_databases_total`) 
While this is a valuable metric, it doesn't allow detailed information about database names for sharded and unsharded.
 
Proposed solutions (from , must be evaluated for other better options): 
In addition to the exposed count of sharde/unsharded with the mentioned metric also expose 
 mongodb_mongos_sharding_databases with labels about DB name and use value.
Extract the data by the same command we have now, just not use the count  :
 
[direct: mongos] config> db.databases.find()
[
{
_id: 'ycsb',
primary: 's2',
partitioned: false,
version: {
uuid: new UUID("60356403-f701-4259-919f-a861e4521779"),
timestamp: Timestamp(

{ t: 1699887579, i: 6 }

),
lastMod: 1
}
}
]

example: mongodb_mongos_sharding_databases {database="ycsb", primary="s2"} 0 
0 - Not partintioned 
 

How to test

None

How to document

None

Activity

Show:

Ivan Groenewold June 27, 2024 at 11:16 AM

now we have metric mongodb_shards_collection_chunks_count which tracks number of chunks per collection. With that we can determine if a collection is sharded or not. I think we can close this

Roma Novikov June 27, 2024 at 10:12 AM

, can you pls check this one - is this something we still need or we have everything and can close this one?

Roma Novikov November 30, 2023 at 9:13 AM

After the discussion, this one goes On Hold, as it looks like the implementation from will get us all the needed data.

Done

Details

Assignee

Reporter

Priority

Components

Needs QA

Yes

Needs Doc

Yes

Smart Checklist

Created November 23, 2023 at 2:18 PM
Updated August 7, 2024 at 11:16 AM
Resolved June 28, 2024 at 11:36 AM