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: rewrite and restructure #36909
Conversation
|
||
minioAccessKey = mkOption { | ||
type = types.str; | ||
example = "BKIKJAA5BMMU2RHO6IBB"; |
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 something that looks ... less ... real ...
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.
Yeah sure :)
(I kept this from the original exporter module)
and <literal>config.services.minio.accessKey</literal>. | ||
''; | ||
} // optionalAttrs config.services.minio.enable { | ||
default = config.services.minio.accessKey; |
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.
This should probably be set later in the config = ... bit instead, to avoid regenerating documentation.
and <literal>config.services.minio.secretKey</literal>. | ||
''; | ||
} // optionalAttrs config.services.minio.enable { | ||
default = config.services.minio.secretKey; |
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 as above ^
nixos/tests/exporters.nix
Outdated
"node" | ||
"snmp" | ||
# "unifi" # FIXME | ||
# "varnish" # FIXME |
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.
What is wrong with these FIXMEs?
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.
Oh no, I forgot to take out the test %)
I was just using it for myself.
(These exporters fail because they can't scrape anything in this VM)
I like the approach a lot. Can you document what it takes for a user to define their own exporter using this tooling? |
ab1a030
to
0cef4e2
Compare
0cef4e2
to
aae0826
Compare
@grahamc I added a postfix exporter module and wrote some documentation about it. |
aae0826
to
3dbbe33
Compare
You edited release notes for 18.03, so you want it to be cherry-picked into there? |
@vcunat Yes I would like to see it in there, but only if that's possible :) |
3dbbe33
to
6e5f5fb
Compare
- prometheus exporters are now configured with `services.prometheus.exporters.<name>` - the exporters are now defined by attribute sets from which the options for each exporter are generated - most of the exporter definitions are used unchanged, except for some changes that should't have any impact on the functionality.
6e5f5fb
to
c54aa1f
Compare
awesome! 🎉 |
Motivation for this change
Right now we have a single module for every prometheus-exporter (except for the ones that don't have one at all), each of them has basically the same content (except for exporter specific options).
Adding an option to all exporters or changing something that should affect all of them would require a change in each of these modules.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)cc/ @fpletz @vcunat @grahamc @globin
Thank's to @fpletz, @Ma27, @ciil, @grahamc and @globin for the feedback :)