dev branch. Did you create your branch from dev?This PR introduces granular tracking of request metrics (latency, counts, errors) per collection. Previously, request metrics were global, making it difficult to identify which specific collection was causing load or experiencing latency in a multi-tenant environment.
With this change, metrics such as rest_responses_total and grpc_responses_total now include a collection label (e.g., collection="my_collection").
collection label to standard request metrics.telemetry_config.per_collection_metrics: Enable/disable feature (default: true).telemetry_config.max_collections_in_metrics: Limits the number of tracked collections to prevent memory exhaustion (default: 1000)./collections/{name}/...).Collections, Points, and Snapshots services using a task_local! context to propagate collection names.LruCache to store per-collection metrics, ensuring that systems with high collection churn or cardinality do not suffer from unbounded memory growth.match_info and fallback path parsing.tokio::task_local to pass metadata from the handler to the telemetry collector without changing method signatures significantly.A new end-to-end test script has been added: tests/per_collection_metrics_test.sh.
./tests/per_collection_metrics_test.sh
rest_responses_total contains the correct collection label.grpcurl).grpc_responses_total contains the correct collection label.set_collection_context() calls in handlers; new endpoints must be explicitly instrumented.https://github.com/user-attachments/assets/3e53218b-b3e0-42d9-923f-6869582117ec
/claim #3322
Markster
@itsmarkster
Qdrant
@Qdrant