victorialogs: init at 1.24.0 (#418806)

This commit is contained in:
Yorick
2025-06-23 17:05:41 +02:00
committed by GitHub
8 changed files with 109 additions and 9 deletions

View File

@@ -20,6 +20,8 @@
- `space-orbit` package has been removed due to lack of upstream maintenance. Debian upstream stopped tracking it in 2011.
- `command-not-found` package is now disabled by default; it works only for nix-channels based systems, and requires setup for it to work.
- `victoriametrics` no longer contains VictoriaLogs components. These have been separated into the new package `victorialogs`.
- `gnome-keyring` no longer ships with an SSH agent anymore because it has been deprecated upstream. You should use `gcr_4` instead, which provides the same features. More information on why this was done can be found on [the relevant GCR upstream PR](https://gitlab.gnome.org/GNOME/gcr/-/merge_requests/67).
- `lima` package now only includes the guest agent for the host's architecture by default. If your guest VM's architecture differs from your Lima host's, you'll need to enable the `lima-additional-guestagents` package by setting `withAdditionalGuestAgents = true` when overriding lima with this input.

View File

@@ -80,6 +80,8 @@
- `vmalert` now supports multiple instances with the option `services.vmalert.instances."".enable`
- [`services.victorialogs.package`](#opt-services.victorialogs.package) now defaults to `victorialogs`, as `victoriametrics` no longer contains the VictoriaLogs binaries.
- The `wstunnel` module was converted to RFC42-style settings, you will need to update your NixOS config if you make use of this module.
## Other Notable Changes {#sec-release-25.11-notable-changes}

View File

@@ -28,7 +28,7 @@ in
{
options.services.victorialogs = {
enable = mkEnableOption "VictoriaLogs is an open source user-friendly database for logs from VictoriaMetrics";
package = mkPackageOption pkgs "victoriametrics" { };
package = mkPackageOption pkgs "victorialogs" { };
listenAddress = mkOption {
default = ":9428";
type = types.str;

View File

@@ -1478,6 +1478,7 @@ in
vector = import ./vector { inherit runTest; };
velocity = runTest ./velocity.nix;
vengi-tools = runTest ./vengi-tools.nix;
victorialogs = runTest ./victorialogs.nix;
victoriametrics = handleTest ./victoriametrics { };
vikunja = runTest ./vikunja.nix;
virtualbox = handleTestOn [ "x86_64-linux" ] ./virtualbox.nix { };

View File

@@ -0,0 +1,26 @@
{ lib, ... }:
{
name = "victorialogs";
meta.maintainers = with lib.maintainers; [ marie ];
nodes.machine =
{ pkgs, ... }:
{
services.victorialogs.enable = true;
services.journald.upload = {
enable = true;
settings = {
Upload.URL = "http://localhost:9428/insert/journald";
};
};
environment.systemPackages = [ pkgs.curl ];
};
testScript = ''
machine.wait_for_unit("victorialogs.service")
machine.succeed("echo 'meow' | systemd-cat -p info")
machine.wait_until_succeeds("curl --fail http://localhost:9428/select/logsql/query -d 'query=\"meow\"' | grep meow")
'';
}

View File

@@ -0,0 +1,77 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nix-update-script,
nixosTests,
}:
buildGoModule (finalAttrs: {
pname = "VictoriaLogs";
version = "1.24.0";
src = fetchFromGitHub {
owner = "VictoriaMetrics";
repo = "VictoriaMetrics";
tag = "v${finalAttrs.version}-victorialogs";
hash = "sha256-E52hvxazzbz9FcPFZFcRHs2vVg6fJJQ8HsieQovQSi4=";
};
vendorHash = null;
subPackages = [
"app/victoria-logs"
"app/vlinsert"
"app/vlselect"
"app/vlstorage"
"app/vlogsgenerator"
"app/vlogscli"
];
postPatch = ''
# main module (github.com/VictoriaMetrics/VictoriaMetrics) does not contain package
# github.com/VictoriaMetrics/VictoriaMetrics/app/vmui/packages/vmui/web
#
# This appears to be some kind of test server for development purposes only.
# rm -f app/vmui/packages/vmui/web/{go.mod,main.go}
# Increase timeouts in tests to prevent failure on heavily loaded builders
substituteInPlace lib/storage/storage_test.go \
--replace-fail "time.After(10 " "time.After(120 " \
--replace-fail "time.NewTimer(30 " "time.NewTimer(120 " \
--replace-fail "time.NewTimer(time.Second * 10)" "time.NewTimer(time.Second * 120)" \
'';
ldflags = [
"-s"
"-w"
"-X github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo.Version=${finalAttrs.version}"
];
preCheck = ''
# `lib/querytracer/tracer_test.go` expects `buildinfo.Version` to be unset
export ldflags=''${ldflags//=${finalAttrs.version}/=}
'';
__darwinAllowLocalNetworking = true;
passthru = {
tests = {
inherit (nixosTests)
victorialogs
;
};
updateScript = nix-update-script {
extraArgs = [ "--version-regex=(.*)-victorialogs" ];
};
};
meta = {
homepage = "https://docs.victoriametrics.com/victorialogs/";
description = "User friendly log database from VictoriaMetrics";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ marie ];
changelog = "https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/${finalAttrs.src.tag}";
mainProgram = "victoria-logs";
};
})

View File

@@ -9,7 +9,6 @@
withVmAuth ? true, # HTTP proxy for authentication
withBackupTools ? true, # vmbackup, vmrestore
withVmctl ? true, # vmctl is used to migrate time series
withVictoriaLogs ? true, # logs server
}:
buildGoModule (finalAttrs: {
@@ -43,12 +42,6 @@ buildGoModule (finalAttrs: {
++ lib.optionals withBackupTools [
"app/vmbackup"
"app/vmrestore"
]
++ lib.optionals withVictoriaLogs [
"app/victoria-logs"
"app/vlinsert"
"app/vlselect"
"app/vlstorage"
];
postPatch = ''

View File

@@ -6,7 +6,6 @@
lib.addMetaAttrs { mainProgram = "vmagent"; } (
victoriametrics.override {
withServer = false;
withVictoriaLogs = false;
withVmAlert = false;
withVmAuth = false;
withBackupTools = false;