Bug 295533 - [NEW PORT] sysutils/loki3: Grafana Loki 3.7.2
Summary: [NEW PORT] sysutils/loki3: Grafana Loki 3.7.2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Michael Gmelin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-05-23 21:55 UTC by Daniel Morante
Modified: 2026-06-01 11:58 UTC (History)
1 user (show)

See Also:


Attachments
Git diff patch (6.42 KB, patch)
2026-05-23 21:55 UTC, Daniel Morante
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Morante 2026-05-23 21:55:01 UTC
Created attachment 271060 [details]
Git diff patch

This is a new port for Grafana Loki v3.7.2, submitted as a separate port (sysutils/loki3) 
rather than an update to the existing sysutils/loki (v2.9.2) for the following reasons:

1. Major version with breaking changes: The Go module path changed from
   github.com/grafana/loki to github.com/grafana/loki/v3. Configuration
   schemas have changed between v2 and v3 and are not backward compatible.

2. Promtail removed: Loki v2 bundled promtail (log shipper) as part of the
   port with its own RC script, user/group, and config. In v3, promtail has
   been removed from the source tree entirely. Grafana's replacement is
   Grafana Alloy (sysutils/alloy). A version bump to the existing port would
   silently remove promtail from users' systems on upgrade.

3. Co-installability during migration: Users running Loki v2 in production
   need time to migrate configurations and switch from promtail to Alloy.
   A separate port (with CONFLICTS_INSTALL) allows both versions to exist
   in the ports tree simultaneously while v2 is phased out.

4. New binary: lokitool is a new admin utility added in v3 that did not
   exist in v2.

Notable Makefile details:

- Uses GO_MOD_DIST=github pattern (same as sysutils/alloy)
- post-fetch target extracts pkg/push/go.mod from the source tarball to
  satisfy a local "replace" directive before go mod download runs
  (similar pattern as sysutils/alloy)
- CONFLICTS_INSTALL with grafana-loki (v2)

Tested on 15.0 amd64, 14.3 amd64, 13.5 amd64 with Poudriere.

Changelog: https://github.com/grafana/loki/releases/tag/v3.7.2
Comment 1 commit-hook freebsd_committer freebsd_triage 2026-06-01 11:47:37 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=931b99597df4b513b211c21233130ef0486635ee

commit 931b99597df4b513b211c21233130ef0486635ee
Author:     Daniel Morante <daniel@morante.net>
AuthorDate: 2026-06-01 11:43:36 +0000
Commit:     Michael Gmelin <grembo@FreeBSD.org>
CommitDate: 2026-06-01 11:46:10 +0000

    sysutils/loki3: New port

    PR:             295533

 sysutils/Makefile                                  |  1 +
 sysutils/loki3/Makefile (new)                      | 71 ++++++++++++++++++++++
 sysutils/loki3/distinfo (new)                      |  5 ++
 sysutils/loki3/files/loki.in (new)                 | 71 ++++++++++++++++++++++
 .../patch-cmd-loki-loki-local-config.yaml (new)    | 17 ++++++
 sysutils/loki3/pkg-descr (new)                     |  4 ++
 sysutils/loki3/pkg-plist (new)                     | 13 ++++
 7 files changed, 182 insertions(+)
Comment 2 Michael Gmelin freebsd_committer freebsd_triage 2026-06-01 11:58:29 UTC
Thank you for your contribution, much appreciated.