Skip to main content

PyBirdwatcher

Python wrapper for Birdwatcher - a debug and diagnostic tool for Milvus 2.0+.

Installation

pip install pybirdwatcher

The package includes pre-compiled binaries for:

  • Linux (amd64, arm64)
  • macOS (amd64, arm64)
  • Windows (amd64)

Quick Start

from pybirdwatcher import Birdwatcher

# Using context manager (recommended)
with Birdwatcher.connect("localhost:2379") as bw:
    # List sessions
    for session in bw.sessions:
        print(f"{session.server_name}: {session.address}")

    # List collections
    for collection in bw.collections:
        print(f"{collection.name}: {len(collection.fields)} fields")

Pythonic API

Sessions

from pybirdwatcher import Birdwatcher

with Birdwatcher.connect("localhost:2379") as bw:
    # Property access
    sessions = bw.sessions

    # Get coordinators only
    coords = bw.get_coordinators()

    # Get specific node types
    querynodes = bw.get_nodes("querynode")
    datanodes = bw.get_nodes("datanode")

    for s in sessions:
        print(f"ID: {s.server_id}")
        print(f"Name: {s.server_name}")
        print(f"Address: {s.address}")
        print(f"Version: {s.version}")
        print(f"Is Coordinator: {s.is_coordinator}")

Collections

from pybirdwatcher import Birdwatcher, CollectionState

with Birdwatcher.connect("localhost:2379") as bw:
    # List all collections
    collections = bw.collections

    # Filter by database ID
    collections = bw.list_collections(db_id=1)

    # Get specific collection
    coll = bw.get_collection(name="my_collection")

    if coll:
        print(f"ID: {coll.id}")
        print(f"Name: {coll.name}")
        print(f"State: {coll.state}")
        print(f"Shards: {coll.num_shards}")

        # Access fields
        for field in coll.fields:
            print(f"  Field: {field.name} ({field.data_type})")

        # Get primary key field
        pk = coll.pk_field
        print(f"PK Field: {pk.name}")

        # Get vector fields
        for vf in coll.vector_fields:
            print(f"Vector: {vf.name}")

Segments

from pybirdwatcher import Birdwatcher, SegmentState, SegmentLevel

with Birdwatcher.connect("localhost:2379") as bw:
    # List all segments
    segments = bw.segments

    # Filter by collection
    segments = bw.list_segments(collection_id=123)

    # Filter by state (using enum or string)
    flushed = bw.list_segments(state=SegmentState.FLUSHED)
    growing = bw.list_segments(state="Growing")

    # Filter by level
    l0_segments = bw.list_segments(level=SegmentLevel.L0)

    # Get small segments (low fill ratio)
    small = bw.get_small_segments(collection_id=123, threshold=0.2)

    for seg in segments:
        print(f"ID: {seg.id}")
        print(f"State: {seg.state}")
        print(f"Level: {seg.level}")
        print(f"Rows: {seg.num_rows}/{seg.max_rows}")
        print(f"Fill Ratio: {seg.fill_ratio:.2%}")
        print(f"Is Small: {seg.is_small}")

Statistics

from pybirdwatcher import Birdwatcher

with Birdwatcher.connect("localhost:2379") as bw:
    # Get segment statistics
    stats = bw.get_segment_stats(collection_id=123)
    print(f"Total segments: {stats['total']}")
    print(f"Healthy segments: {stats['healthy_segments']}")
    print(f"Small segments: {stats['small_segments']}")
    print(f"Total rows: {stats['total_rows']}")
    print(f"By state: {stats['by_state']}")
    print(f"By level: {stats['by_level']}")

    # Get cluster summary
    summary = bw.get_cluster_summary()
    print(f"Components: {summary['total_components']}")
    print(f"Collections: {summary['total_collections']}")

Other Resources

with Birdwatcher.connect("localhost:2379") as bw:
    # Databases
    databases = bw.databases

    # Partitions
    partitions = bw.list_partitions(collection_id=123)

    # Indexes
    indexes = bw.list_indexes(collection_id=123)

    # Replicas
    replicas = bw.list_replicas(collection_id=123)

    # Checkpoints
    checkpoints = bw.list_checkpoints(collection_id=123)

    # Health check
    health = bw.healthz()

Raw Commands

with Birdwatcher.connect("localhost:2379") as bw:
    # Run any birdwatcher command
    output = bw.run("show channel-watch")

    # Get JSON output
    data = bw.run("show session", json_output=True)

Data Models

All data is returned as Python dataclasses with proper typing:

from pybirdwatcher import (
    Session,
    Collection,
    Segment,
    SegmentState,
    SegmentLevel,
    CollectionState,
    DataType,
    FieldSchema,
)

# Enums for filtering
SegmentState.FLUSHED
SegmentState.GROWING
SegmentState.DROPPED

SegmentLevel.L0
SegmentLevel.L1
SegmentLevel.L2

CollectionState.COLLECTION_CREATED

DataType.FLOAT_VECTOR
DataType.INT64

Building from Source

cd python

# Build binary for current platform
./scripts/build_binary.sh

# Build for all platforms
./scripts/build_all_platforms.sh

# Build wheel
pip install build
python -m build

License

Apache License 2.0

Metadata

Release files for pybirdwatcher 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pybirdwatcher 0.1.0
File Actions
pybirdwatcher-0.1.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for pybirdwatcher-0.1.0-py3-none-manylinux_2_17_x86_64.whl
pybirdwatcher-0.1.0-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for pybirdwatcher-0.1.0-py3-none-manylinux_2_17_aarch64.whl
pybirdwatcher-0.1.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for pybirdwatcher-0.1.0-py3-none-macosx_11_0_arm64.whl
pybirdwatcher-0.1.0-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details for pybirdwatcher-0.1.0-py3-none-macosx_10_9_x86_64.whl

Total release size: 92.4 MB

Release files / pybirdwatcher-0.1.0-py3-none-manylinux_2_17_x86_64.whl

Download URL pybirdwatcher-0.1.0-py3-none-manylinux_2_17_x86_64.whl
Size 24.3 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
8ce00c93ad19d3235479a79d530f131d98e7917351c2e9baefdfec129cd013f0
BLAKE2b-256 checksum
How to use checksums
1627e29a7f842a92cc08778542a656178f41dd35dbae74316cbba4bb5dc16579
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 4, 2026.

Transparency log

Release files / pybirdwatcher-0.1.0-py3-none-manylinux_2_17_aarch64.whl

Download URL pybirdwatcher-0.1.0-py3-none-manylinux_2_17_aarch64.whl
Size 21.7 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
692de42d4a7dfd0b7e8f72c8b9d73455a95d11948723983a8e7da8de46d057d5
BLAKE2b-256 checksum
How to use checksums
f640a638ced978d27eb8caba24253d01c40ca09a945b027d17ec5b043550475c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 4, 2026.

Transparency log

Release files / pybirdwatcher-0.1.0-py3-none-macosx_11_0_arm64.whl

Download URL pybirdwatcher-0.1.0-py3-none-macosx_11_0_arm64.whl
Size 22.2 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
db921b56e34a25cb396d78b1a9ed63ae0ce7bce0bc0532ed36270a57f4d93066
BLAKE2b-256 checksum
How to use checksums
87905fc7e89ba46f5acba7efbce42064ee0e057337b74c1aed5a18f450c6452f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 4, 2026.

Transparency log

Release files / pybirdwatcher-0.1.0-py3-none-macosx_10_9_x86_64.whl

Download URL pybirdwatcher-0.1.0-py3-none-macosx_10_9_x86_64.whl
Size 24.2 MB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
30977029f630d2deaeeeb9e3065ec32acd770aa84604773d8dde85559133d9ac
BLAKE2b-256 checksum
How to use checksums
d93a568254a769a54837997a6e5e0f52f39c90715e9621c8bf0c7a95ee98a9d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 4, 2026.

Transparency log

Security for pybirdwatcher 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for pybirdwatcher-0.1.0-py3-none-manylinux_2_17_x86_64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

4 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page