Skip to content

fix(extract): avoid mutating metric values during extraction - #23

Open
belowzeroff wants to merge 1 commit into
KxSystems:masterfrom
belowzeroff:fix/f005-metricvals-mutation
Open

fix(extract): avoid mutating metric values during extraction#23
belowzeroff wants to merge 1 commit into
KxSystems:masterfrom
belowzeroff:fix/f005-metricvals-mutation

Conversation

@belowzeroff

Copy link
Copy Markdown
Contributor

Avoid in-place mutation of metric values while rendering Prometheus output. This keeps extraction side-effect free for callers that reuse metric state after scraping.

extractall used `metricvals,:select name,asc each val ...` which
upserted sorted values back into the global metricvals table as a
side effect of extracting metrics. This mutated shared state during
a read operation and caused wasteful re-sorting on every scrape.

Fix: sort values inside `summary` (which was missing `asc`) instead
of pre-sorting in extractall. histogram already sorted its input.
Remove the mutation from extractall entirely.
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.

1 participant