Files
qdrant/openapi/tests/openapi_integration/test_service.py
T
Tim Visée 13c9a679b2 Improve metrics building performance, limit endpoints to whitelist (#1616)
* Fix incorrect metrics value for cluster commit

* Rewrite metrics logic, don't use registry, write values directly

* Only report REST timings for requests having HTTP 200 response

* Limit metrics reporting of endpoints to whitelist

The whitelist contains a selection of search, recommend and upsert endpoints.

* Add MetricsParam, remove detail level, keep anonymize

* Request metrics in basic API test

* Specify content type for metrics endpoint

* Add OpenAPI test for metrics endpoint, remove from basic API test

This test probes for some strings that must exist in the output

* Add note that metrics endpoint whitelist must be sorted
2023-04-11 13:39:41 +02:00

18 lines
513 B
Python

import pytest
from .helpers.helpers import request_with_validation
def test_metrics():
response = request_with_validation(
api='/metrics',
method="GET",
)
assert response.ok
# Probe some strings that must exist in the metrics output
assert '# HELP app_info information about qdrant server' in response.text
assert '# TYPE app_info counter' in response.text
assert 'app_info{name="qdrant",version="' in response.text
assert 'collections_total ' in response.text