dev branch. Did you create your branch from dev?cargo +nightly fmt --all command prior to submission?cargo clippy --workspace --all-features command?This PR implements per-collection metrics for Prometheus, addressing issue #3322. It adds a new configuration option service.record_per_collection to enable or disable this feature. When enabled, existing metrics like rest_responses_total, grpc_responses_total, and various operation durations will include a collection label. Additionally, collection_points and collection_vectors metrics now consistently use the collection label instead of id.
record_per_collection to ServiceConfig (default: false).WebApiTelemetry and GrpcTelemetry to support per-collection statistics.ActixWorkerTelemetryCollector and TonicWorkerTelemetryCollector to collect stats per collection.CollectionName struct for passing collection names via gRPC response extensions.ActixTelemetryService to extract the collection name from the request path.TonicTelemetryService to extract the collection name from response extensions.WebApiTelemetry::add_metrics and GrpcTelemetry::add_metrics to generate Prometheus metrics with the collection label.CollectionsTelemetry and HardwareTelemetry to use the collection label instead of id.upsert, search, get) to attach the CollectionName to response extensions.tests/per_collection_metrics_test.sh to verify that metrics are correctly reported when the feature is enabled.record_per_collection: true in config or via env var QDRANT_SERVICE__RECORD_PER_COLLECTION=true./metrics for collection="..." labels./fixes #3322 /claim #3322
USER@DESKTOP-1PHUG1C MINGW64 ~/3D Objects/qdrant (per-collection-metrics)
$ ./tests/per_collection_metrics_test.sh
Using Qdrant host: localhost:6333
Creating collection test_collection_metrics...
{"result":true,"status":"ok","time":0.1608115}Inserting points...
{"result":{"operation_id":1,"status":"completed"},"status":"ok","time":0.0146744}Searching points...
{"result":[{"id":1,"version":1,"score":1.273},{"id":2,"version":1,"score":0.871}],"status":"ok","time":0.0026512}Fetching metrics...
Verifying per-collection metrics...
Found per-collection rest_responses_total
Found per-collection collection_points
All per-collection metrics verification passed!
Cleaning up...
{"result":true,"status":"ok","time":0.0086086}
2026-01-19T03:39:57.557828Z INFO actix_web::middleware::logger: 127.0.0.1 "PUT /collections/test_collection_metrics HTTP/1.1" 200 46 "-" "curl/8.12.1" 0.159817
2026-01-19T03:39:57.853769Z DEBUG memory::madvise: Ignore Random on this platform
2026-01-19T03:39:57.854546Z DEBUG memory::madvise: Ignore Sequential on this platform
2026-01-19T03:39:57.859148Z INFO actix_web::middleware::logger: 127.0.0.1 "PUT /collections/test_collection_metrics/points?wait=true HTTP/1.1" 200 81 "-" "curl/8.12.1" 0.011381
2026-01-19T03:39:58.183047Z INFO actix_web::middleware::logger: 127.0.0.1 "POST /collections/test_collection_metrics/points/search HTTP/1.1" 200 113 "-" "curl/8.12.1" 0.002535
2026-01-19T03:39:58.930919Z INFO storage::content_manager::toc::collection_meta_ops: Deleting collection test_collection_metrics
2026-01-19T03:39:58.931639Z DEBUG collection::update_workers::flush_workers: Stopping flush worker for shard ./storage\collections\test_collection_metrics\0
2026-01-19T03:39:58.939728Z INFO actix_web::middleware::logger: 127.0.0.1 "DELETE /collections/test_collection_metrics HTTP/1.1" 200 46 "-" "curl/8.12.1" 0.009151
Excellencedev
@Excellencedev
Qdrant
@Qdrant