diff --git a/nixos/doc/manual/release-notes/rl-2605.section.md b/nixos/doc/manual/release-notes/rl-2605.section.md index 5220d49e71e2..87f080f01291 100644 --- a/nixos/doc/manual/release-notes/rl-2605.section.md +++ b/nixos/doc/manual/release-notes/rl-2605.section.md @@ -173,6 +173,10 @@ of pulling the upstream container image from Docker Hub. If you want the old beh If you need to rotate, a [3rd-party tool, `grafana-secretkey-rotation-tool`](https://github.com/erooke/grafana-secretkey-rotation-tool/tree/d9dc788902fa5185e15cb15ce6129f7237ab6138) is a tested option. When using a secret for this value, make sure to use [Grafana's variable expansion to inject secrets](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#variable-expansion). +- `services.promtail` has been removed, as `promtail` reached its end of life. + Consider migrating to [](#opt-services.alloy.enable), or, if you are looking for something light-weight, [](#opt-services.fluent-bit.enable). + See or . + - Ethercalc and its associated module have been removed, as the package is unmaintained and cannot be installed from source with npm now. - `services.immich` no longer supports pgvecto.rs since the package has been removed from nixpkgs. diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index df81fa95aca2..c3f7074e944a 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -745,7 +745,6 @@ ./services/logging/logcheck.nix ./services/logging/logrotate.nix ./services/logging/logstash.nix - ./services/logging/promtail.nix ./services/logging/rsyslogd.nix ./services/logging/syslog-ng.nix ./services/logging/syslogd.nix diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 8843fdd68f79..63d1d1d9700d 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -221,6 +221,17 @@ in ] "The grafana-agent module has been removed. Consider migrating to `grafana-alloy` (`services.alloy.enable`). See " ) + (mkRemovedOptionModule + [ + "services" + "promtail" + ] + '' + The promtail module has been removed, as promtail reached its end of life. + Consider migrating to `grafana-alloy` (`services.alloy.enable`), or, if you are looking for something light-weight, `fluent-bit` (`services.fluent-bit.enable`). + See or . + '' + ) (mkRemovedOptionModule [ "services" "homeassistant-satellite" ] "The `services.homeassistant-satellite` module has been replaced by `services.wyoming-satellite`." ) diff --git a/nixos/modules/services/logging/promtail.nix b/nixos/modules/services/logging/promtail.nix deleted file mode 100644 index cc3f1bd1f5d1..000000000000 --- a/nixos/modules/services/logging/promtail.nix +++ /dev/null @@ -1,119 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; -let - cfg = config.services.promtail; - - format = pkgs.formats.json { }; - prettyJSON = - conf: - with lib; - pipe conf [ - (flip removeAttrs [ "_module" ]) - (format.generate "promtail-config.json") - ]; - - allowSystemdJournal = - cfg.configuration ? scrape_configs && lib.any (v: v ? journal) cfg.configuration.scrape_configs; - - allowPositionsFile = !lib.hasPrefix "/var/cache/promtail" positionsFile; - positionsFile = cfg.configuration.positions.filename; - - configFile = if cfg.configFile != null then cfg.configFile else prettyJSON cfg.configuration; - -in -{ - options.services.promtail = with types; { - enable = mkEnableOption "the Promtail ingresser"; - - configuration = mkOption { - type = format.type; - description = '' - Specify the configuration for Promtail in Nix. - This option will be ignored if `services.promtail.configFile` is defined. - ''; - }; - - configFile = mkOption { - type = nullOr path; - default = null; - description = '' - Config file path for Promtail. - If this option is defined, the value of `services.promtail.configuration` will be ignored. - ''; - }; - - extraFlags = mkOption { - type = listOf str; - default = [ ]; - example = [ "--server.http-listen-port=3101" ]; - description = '' - Specify a list of additional command line flags, - which get escaped and are then passed to Loki. - ''; - }; - }; - - config = mkIf cfg.enable { - services.promtail.configuration.positions.filename = mkDefault "/var/cache/promtail/positions.yaml"; - - systemd.services.promtail = { - description = "Promtail log ingress"; - wantedBy = [ "multi-user.target" ]; - stopIfChanged = false; - - serviceConfig = { - Restart = "on-failure"; - TimeoutStopSec = 10; - - ExecStartPre = "${lib.getExe pkgs.promtail} -config.file=${configFile} -check-syntax"; - ExecStart = "${pkgs.promtail}/bin/promtail -config.file=${configFile} ${escapeShellArgs cfg.extraFlags}"; - - ProtectSystem = "strict"; - ProtectHome = true; - PrivateTmp = true; - PrivateDevices = true; - ProtectKernelTunables = true; - ProtectControlGroups = true; - RestrictSUIDSGID = true; - PrivateMounts = true; - CacheDirectory = "promtail"; - ReadWritePaths = lib.optional allowPositionsFile (dirOf positionsFile); - - User = "promtail"; - Group = "promtail"; - - CapabilityBoundingSet = ""; - NoNewPrivileges = true; - - ProtectKernelModules = true; - SystemCallArchitectures = "native"; - ProtectKernelLogs = true; - ProtectClock = true; - - LockPersonality = true; - ProtectHostname = true; - RestrictRealtime = true; - MemoryDenyWriteExecute = true; - PrivateUsers = true; - - SupplementaryGroups = lib.optional allowSystemdJournal "systemd-journal"; - } - // (optionalAttrs (!pkgs.stdenv.hostPlatform.isAarch64) { - # FIXME: figure out why this breaks on aarch64 - SystemCallFilter = "@system-service"; - }); - }; - - users.groups.promtail = { }; - users.users.promtail = { - description = "Promtail service user"; - isSystemUser = true; - group = "promtail"; - }; - }; -} diff --git a/pkgs/by-name/gr/grafana-loki/package.nix b/pkgs/by-name/gr/grafana-loki/package.nix index ea2b8aae4816..6632969b7d13 100644 --- a/pkgs/by-name/gr/grafana-loki/package.nix +++ b/pkgs/by-name/gr/grafana-loki/package.nix @@ -1,12 +1,9 @@ { - stdenv, lib, buildGoModule, fetchFromGitHub, - makeWrapper, nix-update-script, nixosTests, - systemd, testers, grafana-loki, }: @@ -28,21 +25,10 @@ buildGoModule (finalAttrs: { # TODO split every executable into its own package "cmd/loki" "cmd/loki-canary" - "clients/cmd/promtail" "cmd/logcli" "cmd/lokitool" ]; - tags = [ "promtail_journal_enabled" ]; - - nativeBuildInputs = [ makeWrapper ]; - buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ systemd.dev ]; - - preFixup = lib.optionalString stdenv.hostPlatform.isLinux '' - wrapProgram $out/bin/promtail \ - --prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib" - ''; - passthru = { tests = { inherit (nixosTests) loki; @@ -71,7 +57,7 @@ buildGoModule (finalAttrs: { meta = { description = "Like Prometheus, but for logs"; - mainProgram = "promtail"; + mainProgram = "loki"; license = with lib.licenses; [ agpl3Only asl20 diff --git a/pkgs/by-name/pr/promtail/package.nix b/pkgs/by-name/pr/promtail/package.nix deleted file mode 100644 index 1058ceed3e48..000000000000 --- a/pkgs/by-name/pr/promtail/package.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ grafana-loki }: - -grafana-loki.overrideAttrs (previousAttrs: { - pname = "promtail"; - subPackages = [ "clients/cmd/promtail" ]; - env = previousAttrs.env or { } // { - CGO_ENABLED = 1; - }; -}) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index b67c5f068e14..bc6fe19e9f63 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1643,6 +1643,7 @@ mapAliases { proj_7 = throw "proj_7 has been removed, as it was broken and unused"; # Added 2025-09-16 prometheus-dmarc-exporter = throw "'prometheus-dmarc-exporter' has been renamed to/replaced by 'dmarc-metrics-exporter'"; # Converted to throw 2025-10-27 prometheus-dovecot-exporter = throw "'prometheus-dovecot-exporter' has been renamed to/replaced by 'dovecot_exporter'"; # Converted to throw 2025-10-27 + promtail = throw "promtail has been removed, as it reached its end of life. Consider migrating to 'grafana-alloy' or 'fluent-bit'"; # Added 2026-03-30 protobuf3_21 = throw "'protobuf3_21' has been renamed to/replaced by 'protobuf_21'"; # Converted to throw 2025-10-27 protobuf3_24 = throw "'protobuf_24' has been removed from nixpkgs. Consider using a more recent version of the protobuf library"; # Added 2025-07-14 protobuf_24 = throw "'protobuf_24' has been removed from nixpkgs. Consider using a more recent version of the protobuf library"; # Added 2025-07-14