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: add mqtt-exporter #289395

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

christoph-heiss
Copy link
Contributor

@christoph-heiss christoph-heiss commented Feb 16, 2024

Description of changes

This adds mqtt-exporter, a MQTT exporter for Prometheus, as a package itself.
Adds a corresponding services.prometheus.exporters.mqtt exporter, such that it can be easily configured & enabled. As well as a test for it, as it should be.

Depends on #288219.

Obsoleted by 1.4.2

Two patches are unfortunaly (currently) needed, one for providing some basic pyproject properties to allow it to build successfully, as upstream does not have [project] defined in their pyproject.toml, as well as not have setup.{cfg,py}. We could also manually assemble the package I guess, but that seemed like a pretty clean solution to me - or there is some even better solution?

Second patch addresses the lack of a configuration option to set the port the metrics exporter should listen on, which is an common option pre-defined for all exporters.

I intend to upstream both patches - in fact, I have already sent a PR upstream with both of them, so hopefully they can be dropped soon.

Both changes have been merged upstream, so they can be dropped with the next release. 🚀

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Feb 16, 2024
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 labels Feb 16, 2024
@github-actions github-actions bot added 8.has: documentation This PR adds or changes documentation 8.has: changelog labels Feb 17, 2024
@christoph-heiss christoph-heiss force-pushed the init/mqtt-exporter branch 2 times, most recently from 7ca4297 to 36558e8 Compare February 19, 2024 19:06
@christoph-heiss
Copy link
Contributor Author

Ping :^)

@christoph-heiss christoph-heiss changed the title mqtt-exporter: init at 1.4.1 mqtt-exporter: init at 1.4.2 Mar 31, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 3, 2024
@christoph-heiss christoph-heiss removed the 2.status: merge conflict This PR has merge conflicts with the target branch label May 20, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 22, 2024
@h7x4 h7x4 added 8.has: module (new) This PR adds a module in `nixos/` 8.has: tests This PR has tests labels Jun 1, 2024
@christoph-heiss christoph-heiss force-pushed the init/mqtt-exporter branch 4 times, most recently from 9f5d406 to 4220028 Compare August 22, 2024 10:31
@christoph-heiss christoph-heiss removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Aug 22, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/4627

Copy link
Member

@FliegendeWurst FliegendeWurst left a comment

Choose a reason for hiding this comment

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

LGTM

@christoph-heiss
Copy link
Contributor Author

LGTM

Thanks for the review! Fixed your suggestion.

pkgs/by-name/mq/mqtt-exporter/package.nix Outdated Show resolved Hide resolved
@christoph-heiss
Copy link
Contributor Author

I've now also added a check phase using pytestCheckHook, FWIW.

Copy link
Member

@FliegendeWurst FliegendeWurst left a comment

Choose a reason for hiding this comment

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

Would be good to have a prometheus maintainer review

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Nov 8, 2024
@christoph-heiss christoph-heiss changed the title mqtt-exporter: init at 1.4.2 mqtt-exporter: init at 1.5.0 Nov 29, 2024
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 1, 2024
@misuzu misuzu added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 6, 2024
@christoph-heiss christoph-heiss changed the title mqtt-exporter: init at 1.5.0 nixos/prometheus: add mqtt-exporter Dec 6, 2024
@christoph-heiss
Copy link
Contributor Author

christoph-heiss commented Dec 6, 2024

Package has been added in #360486 separately ..

@christoph-heiss christoph-heiss removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 6, 2024
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin and removed 10.rebuild-darwin: 1 10.rebuild-darwin: 1-10 labels Dec 6, 2024
@misuzu misuzu merged commit e8961d9 into NixOS:master Dec 6, 2024
32 of 33 checks passed
@christoph-heiss christoph-heiss deleted the init/mqtt-exporter branch December 6, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 8.has: tests This PR has tests 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants