Skip to content

Commit

Permalink
15872 FIX This Werk fixes misbehaved metrics after an upgrade
Browse files Browse the repository at this point in the history
SUP-16019

Change-Id: I8e8876f66054d82daab9904645e309516fa831e8
  • Loading branch information
mo-ki committed Oct 23, 2023
1 parent f0c4567 commit 7c94693
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .werks/15872
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Title: This Werk fixes misbehaved metrics after an upgrade
Class: fix
Compatible: compat
Component: checks
Date: 1697611822
Edition: cre
Level: 1
Version: 2.3.0b1

After an upgrade various plugins metrics would misbehave, until eventually settling again.
More specificly: All averaged metrics would forget the previously recorded values.
As a result, the "averaged" metric follows the original one very closely.
After a few values are recorded the desired smoothing effect of the averaging will start to show.
The time it takes for the metric to stabilise depends on the configured or implemented weights (<i>"Backlog in minutes"</i>).

1 change: 1 addition & 0 deletions omd/packages/omd/omdlib/tmpfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def save_tmpfs_dump(site: SiteContext) -> None:
save_paths = [
Path(site.tmp_dir) / "check_mk" / "piggyback",
Path(site.tmp_dir) / "check_mk" / "piggyback_sources",
Path(site.tmp_dir) / "check_mk" / "counters",
]

dump_path = _tmpfs_dump_path(site)
Expand Down
4 changes: 2 additions & 2 deletions tests/testlib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

import livestatus

from cmk.utils.paths import piggyback_dir, piggyback_source_dir
from cmk.utils.paths import counters_dir, piggyback_dir, piggyback_source_dir
from cmk.utils.version import Edition

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -1506,7 +1506,7 @@ def interactive_update(
logger.debug("OMD automation logfile: %s", logfile.read())

# tmpfs should have been restored:
# TODO: assert os.path.exists(site.path(counters_dir))
assert os.path.exists(site.path(counters_dir))
assert os.path.exists(site.path(str(piggyback_dir)))
assert os.path.exists(site.path(str(piggyback_source_dir)))

Expand Down

0 comments on commit 7c94693

Please sign in to comment.