New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rtl_433 Prometheus exporter #96511
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check https://nixos.org/nixpkgs/manual/#submitting-changes-making-patches re: commit message formatting.
In general it's also preferred to split off package and NixOS module into two separate commits.
nixos/modules/services/monitoring/prometheus/exporters/rtl_433.nix
Outdated
Show resolved
Hide resolved
nixos/modules/services/monitoring/prometheus/exporters/rtl_433.nix
Outdated
Show resolved
Hide resolved
8cf12e4
to
97005a0
Compare
Thanks for the quick review. PTAL, refactored how I build the matcher options in the module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small issue left.
nixos/modules/services/monitoring/prometheus/exporters/rtl_433.nix
Outdated
Show resolved
Hide resolved
d4a6f42
to
25f1f44
Compare
72d9ce8
to
60ea72d
Compare
a214c9f
to
c404562
Compare
92f527f
to
b73d88d
Compare
FYI I'm now using this successfully on one of my systems. delroth/infra.delroth.net@067c709 @WilliButz any way you could help move this PR forward? I've done some review passes already and I feel like it's in a good shape, modulo one comment on "how to enable the hardware.* support when the exporter is enabled" still pending. |
rtl-sdr latest release 0.6.0 is from 2018. Six months ago master received a patch[1] to use improved udev rules that chown to plugdev instead of making the devices world-read-writable. This change backports [1] as an upstream patch. [1] https://osmocom.org/projects/rtl-sdr/repository/revisions/b2814731563be4d5a0a68554ece6454a2c63af12
This is a very thin module to ensure "plugdev" user exists and some udev rules are enabled, a prerequisite for using rtl-sdr.
b73d88d
to
5163878
Compare
Upstream tagged a release, updated to use it instead of commit hash. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please excuse my delayed review, I made a few small improvement suggestions, otherwise this looks good to me.
Thanks for the contribution 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Motivation for this change
NixOS already packages rtl_433, an SDR receiver that among other things can decode metrics broadcast by 433MHz appliances such as thermometers.
This PR adds a lightweight Prometheus exporter written in Go for rtl_433 metrics.
I had to add further pkgs/modules (see first commits) to make that work seamlessly:
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)