zrepl/zfs
Goran Mekic bc5e1ede04
metric to detect filesystems rules that don't match any local dataset (#653)
This PR adds a Prometheus counter called
`zrepl_zfs_list_unmatched_user_specified_dataset_count`.
Monitor for increases of the counter to detect filesystem filter rules that
have no effect because they don't match any local filesystem.

An example use case for this is the following story:
1. Someone sets up zrepl with `filesystems` filter for `zroot/pg14<`.
2. During the upgrade to Postgres 15, they rename the dataset to `zroot/pg15`,
   but forget to update the zrepl `filesystems` filter.
3. zrepl will not snapshot / replicate the `zroot/pg15<` datasets.

Since `filesystems` rules are always evaluated on the side that has the datasets,
we can smuggle this functionality into the `zfs` module's `ZFSList` function that
is used by all jobs with a `filesystems` filter.

Dashboard changes:
- histogram with increase in $__interval, one row per job
- table with increase in $__range
- explainer text box, so, people know what the previous two are about
We had to re-arrange some panels, hence the Git diff isn't great.

closes https://github.com/zrepl/zrepl/pull/653

Co-authored-by: Christian Schwarz <me@cschwarz.com>
Co-authored-by: Goran Mekić <meka@tilda.center>
2023-05-02 22:13:52 +02:00
..
property [#285] support setting zfs send / recv flags in the config (send: -wLcepbS, recv: -ox) 2021-02-20 17:20:45 +01:00
test_helpers Implement DatasetMapping + basic ZFS list functionality. 2017-04-26 17:39:16 +02:00
zfscmd metric to detect filesystems rules that don't match any local dataset (#653) 2023-05-02 22:13:52 +02:00
datasetpath_visitor_test.go [#342] endpoint: always create unencrypted placeholder filesystems 2020-07-26 20:32:35 +02:00
datasetpath_visitor.go [#342] endpoint: always create unencrypted placeholder filesystems 2020-07-26 20:32:35 +02:00
encryption.go [#285] support setting zfs send / recv flags in the config (send: -wLcepbS, recv: -ox) 2021-02-20 17:20:45 +01:00
filesystemplaceholdercreateencryptionvalue_enumer.go fix encrypt-on-receive with placeholders 2021-12-18 15:12:47 +01:00
holds.go endpoint: refactor, fix stale holds on initial replication failure, zfs-abstractions subcmd, more efficient ZFS queries 2020-04-18 12:26:03 +02:00
mapping.go metric to detect filesystems rules that don't match any local dataset (#653) 2023-05-02 22:13:52 +02:00
namecheck_test.go new features: {resumable,encrypted,hold-protected} send-recv, last-received-hold 2020-02-14 22:00:13 +01:00
namecheck.go run go1.19 gofmt and make adjustments as needed 2022-10-24 22:22:41 +02:00
placeholder.go fix encrypt-on-receive with placeholders 2021-12-18 15:12:47 +01:00
prometheus.go metric to detect filesystems rules that don't match any local dataset (#653) 2023-05-02 22:13:52 +02:00
propertysource_enumer.go zfs: PropertySource: set type to uint32 so that enumer-generated code is platform-independent 2021-03-14 22:32:45 +01:00
resume_token.go zfs: ResumeToken: parse embedok, largeblockok, savedok if available 2021-02-20 17:04:57 +01:00
versions_destroy_test.go zfs: use exec.CommandContext everywhere 2020-03-27 13:08:43 +01:00
versions_destroy.go add ZREPL_DESTROY_MAX_BATCH_SIZE env var to control max batch destroy size 2022-06-30 09:22:26 +02:00
versions.go [#285] support setting zfs send / recv flags in the config (send: -wLcepbS, recv: -ox) 2021-02-20 17:20:45 +01:00
zfs_debug.go go1.19: switch to new nolint directive that is compatible with Go 1.19 gofmt 2022-10-24 22:22:11 +02:00
zfs_pipe_linux.go zfs: pipe size: default to value of /proc/sys/fs/pipe-max-siz 2021-03-25 22:24:50 +01:00
zfs_pipe.go go1.17: run goimports to supports the new //go:build lines 2021-10-09 16:51:08 +02:00
zfs_test.go [#285] support setting zfs send / recv flags in the config (send: -wLcepbS, recv: -ox) 2021-02-20 17:20:45 +01:00
zfs.go go1.19: zfs.SendStream.Close() after EOF would return context cancellation error 2022-10-27 00:19:06 +02:00