Skip to content

Commit

Permalink
13813 FIX api: addition of cache_ttl threshold to the metadata queue
Browse files Browse the repository at this point in the history
The previous version caused the cluster collector to keep previous
metadata information of the colletors even if they were no longer
present within the cluster. This led to confusion on the handler
side as collectors appeared as still being present. This werk
fixes this behaviour and reduces the metadata retention time from
one year to the configured ttl cache time.

Change-Id: I4c86edd350a74707dffc6bf63773b8745f582d6c
  • Loading branch information
Wontek Hong committed Mar 10, 2022
1 parent 5be64a1 commit 97380c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .werks/13813
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Title: api: addition of cache_ttl threshold to the metadata queue
Class: fix
Compatible: compat
Component: cluster-collector
Date: 1646916855
Knowledge: doc
Level: 1
Version: 2.0.0-alpha.1

The previous version caused the cluster collector to keep previous
metadata information of the colletors even if they were no longer
present within the cluster. This led to confusion on the handler
side as collectors appeared as still being present. This werk
fixes this behaviour and reduces the metadata retention time from
one year to the configured ttl cache time.
1 change: 1 addition & 0 deletions src/checkmk_kube_agent/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ def _init_app_state(
key=metadata_key,
maxsize=10000, # Kubernetes clusters can have a max of 5000 nodes.
# Each node collector daemonset sends their own metadata to this queue
ttl=cache_ttl,
)
app_.state.metadata = metadata
app_.state.reader_whitelist = frozenset(reader_whitelist)
Expand Down

0 comments on commit 97380c2

Please sign in to comment.