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
Member

@mmilata 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

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.
The assertion was printed when user explicitly defined only the
configFile 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.
Copy link
Member

@WilliButz WilliButz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@WilliButz
Copy link
Member

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

@WilliButz WilliButz added the 8.has: port to stable A PR already has a backport to the stable release. label Mar 6, 2020
@mmilata mmilata deleted the prometheus-exporters-fixes branch March 6, 2020 09:52
@mmilata
Copy link
Member Author

mmilata commented Mar 6, 2020

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

@mmilata
Copy link
Member 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
Copy link
Member

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

@WilliButz
Copy link
Member

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
Development

Successfully merging this pull request may close these issues.

None yet

2 participants