Files
qdrant/openapi/openapi-service.ytt.yaml
Excellencedev 77e2fe72f8 Implement Per collection metrics for Promethus (#8214)
* Implement Per-Collection Prometheus Metrics

* Update config/config.yaml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update tests/per_collection_metrics_test.sh

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update tests/per_collection_metrics_test.sh

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix ci

* comment

* Update tests/per_collection_metrics_test.sh

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* adress revew

* fix: linter

* refactor: cardinality limit, anonymize fix, cleanup

- Add max_per_collection_metrics config (default 256) to bound
  per-collection label cardinality
- Fix anonymize: strip per_collection_responses entirely instead of
  leaking hashed collection names
- Move CollectionName into requests_telemetry, remove
  telemetry_context.rs
- Add unit tests for cardinality limits
- Add integration test assertions for default mode
- Regenerate OpenAPI spec
- Document why internal gRPC doesn't attach CollectionName

* avoid cloning

* fix: address pr reviews

* fix: linter

* fix: linter

* feat: enforce {name} in actix api

* chore: remove empty line

* feat: add actix pre-commit hook

* feat: potential enforce tonic collection name

* feat: use proc_macro instead

* feat: use collection_name instead of name

* feat: add tonic telemetry tests

* fix: linter

* fix: linter

* chore: remove unneccessary clone

* fix: use collection_name everywhere

* fix: python tests and openapi

* chore: simplify collection_name tests

* actix collection_name enforcign: use relative path in test + avoid grep

* fix: remove macro

* chore: add some comment to telemetry_wrapper

* fix: clippy

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Daniel Boros <dancixx@gmail.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2026-03-26 18:39:05 +01:00

183 lines
5.3 KiB
YAML

#@ load("openapi.lib.yml", "response", "reference", "type", "array")
paths:
/:
get:
summary: Returns information about the running Qdrant instance
description: Returns information about the running Qdrant instance like version and commit id
operationId: root
tags:
- Service
responses:
"200":
description: Qdrant server version information
content:
application/json:
schema:
$ref: "#/components/schemas/VersionInfo"
"4XX":
description: error
/telemetry:
get:
summary: Collect telemetry data
description: Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics
operationId: telemetry
tags:
- Service
parameters:
- name: anonymize
in: query
description: "If true, anonymize result"
required: false
schema:
type: boolean
- name: details_level
in: query
description: "Level of details in telemetry data. Minimal level is 0, maximal is infinity"
required: false
schema:
type: integer
minimum: 0
- name: per_collection
in: query
description: "If true, include per-collection request statistics in the response"
required: false
schema:
type: boolean
- name: timeout
in: query
description: "Timeout for this request"
required: false
schema:
type: integer
minimum: 1
default: 60 #! Keep in sync with DEFAULT_TELEMETRY_TIMEOUT
responses: #@ response(reference("TelemetryData"))
/metrics:
get:
summary: Collect Prometheus metrics data
description: Collect metrics data including app info, collections info, cluster info and statistics
operationId: metrics
tags:
- Service
parameters:
- name: anonymize
in: query
description: "If true, anonymize result"
required: false
schema:
type: boolean
- name: per_collection
in: query
description: "If true, include per-collection request metrics with a collection label instead of global request metrics"
required: false
schema:
type: boolean
- name: timeout
in: query
description: "Timeout for this request"
required: false
schema:
type: integer
minimum: 1
default: 60 #! Keep in sync with DEFAULT_TELEMETRY_TIMEOUT
responses:
"200":
description: Metrics data in Prometheus format
content:
text/plain:
schema:
type: string
example: |
# HELP app_info information about qdrant server
# TYPE app_info gauge
app_info{name="qdrant",version="0.11.1"} 1
# HELP cluster_enabled is cluster support enabled
# TYPE cluster_enabled gauge
cluster_enabled 0
# HELP collections_total number of collections
# TYPE collections_total gauge
collections_total 1
"4XX":
description: error
/healthz:
get:
summary: Kubernetes healthz endpoint
description: An endpoint for health checking used in Kubernetes.
operationId: healthz
tags:
- Service
responses:
"200":
description: Healthz response
content:
text/plain:
schema:
type: string
example: healthz check passed
"4XX":
description: error
/livez:
get:
summary: Kubernetes livez endpoint
description: An endpoint for health checking used in Kubernetes.
operationId: livez
tags:
- Service
responses:
"200":
description: Healthz response
content:
text/plain:
schema:
type: string
example: healthz check passed
"4XX":
description: error
/readyz:
get:
summary: Kubernetes readyz endpoint
description: An endpoint for health checking used in Kubernetes.
operationId: readyz
tags:
- Service
responses:
"200":
description: Healthz response
content:
text/plain:
schema:
type: string
example: healthz check passed
"4XX":
description: error
/issues:
get:
summary: Get issues
description: Get a report of performance issues and configuration suggestions
operationId: get_issues
tags:
- Beta
responses:
"200":
description: Successful response
content:
application/json:
schema:
type: object
"4XX":
description: error
delete:
summary: Clear issues
description: Removes all issues reported so far
operationId: clear_issues
tags:
- Beta
responses: #@ response(type("boolean"))