Repository navigation
feat: the same run, as numbers a node_exporter can pick up - #40
Closed
AlexeyShalaev wants to merge 1 commit into
Closed
AlexeyShalaev wants to merge 1 commit into
AlexeyShalaev wants to merge 1 commit into
Conversation
Most systems that partition PostgreSQL have no monitoring of it at all -- they find out at 03:00, from an insert PostgreSQL rejected. A CronJob already runs this on a schedule, so the cheapest monitoring available is for that run to leave a textfile behind. --output metrics renders any command as Prometheus text exposition. plan emits pending operations by kind and findings by severity, inspect the size of the tree and the age of the oldest orphan, validate whether each table still matches its configuration, apply what it did and what it could not. Everything is a gauge: a one-shot job cannot own a counter, because the next run is a new process with no memory of this one. Every run stamps run_timestamp_seconds so a textfile nothing refreshed reads as stale rather than as good news, and a converged table reports zeroes rather than nothing -- a missing series and a zero are different alerts. The numbers are read off the same envelope the JSON is, so a metric cannot disagree with what the same run printed.
Member
Author
|
Folded into #43, one PR for the whole epic; this branch stays for history. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not in #32; argued for in the status comment. The OSS survey in
docs/design/oss-research.mdsays most systems that partition PostgreSQL have no monitoring of it at all — they find out at 03:00, from an insert PostgreSQL rejected. A CronJob already runs this tool on a schedule, so the cheapest monitoring available is for that run to leave a textfile behind:pg-partsmith plan -c partitions.yaml --output metrics > /var/lib/node_exporter/textfile/partsmith.promplanpending_operations{table,kind},pending_relations{table},findings{table,severity}inspectpartitioned{table},partitions{table},detached_partitions{table},oldest_detached_age_seconds{table}validateconfig_valid{table}applyapplied_operations{table,operation},issues{table}All prefixed
pg_partsmith_, all gauges — a one-shot job cannot own a counter, since the next run is a new process with no memory of this one. Every run stampspg_partsmith_run_timestamp_seconds{command}so a textfile nothing refreshed reads as stale rather than as good news, and a converged table reports zeroes rather than nothing: a missing series and a zero are different alerts.The numbers are read off the same envelope the JSON is, so a metric cannot disagree with what the same run printed.
CommandResult.rendernow takesoutput=rather than a boolean, which is the only signature that moved.The docs list the three alerts worth having, in the order they will save you. 10 unit tests + 1 against a real PostgreSQL.
Stacked on #39.