Closed vishal-h closed 3 years ago
Hi,
Currently the cluster_role
is only showing if the node is master or not.
That label get its value here
nodeType, err := getNodeType(ctx, t.client)
if err != nil {
return errors.Wrap(err, "cannot get node type for topology info")
}
and the function only returns 3 values:
func getNodeType(ctx context.Context, client *mongo.Client) (mongoDBNodeType, error) {
md := proto.MasterDoc{}
if err := client.Database("admin").RunCommand(ctx, primitive.M{"isMaster": 1}).Decode(&md); err != nil {
return "", err
}
if md.SetName != nil || md.Hosts != nil {
return typeShardServer, nil
} else if md.Msg == typeIsDBGrid {
// isdbgrid is always the msg value when calling isMaster on a mongos
// see http://docs.mongodb.org/manual/core/sharded-cluster-query-router/
return typeMongos, nil
}
return typeMongod, nil
}
I'm not sure if we should change this value. I've created a Jira ticket to ask our MongoDB experts and track the answers.
Thanks
fixed by #338 ?
Yes. I am closing this issue as it will be fixed by #338
Shouldn't cl_role="configsvr" for config?
mongodb_configsvr{cl_id="some_id", cl_role="shardsvr", instance="host:port", job="mongo_exporter", rs_nm="cnf-serv", rs_state="1"}
I've setup a test-cluster using docker-compose.yml provided