diff --git a/plugins/docker/rekey.py b/plugins/docker/rekey.py index 3fe0b1d..8d1a2a2 100644 --- a/plugins/docker/rekey.py +++ b/plugins/docker/rekey.py @@ -13,6 +13,7 @@ from __future__ import annotations import asyncio import logging import time +from collections import Counter from typing import TYPE_CHECKING from sqlalchemy import delete, select, text, update @@ -90,6 +91,9 @@ async def old_keys(session) -> list[str]: | await names(MaintenanceWindow.scope_resource, MaintenanceWindow.scope_source == "docker")) logger.info("Swarm history under task names: %d keys with raw samples, %d with hourly rows, " "%d named by anomalies, rules or windows", len(recent), len(hourly), len(named)) + by_service = Counter(task_service(k.split("/", 1)[1]) for k in hourly - recent) + logger.info("Swarm history under task names, hourly only, most keys first: %s; for example %s", + by_service.most_common(10), sorted(hourly - recent)[:3]) return sorted(hourly - recent) + sorted((named - hourly) - recent) + sorted(recent)