feat: добавлен сбор метрик: падения запросов к embeded модели; падения запросов к Qdrant, S3; скорости обработки новостей с выделением затраченного времени работы embeded - модели
This commit is contained in:
1 parent
dd0a124e36
commit
a7974404a9
11 files changed
+287
-17
No files matched your search
@@ -15,18 +15,27 @@ def test_start_metrics_server_uses_given_port(mocker) -> None:
|
||||
|
||||
|
||||
def test_metric_names_exposed_in_registry() -> None:
|
||||
"""Счётчики зарегистрированы с ожидаемыми именами (с суффиксом _total)."""
|
||||
"""Метрики зарегистрированы с ожидаемыми именами."""
|
||||
from prometheus_client import REGISTRY
|
||||
|
||||
names = {
|
||||
sample.name
|
||||
name
|
||||
for metric in REGISTRY.collect()
|
||||
for sample in metric.samples
|
||||
for name in (
|
||||
metric.name,
|
||||
f"{metric.name}_total",
|
||||
*(sample.name for sample in metric.samples),
|
||||
)
|
||||
}
|
||||
for name in (
|
||||
"etl_rows_processed_total",
|
||||
"etl_chunks_upserted_total",
|
||||
"etl_files_processed_total",
|
||||
"etl_files_failed_total",
|
||||
"etl_embedding_requests_failed_total",
|
||||
"etl_qdrant_requests_failed_total",
|
||||
"etl_s3_requests_failed_total",
|
||||
"etl_file_process_duration_seconds",
|
||||
"etl_embedding_request_duration_seconds",
|
||||
):
|
||||
assert name in names
|
||||
Reference in new issue
Block a user