Milvus is a popular open source vector database used for semantic search, recommendation engines, and AI powered applications. According to the CNCF 2024 Annual Survey, 37% of organizations now run vector databases in production, up from 19% in 2023. As Milvus deployments scale to handle millions of vectors and high query concurrency, production monitoring becomes essential to maintain low latency, prevent memory pressure, and detect degraded index performance before users notice.
Without proper monitoring, a slow HNSW index search or a memory spike during bulk inserts can quietly degrade query performance for hours. With the right observability setup, the same issue triggers an alert, surfaces the exact collection or node causing the problem, and gives operators the metrics needed to tune resource limits or rebalance shards.
This guide covers what Milvus monitoring involves, how the Prometheus metrics stack works, which signals matter most, and how to build dashboards and alerts that catch production issues early.
What Is Milvus Monitoring
Milvus monitoring is the practice of continuously tracking the health, performance, and resource consumption of a Milvus vector database deployment using metrics, logs, and traces. It answers the question: is my Milvus cluster responding to queries quickly, are indexes loading correctly, and are nodes under memory pressure?
Milvus exposes detailed time series metrics during runtime through Prometheus compatible endpoints. These metrics cover query latency, insert throughput, memory usage, index build time, disk I/O, and per collection performance. By collecting and visualizing these metrics, teams can detect bottlenecks, tune resource allocation, and prevent outages before they impact applications.
Production Milvus monitoring typically involves three layers: infrastructure metrics (CPU, memory, disk, network), application metrics (query latency, request rate, error rate), and business metrics (collection size, index quality, cache hit rate). Together, these signals give a complete view of how the vector database is behaving under real workloads.
How Milvus Monitoring Works
Milvus monitoring relies on the Prometheus pull model combined with Grafana for visualization and alerting. Here is how the architecture works in a typical production setup.
Milvus components (query nodes, data nodes, index nodes, proxy, and root coordinator) expose metrics at /metrics HTTP endpoints. Prometheus scrapes these endpoints at a configurable interval — usually every 15 or 30 seconds. The scraped metrics are stored in Prometheus as time series data with labels for node ID, collection name, and metric type.
Grafana connects to Prometheus as a data source and queries the stored metrics to build dashboards. Teams use Grafana dashboards to visualize latency histograms, throughput trends, memory usage by node, and error rates over time. Alerting rules run inside Prometheus or Grafana to trigger notifications when metrics cross defined thresholds — such as query latency exceeding 500ms or memory usage above 80%.
For Kubernetes deployments, the Prometheus Operator simplifies discovery and scraping by automatically detecting Milvus pods via ServiceMonitor resources. This eliminates manual endpoint configuration and ensures new nodes are scraped automatically as they scale.
Logs from Milvus components flow to a centralized logging system like Loki, Elasticsearch, or a managed log aggregation platform. Combining metrics with logs gives full context — for example, correlating a latency spike with an error log showing a failed index load.
The official Milvus documentation provides Helm chart configurations and Prometheus scrape configs for standard deployments.
Key Milvus Metrics to Monitor
Milvus exposes hundreds of metrics. These are the signals that matter most in production.
Query Performance Metrics
Query latency is the most critical metric. Milvus reports latency as a histogram with buckets for p50, p90, p95, and p99 percentiles. High p99 latency indicates that some queries are experiencing significant delays — often caused by cold index loads, memory pressure, or slow disk I/O.
Query throughput (requests per second) shows how many search or insert operations the cluster is handling. A sudden drop in throughput often signals node failures, network issues, or resource exhaustion.
Failed query count tracks errors returned to clients. Repeated failures on specific collections or nodes point to misconfigurations, out of memory conditions, or corrupt indexes.
Resource Utilization Metrics
Memory usage per node is critical because Milvus loads vector indexes into RAM for fast search. When memory usage crosses 80%, performance degrades as the system starts swapping or evicting indexes. Monitoring memory by node and by collection helps identify which datasets are consuming the most resources.
CPU utilization spikes during index builds, bulk inserts, and high query concurrency. Sustained high CPU often indicates under provisioned nodes or inefficient query patterns.
Disk I/O metrics track read and write throughput to object storage or local SSDs. Slow disk reads delay index loading and increase query latency. High write latency during inserts suggests storage bottlenecks.
Index and Collection Metrics
Index build time measures how long it takes to build HNSW, IVF_FLAT, or other index types on inserted vectors. Long build times delay data availability and indicate that index parameters or node resources need tuning.
Collection size (number of vectors) and segment count help track growth over time. Large collections with too many small segments can degrade search performance and increase memory overhead.
Cache hit rate shows how often queries are served from the in memory query cache versus requiring a full index search. Low cache hit rates suggest query patterns are too diverse or cache size is too small.
Error and Availability Metrics
Error rate by operation type (search, insert, delete, flush) helps isolate which part of the Milvus API is failing. A spike in insert errors often points to schema validation issues or resource limits.
Node availability tracks whether all expected Milvus components are running and reachable. Missing query nodes or index nodes reduce cluster capacity and increase latency on remaining nodes.
Setting Up Milvus Monitoring with Prometheus and Grafana
The standard monitoring stack for Milvus combines Prometheus for metrics collection, Grafana for dashboards, and optionally Loki for logs. This section covers deployment on Kubernetes using the Milvus Operator and Prometheus Operator.
Deploying Milvus with Metrics Enabled
Install Milvus on Kubernetes using the Milvus Operator or Helm chart. Metrics are enabled by default on the standard deployment.
For Helm installations, verify that metrics are exposed by checking the values.yaml file. The relevant section should show metrics.enabled: true and specify the port (default 9091).
After deployment, confirm that metrics endpoints are accessible by port forwarding to a Milvus pod and curling the /metrics endpoint:
kubectl port-forward svc/milvus-proxy 9091:9091 -n milvus
curl http://localhost:9091/metrics
The output should show Prometheus formatted metrics with names prefixed by milvus_.
Configuring Prometheus to Scrape Milvus Metrics
If using the Prometheus Operator, create a ServiceMonitor resource to automatically discover and scrape Milvus pods. Here is an example ServiceMonitor configuration:
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: milvus-metrics
namespace: milvus
spec:
selector:
matchLabels:
app.kubernetes.io/name: milvus
endpoints:
- port: metrics
interval: 30s
path: /metrics
Apply the ServiceMonitor:
kubectl apply -f milvus-servicemonitor.yaml
Prometheus will now scrape all Milvus pods with the matching label every 30 seconds. Verify scraping by checking Prometheus targets at http://<prometheus-url>/targets.
For non Kubernetes deployments, add a static scrape config to prometheus.yml:
scrape_configs:
- job_name: 'milvus'
static_configs:
- targets: ['milvus-proxy:9091', 'milvus-querynode:9091']
Building Grafana Dashboards for Milvus
Grafana connects to Prometheus as a data source and queries Milvus metrics to build dashboards. The Milvus community provides a pre built Grafana dashboard that covers the most important metrics out of the box.
Import the dashboard by navigating to Grafana > Dashboards > Import and entering the dashboard ID 15625. The imported dashboard includes panels for query latency, throughput, memory usage, CPU load, and error rates.
Customize the dashboard to match your deployment by adding panels for specific collections, breaking out metrics by node ID, or creating heatmaps for latency distributions.
Key panels to include:
- Query latency p99 by collection
- Memory usage per query node
- Insert throughput over time
- Failed requests by operation type
- Index build duration by collection
Alerting on Critical Milvus Metrics
Prometheus Alerting rules trigger notifications when metrics cross defined thresholds. Create an alert for high query latency:
groups:
- name: milvus_alerts
rules:
- alert: HighQueryLatency
expr: histogram_quantile(0.99, milvus_query_latency_bucket) > 0.5
for: 5m
labels:
severity: warning
annotations:
summary: "Milvus p99 query latency above 500ms"
Apply the alert rule to Prometheus and configure Alertmanager to route notifications to Slack, PagerDuty, or email.
Other recommended alerts:
- Memory usage above 80% for more than 10 minutes
- Failed query count increasing over 5 minutes
- Node unavailable for more than 2 minutes
- Index build time exceeding baseline by 2x
Monitoring Milvus with CubeAPM
CubeAPM is an OpenTelemetry native observability platform that monitors Milvus deployments with unified metrics, logs, and traces in a single view. It runs on your own infrastructure, so all Milvus telemetry stays inside your cloud with no data egress costs.
CubeAPM connects to Milvus via Prometheus remote write or OpenTelemetry Collector and automatically indexes all metrics for fast search and filtering. You can query Milvus metrics by collection name, node ID, or operation type without building custom dashboards first.
For teams running Milvus on Kubernetes, CubeAPM provides node level, pod level, and cluster level visibility in one interface. You can correlate a query latency spike with the exact pod experiencing memory pressure or trace a failed insert back to the upstream service that triggered it.
CubeAPM includes built in alerting with anomaly detection that reduces noise compared to static threshold alerts. When a Milvus node starts exhibiting unusual behavior, CubeAPM flags it automatically and links the alert to related metrics and logs.
Pricing is simple: $0.15 per GB of ingested telemetry with unlimited retention and no per user fees. For a 50 node Milvus cluster generating 500 GB of metrics monthly, CubeAPM costs around $75 per month versus $1,500 to $3,000 for equivalent SaaS tools.
Best Practices for Milvus Production Monitoring
These are the patterns that prevent most production Milvus issues before they escalate.
Monitor Collection Level Metrics Separately
Aggregated cluster metrics hide problems in individual collections. Track query latency, memory usage, and error rate per collection so you can isolate which dataset is causing performance degradation.
Set Alerts Based on Latency Percentiles Not Averages
Average query latency can look fine while p99 latency is terrible. Always alert on p95 or p99 latency thresholds because these reflect the worst user experience.
Track Memory Headroom Not Just Usage
Alert when memory usage crosses 70% not 90%. This gives you time to scale nodes or reduce index size before the system starts swapping and performance collapses.
Correlate Metrics with Logs During Incidents
When an alert fires, check Milvus component logs for the same time window. Logs often show the root cause, a failed index load, an out of memory error, or a schema mismatch, that metrics alone cannot explain.
Monitor Upstream Services That Query Milvus
If your application queries Milvus, monitor the application side latency and error rate as well. Sometimes the problem is not Milvus but the query pattern or network path between the app and the database.
Regularly Review Index Parameters and Resource Limits
Production query patterns change over time. Review index types, HNSW parameters, and memory limits quarterly to ensure they still match your workload. Outdated configurations often cause gradual performance degradation that goes unnoticed without monitoring.
Conclusion
Monitoring Milvus in production requires tracking query latency, memory usage, index build time, and error rates across all nodes and collections. The standard approach combines Prometheus for metrics collection, Grafana for dashboards, and alert rules to catch issues before they impact users.
For teams running Milvus on Kubernetes, the Prometheus Operator simplifies discovery and scraping. Pre built Grafana dashboards give immediate visibility into cluster health. Alerting on p99 latency, memory headroom, and failed requests prevents the most common production incidents.
Platforms like CubeAPM offer an alternative to the DIY Prometheus and Grafana stack by providing unified metrics, logs, and traces in one interface with built in anomaly detection and simple per GB pricing.
Disclaimer: The information in this article reflects the latest details available at the time of publication and may change as technologies and products evolve. Features, pricing, and plan limits can change over time. Always verify the latest information directly with the vendor before making purchasing or deployment decisions.
Frequently Asked Questions
What metrics are most important for Milvus monitoring?
Query latency (p99), memory usage per node, failed request count, and index build time are the core metrics. Track these per collection and per node to catch issues early.
How do I enable Prometheus metrics in Milvus?
Metrics are enabled by default in standard Milvus deployments. Verify by checking the Helm values file or curling the `/metrics` endpoint on port 9091.
Can I monitor Milvus without Kubernetes?
Yes. Use Prometheus with static scrape configs to collect metrics from standalone Milvus nodes. Grafana connects to Prometheus as a data source to build dashboards.
What is the difference between monitoring Milvus standalone and distributed deployments?
Standalone Milvus runs all components in one process, so metrics are simpler. Distributed deployments require monitoring query nodes, data nodes, index nodes, and coordinators separately.
How do I alert on high Milvus query latency?
Create a Prometheus alert rule that triggers when `histogram_quantile(0.99, milvus_query_latency_bucket)` exceeds your threshold for a defined duration, such as 500ms for 5 minutes.
Does CubeAPM support Milvus monitoring?
Yes. CubeAPM ingests Milvus metrics via Prometheus remote write or OpenTelemetry Collector and provides unified dashboards with logs and traces in one view.
What causes high memory usage in Milvus?
Large vector indexes loaded into RAM, too many concurrent queries, or insufficient memory limits on query nodes. Monitor memory per collection to identify which dataset is consuming the most resources.





