Skip to content
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

nixos/prometheus-*-exporters: minor fixes #81854

Merged
merged 5 commits into from Mar 6, 2020

Conversation

@mmilata
Copy link
Contributor

mmilata commented Mar 6, 2020

I've been playing with Prometheus and the NixOS modules are very nice! Run into a few problems in the exporters which this PR fixes:

  • permitted values for logging options of SNMP exporter have changed in recent version (makes the NixOS test fail)
  • disableFileDelition for mail exporter is misspelled and has no effect
  • assertions that force user to either use configuration or configFile options do not work as intended, the assertion is triggered when user uses just configFile and doesn't touch configuration
  • some shell arguments are not escaped so the command breaks for e.g. unifiPassword containing space (or filesystem path w/ space, eww)
Motivation for this change

NixOS prometheus experience only 98 % smooth.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

cc @WilliButz

mmilata added 5 commits Mar 5, 2020
The allowed values have changed in bd3319d.

0.15:
      --log.level="info"        Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal]
      --log.format="logger:stderr"
                                Set the log target and format. Example: "logger:syslog?appname=bob&local=7" or "logger:stdout?json=true"

0.17:
      --log.level=info          Only log messages with the given severity or above. One of: [debug, info, warn, error]
      --log.format=logfmt       Output format of log messages. One of: [logfmt, json]
The assertion was printed when user explicitly defined only the
configurationPath option.
 - Fix misspelled option. mkRenamedOptionModule is not used because the
   option hasn't really worked before.
 - Add missing cfg.telemetryPath arg to ExecStart.
 - Fix mkdir invocation in test.
The assertion was printed when user explicitly defined only the
configFile option.
Copy link
Member

WilliButz left a comment

Glad to see you enjoy the prometheus modules, also thank you very much for the cleanup 👍

@WilliButz WilliButz merged commit ff3c06a into NixOS:master Mar 6, 2020
13 checks passed
13 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@WilliButz

This comment has been minimized.

Copy link
Member

WilliButz commented Mar 6, 2020

backported to 20.03 in c3bb46e, 6673c4f, bddb172, f382c70, ebb7ec3

@mmilata mmilata deleted the mmilata:prometheus-exporters-fixes branch Mar 6, 2020
@mmilata

This comment has been minimized.

Copy link
Contributor Author

mmilata commented Mar 6, 2020

Thank you for the swift review & taking care of backporting!

@mmilata

This comment has been minimized.

Copy link
Contributor Author

mmilata commented Mar 6, 2020

@WilliButz I realized that 20.03 has the older version of the SNMP exporter so now the module options mismatch those of the package. Should we revert 6673c4f or backport bd3319d?

@WilliButz

This comment has been minimized.

Copy link
Member

WilliButz commented Mar 6, 2020

Oh, thanks for noticing. The exporter version bump should have already been backported. I'll do that in a moment.

@WilliButz

This comment has been minimized.

Copy link
Member

WilliButz commented Mar 6, 2020

backported the exporter update in b417adb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.