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

prometheus-knot-exporter: init at 2021-01-30; minor module improvements #115185

Merged
merged 6 commits into from Mar 11, 2021

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Mar 5, 2021

Motivation for this change
  • Create package, module & test for knot_exporter
  • Use types.port for port option
  • Throw an evaluation error if firewallFilter is set and openFirewall is false since firewallFilter doesn't do anything if openFirewall isn't set.
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.

@r-rmcgibbo
Copy link

Result of nixpkgs-review pr 115185 at 2838365 run on x86_64-linux 1

1 package built:

pkgs/servers/monitoring/prometheus/knot-exporter.nix Outdated Show resolved Hide resolved

install -Dm0755 knot_exporter $out/bin/knot_exporter
patchShebangs $out/bin
buildPythonPath ${python3.pkgs.prometheus_client}
Copy link
Member

Choose a reason for hiding this comment

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

Something for another PR: prometheus_client should be renamed to prometheus-client.

@WilliButz WilliButz merged commit 3ceef81 into NixOS:master Mar 11, 2021
@Ma27 Ma27 deleted the knot-exporter branch March 11, 2021 18:19
Ma27 added a commit that referenced this pull request Mar 13, 2021
…s set

If `openFirewall = true`, but no `firewallFilter` is set, the evaluation
fails with the following error:

    The option `services.prometheus.exporters.node.firewallFilter` is defined both null and
    not null, in `/home/ma27/Projects/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix'
    and `/home/ma27/Projects/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix'.

Originally introduced by me in #115185. The problem is that
`mkOptionDefault` has - as its name suggests - the same priority as the
default-value of the option `firewallFilter` and thus it conflicts if
this declaration and the actual default value are set which is the case
if `firewallFilter` isn't specified somewhere else.
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

4 participants