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 exporters #21422

Merged
merged 7 commits into from Jan 9, 2017
Merged

Prometheus exporters #21422

merged 7 commits into from Jan 9, 2017

Conversation

MostAwesomeDude
Copy link
Contributor

Motivation for this change

I started using Prometheus recently and I needed to export some stuff.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

This all appears to work; https://graphs.matador.cloud/dashboard/db/web-status shows off the nginx and Varnish support, while https://graphs.matador.cloud/dashboard/db/storage-overview uses JSON scraping.

@mention-bot
Copy link

@MostAwesomeDude, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @bjornfor and @offlinehacker to be potential reviewers.

buildGoPackage rec {
name = "prometheus_varnish_exporter-${version}";
version = "20161126-${stdenv.lib.strings.substring 0 7 rev}";
rev = "218cffa79f9b56de6a21a9244d74bdc2ec089473";
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason not to use a released version here? https://github.com/jonnenauha/prometheus_varnish_exporter/releases


goPackagePath = "github.com/jonnenauha/prometheus_varnish_exporter";

src = fetchgit {
Copy link
Member

Choose a reason for hiding this comment

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

fetchFromGitHub is preferred here.

meta = {
homepage = "https://github.com/jonnenauha/prometheus_varnish_exporter";
description = "Varnish exporter for Prometheus";
license = lib.licenses.mit;
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to maintain this package?

exec ${pkgs.prometheus-nginx-exporter}/bin/nginx_exporter \
-nginx.scrape_uri '${cfg.scrapeURI}' \
-telemetry.address :${toString cfg.port} \
${concatStringsSep " \\\n " cfg.extraFlags}
Copy link
Member

Choose a reason for hiding this comment

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

script is unnecessary here. Please use ExecStart directly.

export PATH=${pkgs.varnish}/bin
exec ${pkgs.prometheus-varnish-exporter}/bin/prometheus_varnish_exporter \
-web.listen-address :${toString cfg.port} \
${concatStringsSep " \\\n " cfg.extraFlags}
Copy link
Member

Choose a reason for hiding this comment

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

Same here. The PATH can be extended using the path property.


buildGoPackage rec {
name = "prometheus-json-exporter-${version}";
version = "20160913-${stdenv.lib.strings.substring 0 7 rev}";
Copy link
Member

Choose a reason for hiding this comment

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

Please use the following version scheme for packages with releases: prometheus-json-exporter-unstable-2016-09-13

exec ${pkgs.prometheus-json-exporter}/bin/prometheus-json-exporter \
--port ${toString cfg.port} \
${cfg.url} ${cfg.configFile} \
${concatStringsSep " \\\n " cfg.extraFlags}
Copy link
Member

Choose a reason for hiding this comment

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

same here: script -> ExecStart


goPackagePath = "github.com/kawamuray/prometheus-json-exporter";

src = fetchgit {
Copy link
Member

Choose a reason for hiding this comment

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

fetchFromGitHub

Copy link
Member

@fpletz fpletz left a comment

Choose a reason for hiding this comment

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

Thanks! Great work! 👍

But could you please squash your fixes into the previous commits?

@globin
Copy link
Member

globin commented Jan 9, 2017

Cleaned this up a bit and added stuff we had lying around in our fork.

@globin globin merged commit 618b249 into NixOS:master Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants