Skip to content

Fix metrics probe cntr lifetime#5075

Merged
HofiOne merged 11 commits intosyslog-ng:masterfrom
HofiOne:fix-metrics-probe-cntr-lifetime
Aug 27, 2024
Merged

Fix metrics probe cntr lifetime#5075
HofiOne merged 11 commits intosyslog-ng:masterfrom
HofiOne:fix-metrics-probe-cntr-lifetime

Conversation

@HofiOne
Copy link
Collaborator

@HofiOne HofiOne commented Aug 27, 2024

Depends on #5073

The TLS cache of metrics-probe() has been extended with a global cache in order not to make metrics orphaned whenever an ivykis worker stops (after 10 seconds of inactivity).

The global cache requires a lock, but it is only updated on thread shutdown. It is purged during reload.

Refactor overview:

metrics-cache --> dyn-metrics-store
metrics-tls-cache --> dyn-metrics-cache

Also tried to decouple metrics-template from the cache functionality, but it would have had performance implications, so only added a comment about the coupled functionality.

Backport of #243 by @MrAnno

@HofiOne HofiOne marked this pull request as ready for review August 27, 2024 11:00
@HofiOne HofiOne force-pushed the fix-metrics-probe-cntr-lifetime branch from 5d6fd61 to 3c97e7a Compare August 27, 2024 12:17
MrAnno added 11 commits August 27, 2024 15:30
This is the first step of a refactor round that tries to decouple a few
dynamic-metric-related units from the cache built around it.

The end goal is to fix a lifetime issue that is related to the TLS cache
version of this store.

Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
It is no longer called a "cache", so "retrieve" may express the
functionality better.

Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
This is a preparation step for fixing a lifetime bug related to TLS
caching. This unit will be extended with a global cache in order not to
make metrics orphaned whenever an ivykis worker stops.

Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
To denote that this is about templating dynamic counters.

Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
It would have been better to decouple the metrics template unit from the
cache, but this would have had performance implications.

Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
This is required for merging the TLS-cache into a global cache to avoid
making dynamic metrics orphan on thread shutdown.

Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
This unit has been extended with a global cache in order not to
make metrics orphaned whenever an ivykis worker stops (after 10 seconds of
inactivity).

The global cache requires a lock, but it is only updated on thread
shutdown.

The global cache is purged during reload.

Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
Signed-off-by: László Várady <[email protected]>
Signed-off-by: Hofi <[email protected]>
@HofiOne HofiOne force-pushed the fix-metrics-probe-cntr-lifetime branch from 3c97e7a to 4374a68 Compare August 27, 2024 13:30
@HofiOne HofiOne merged commit 8b0e448 into syslog-ng:master Aug 27, 2024
@HofiOne HofiOne deleted the fix-metrics-probe-cntr-lifetime branch August 27, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants