How to get detailed shard info with the python v3 client?

hi, there! :wave:

i’m looking for some help getting detailed shard information with the python v3 client. specifically, i’d like to know the object count per shard, as well as which node each shard belongs to.

i’ve not been able to find anything so far in the forums or the official docs beyond this:

client.schema.get_class_shards(collection)

which does print some limited shard information:

{'name': '2zuA1Wb1kmgj', 'status': 'READY', 'vectorQueueSize': 0}

cheers,
matt

hi @cosmicdoggo !!

Welcome to our community!

You can get those with:

import weaviate
pyclientv3 = weaviate.Client("http://localhost:8080")
pyclientv3.cluster.get_nodes_status(output="verbose")

The output should be something similar to:

[{'batchStats': {'queueLength': 0, 'ratePerSecond': 0},
  'gitHash': '387cca6',
  'name': 'node1',
  'shards': [{'class': 'Article',
    'compressed': False,
    'loaded': True,
    'name': 'LZaxtVwSkNA9',
    'objectCount': 4,
    'vectorIndexingStatus': 'READY',
    'vectorQueueLength': 0},
   {'class': 'Test',
    'compressed': False,
    'loaded': True,
    'name': 'y5yUpEJgczEv',
    'objectCount': 200,
    'vectorIndexingStatus': 'READY',
    'vectorQueueLength': 0},
   {'class': 'New',
    'compressed': False,
    'loaded': True,
    'name': 'yu2VUUH3wH2y',
    'objectCount': 0,
    'vectorIndexingStatus': 'READY',
    'vectorQueueLength': 0}],
  'stats': {'objectCount': 204, 'shardCount': 3},
  'status': 'HEALTHY',
  'version': '1.25.2'}]

More info on that endpoint on our docs:

Let me know if this helps :slight_smile:

Thanks!

1 Like

yes! that did the trick :slight_smile:. thnx, @DudaNogueira :pray:

1 Like