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
Backport prometheus2 to release-19.03 #59262
Merged
basvandijk
merged 15 commits into
NixOS:release-19.03
from
basvandijk:prometheus2-release-19.03
Apr 16, 2019
Merged
Backport prometheus2 to release-19.03 #59262
basvandijk
merged 15 commits into
NixOS:release-19.03
from
basvandijk:prometheus2-release-19.03
Apr 16, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; }; } (cherry picked from commit 670359e)
Since the `generic` function is now exported it should have a less generic name, pun intended. (cherry picked from commit b6fdd1a)
See: https://github.com/prometheus/prometheus/releases/tag/v2.8.1 (cherry picked from commit 2a72217)
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 (cherry picked from commit 11b8972)
(cherry picked from commit 1b6ce80)
(cherry picked from commit e17b464)
(cherry picked from commit bfbae97)
(cherry picked from commit 5ae2592)
(cherry picked from commit 0333d87)
This uses fewer lines of code and one less process. (cherry picked from commit a59c929)
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 (cherry picked from commit 7cf27fe)
(cherry picked from commit 3949700)
(cherry picked from commit eed84d1)
This is to ensure more backwards compatibility. Note this is not 100% backwards compatible because we now require dataDir to begin with /var/lib/. (cherry picked from commit c95179b)
@GrahamcOfBorg test prometheus prometheus2 |
10 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
I would like to use Prometheus-2 on the upcoming 19.03 release. @jbgi also expressed a desire for this.
This backports PRs #58255, #59175 and #59182 to
release-19.03
.It also includes a note about this in the 19.03 release notes.
@samueldr @lheckemann this mainly involves the addition of the new
services.prometheus2
module. However, there's one minor backwards incompatibility: the optionservices.prometheus.dataDir
is now required to have/var/lib/
as a prefix. Note that it defaulted and still defaults to/var/lib/prometheus
. This is also documented in the 19.03 release notes. I think it's safe to merge.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)