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
Add Prometheus 2 service in parallel with 1.x version (continuation) #58255
Conversation
As the configuration for the exporters and alertmanager is unchanged between the two major versions this patch tries to minimize duplication while at the same time as there's no upgrade path from 1.x to 2.x, it allows running the two services in parallel. See also NixOS#56037
This uses fewer lines of code and one less process.
Previously the prometheus.service file looked like: ExecStart=/nix/store/wjkhfw3xgkmavz1akkqir99w4lbqhak7-prometheus-1.8.2-bin/bin/prometheus -storage.local.path=/var/lib/prometheus/metrics \ -config.file=/nix/store/zsnvzw51mk3n1cxjd0351bj39k1j6j27-prometheus.yml-check-config-checked \ -web.listen-address=0.0.0.0:9090 \ -alertmanager.notification-queue-capacity=10000 \ -alertmanager.timeout=10s \ \ Restart=always Now it's: ExecStart=/nix/store/wjkhfw3xgkmavz1akkqir99w4lbqhak7-prometheus-1.8.2-bin/bin/prometheus \ -storage.local.path=/var/lib/prometheus/metrics \ -config.file=/nix/store/zsnvzw51mk3n1cxjd0351bj39k1j6j27-prometheus.yml-check-config-checked \ -web.listen-address=0.0.0.0:9090 \ -alertmanager.notification-queue-capacity=10000 \ -alertmanager.timeout=10s Restart=always
@jbgi I just pushed a commit which registers the @GrahamcOfBorg test prometheus prometheus2 |
I added the changes around Prometheus to the 19.09 release notes. I think this is ready to be merged now. If nobody objects I'll merge after the checks are green. |
@jbgi @fpletz I was thinking of adding 60507cc to this PR to add a bit more backwards compatibility by keeping the |
@basvandijk thanks! backporting this PR would be great indeed. Just a minor nitpick about |
@jbgi thanks for the heads-up regarding the deprecation of |
@basvandijk just |
This is to ensure more backwards compatibility. Note this is not 100% backwards compatible because we now require dataDir to begin with /var/lib/.
Thanks. I just pushed these commits to this PR. Will merge after the checks are green. @GrahamcOfBorg test prometheus prometheus2 |
Motivation for this change
Continuation of the work done by @azazel75 in #49802, addressing remaining review points.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)