From 8b9b7fc11d9c750372c30f927d93edcee705d48b Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 30 Oct 2026 20:13:20 -0400 Subject: [PATCH] chore(docker): the history move logs which services its old keys belong to (#6718) #6718 "A swarm container's metrics, normal and anomalies are keyed by its task name, so they start over whenever the task moves". The move found 391,091 hourly-only task names against 51 services and about 400 keys with raw samples. Log the services with the most keys and a few names, to read before those keys start moving. Co-Authored-By: Claude Opus 5.5 --- plugins/docker/rekey.py | 4 ++++ 1 file changed, 4 insertions(+) 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)