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
Prometheus exporters #21422
Conversation
@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"; |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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}"; |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetchFromGitHub
6b009b4
to
ffe806e
Compare
There was a problem hiding this 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?
- use ExecStart and ExecReload - add extraFlags
Yeah, I know, it's a git snapshot. Sorry.
Cleaned this up a bit and added stuff we had lying around in our fork. |
Motivation for this change
I started using Prometheus recently and I needed to export some stuff.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)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.