Skip to content

http: bind output_http_requests_total counter lifecycle to worker's #5072

Merged
HofiOne merged 2 commits intosyslog-ng:masterfrom
HofiOne:http-request-metrics-fix
Aug 27, 2024
Merged

http: bind output_http_requests_total counter lifecycle to worker's #5072
HofiOne merged 2 commits intosyslog-ng:masterfrom
HofiOne:http-request-metrics-fix

Conversation

@HofiOne
Copy link
Collaborator

@HofiOne HofiOne commented Aug 27, 2024

Depends on #5071

We do not show the orphaned metrics in the prometheus stats output. Registering, incrementing then unregistering the counter makes it orphaned.

This can be solved with binding the lifecycle of the counters to the worker.

No news file entry is needed, the counters disappeared after 4.7 was released.

Backport of #180 by @alltilla

@HofiOne HofiOne force-pushed the http-request-metrics-fix branch from 6106cad to 2ba34ff Compare August 27, 2024 09:28
@HofiOne HofiOne marked this pull request as ready for review August 27, 2024 10:35
@HofiOne HofiOne dismissed therandomstring’s stale review August 27, 2024 11:55

The merge-base changed after approval.

@HofiOne HofiOne dismissed therandomstring’s stale review August 27, 2024 12:11

The merge-base changed after approval.

@HofiOne HofiOne dismissed therandomstring’s stale review August 27, 2024 12:16

The merge-base changed after approval.

The metrics TLS cache binds the lifecycle of the
counters to the lifecycle of the thread, which is
the same as the process's.

There are cases where a cache like this is useful,
but we want to bind the lifecycle of the counters
to a different entity, like a HTTP worker.

Signed-off-by: Attila Szakacs <[email protected]>
Signed-off-by: Hofi <[email protected]>
We do not show the orphaned metrics in the
prometheus stats output. Registering, incrementing
then unregistering the counter makes it orphaned.

This can be solved with binding the lifecycle of
the counters to the worker.

Signed-off-by: Attila Szakacs <[email protected]>
Signed-off-by: Hofi <[email protected]>
@HofiOne HofiOne force-pushed the http-request-metrics-fix branch from 2ba34ff to b8a5533 Compare August 27, 2024 12:17
@HofiOne HofiOne merged commit 4d28c55 into syslog-ng:master Aug 27, 2024
@HofiOne HofiOne deleted the http-request-metrics-fix branch August 27, 2024 12:55
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