Almost all service discovery can now be disabled, except for DNS-,
HTTP-, and file-based service discovery, which do not appear to include
extra code in the binary.
Before this change, bin/prometheus was about 38M and bin/promtool was
51M. Now, bin/prometheus is about 31M and bin/promtool is about 44M.
Assuming all service discovery is disabled, of course.
I read this hilarious blog post:
https://wejick.wordpress.com/2022/01/29/can-i-have-a-smaller-prometheus/
We can have a smaller Prometheus too. This patch allows users to remove
service discovery for five public clouds (AWS, Azure, DigitalOcean, GCP,
and Linode) and also Kubernetes, simply by setting the corresponding
enable-flag to `false`. I have tested building with each flag as I added
it to the list. I also tested running with all six flags set to `false`,
and the resulting Prometheus can still handle my orthogonal
service-discovery configuration (files).
To meet Adam Savage's definition of science, I measured the size of the
`prometheus` and `promtool` binaries after adding each flag with
`ls -h`.
flag | prometheus | promtool
--------------|------------|----------
starting size | 84M | 74M
AWS | 72M | 61M
Azure | 71M | 61M
GCE | 64M | 53M
k8s | 40M | 53M
DO | 39M | 52M
Linode | 38M | 51M
I did not go as far as the blog post. If folks want, I'll make the rest
of the service discovery optional too.
I did not shrink the build closure, just the output closure; we still
pull all of the various vendored modules into the Nix store during
builds. I don't see how to do this in a neat or easy way.
Apparently the handling of `buildFlagsArray` in `buildGo*` is blatantly
broken since it doesn't quote flags specified as list elements properly.
Because of that, the `-ldflags` are not interpreted properly and
`prometheus --version` doesn't output anything useful. By specifying
flags in both `buildFlags` and `buildFlagsArray` the issue gets fixed
since both variables are passed to `go install`.
v2.14 introduced a new experimental React UI and changed how web assets
are bundled with Prometheus. A separate pre-build command is required to
generate an asset bundle that gets statically linked into the Prometheus
binary.
As prometheus is no longer developed, nixpkgs now only includes
prometheus 2. Having only one version of prometheus, there is no need
for having the version in the attribute name.
So that people can easily try newer prometheus version
in overlays:
self: super: {
prometheus_2 = (super.callPackage <nixpkgs/pkgs/servers/monitoring/prometheus> {}).generic {
version = "2.8.1";
sha256 = "0x8w0qdh4lcf19nmdlhvgzpy08c2a932d3k49cjwhi5npcsf858n";
doCheck = false;
};
}
* pgadmin: use https homepage
* msn-pecan: move homepage to github
google code is now unavailable
* pidgin-latex: use https for homepage
* pidgin-opensteamworks: use github for homepage
google code is unavailable
* putty: use https for homepage
* ponylang: use https for homepage
* picolisp: use https for homepage
* phonon: use https for homepage
* pugixml: use https for homepage
* pioneer: use https for homepage
* packer: use https for homepage
* pokerth: usee https for homepage
* procps-ng: use https for homepage
* pycaml: use https for homepage
* proot: move homepage to .github.io
* pius: use https for homepage
* pdfread: use https for homepage
* postgresql: use https for homepage
* ponysay: move homepage to new site
* prometheus: use https for homepage
* powerdns: use https for homepage
* pm-utils: use https for homepage
* patchelf: move homepage to https
* tesseract: move homepage to github
* quodlibet: move homepage from google code
* jbrout: move homepage from google code
* eiskaltdcpp: move homepage to github
* nodejs: use https to homepage
* nix: use https for homepage
* pdf2djvu: move homepage from google code
* game-music-emu: move homepage from google code
* vacuum: move homepae from google code