Commit Graph

21 Commits

Author SHA1 Message Date
0fca6e4e93 fix(correlation): Keep-Alive time window + orphan timer + TTL purge (v1.1.14)
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
Bug #1 - processSourceA: utilise bEventHasValidTTL en mode one_to_many
  au lieu de eventsMatch qui comparait les timestamps originaux. Apres ~10s
  les requetes A devenaient toutes orphelines alors que la session KA etait active.

Bug #4 - checkPendingOrphansForCorrelation: meme correction, cle identique
  = meme connexion en one_to_many, pas besoin de comparer les timestamps.

Bug #3 - cleanNetworkBufferByTTL: expiration B => emission immediate
  des pending orphans associes (ils ne peuvent plus jamais corréler).

Bug #2 - Orchestrateur: goroutine ticker 250ms appelle EmitPendingOrphans()
  pour drainer les orphans independamment du flux d'evenements entrants.
  EmitPendingOrphans() expose la methode comme publique thread-safe.

Tests: 4 nouveaux tests de non-regression (un par bug).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 17:01:37 +01:00
7423bb4614 fix(v1.1.13): socket ownership, correlation bugs, keepalive_seq
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
Socket Unix / systemd:
- RuntimeDirectory=logcorrelator dans logcorrelator.service : systemd
  recrée /run/logcorrelator avec logcorrelator:logcorrelator à chaque
  démarrage/restart, éliminant le problème de droits root:root
- Ajout de packaging/rpm/logcorrelator-tmpfiles.conf pour recréer le
  répertoire au boot via systemd-tmpfiles (couche de protection boot)
- Retrait de /var/run/logcorrelator du RPM %files et du %post
- Dockerfile.package : copie de logcorrelator-tmpfiles.conf dans SOURCES/

Corrélation — bugs:
- Fix CRITIQUE emitPendingOrphans : corruption de slice lors de l'expiration
  simultanée de plusieurs orphelins pour la même clé (aliasing du tableau
  sous-jacent, orphelins émis en double et fantômes persistants)
- Fix HAUT rotateOldestA : événement silencieusement perdu même avec
  ApacheAlwaysEmit=true ; retourne désormais *CorrelatedLog propagé dans
  ProcessEvent
- Fix MOYEN processSourceB (pending orphan path) : en mode one_to_many, le
  B event n'était pas bufferisé après corrélation avec un pending orphan A,
  cassant le Keep-Alive pour les requêtes A2+ sur la même connexion
- Fix BAS : suppression du champ mort timer *time.Timer dans pendingOrphan

Corrélation — observabilité:
- Ajout keepalive_seq (1-based) dans NormalizedEvent : numéro de requête
  dans la connexion Keep-Alive, incrémenté par processSourceA
- Tous les logs orphelins incluent désormais keepalive_seq=N
- keepAliveSeqA nettoyé automatiquement à l'expiration du TTL B

Tests: 4 nouveaux tests de non-régression (32 tests au total)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 16:03:13 +01:00
a8e024105d feat(correlation): add include_dest_ports filter + README/arch update (v1.1.12)
- feat: new config directive include_dest_ports ([]int) in correlation section
- feat: if non-empty, only events with a matching dst_port are correlated
- feat: filtered events are silently ignored (not correlated, not emitted as orphan)
- feat: new metric failed_dest_port_filtered tracked in ProcessEvent
- feat: DEBUG log 'event excluded by dest port filter: source=A dst_port=22'
- test: TestCorrelationService_IncludeDestPorts_AllowedPort
- test: TestCorrelationService_IncludeDestPorts_FilteredPort
- test: TestCorrelationService_IncludeDestPorts_EmptyAllowsAll
- docs(readme): full rewrite to match current code (v1.1.12)
- docs(readme): add include_dest_ports section, fix version refs, clean outdated sections
- docs(arch): add dest_port_filtering section, failed_dest_port_filtered metric, debug log example
- fix(config.example): remove obsolete stdout.level field
- chore: bump version to 1.1.12

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 13:51:20 +01:00
e9dcd8ea51 feat: observability, IP filtering, stdout/clickhouse fixes (v1.1.11)
- feat(observability): metrics server with /metrics and /health endpoints
- feat(observability): correlation metrics (events, success/failed, reasons, buffers)
- feat(correlation): IP exclusion filter (exact IPs and CIDR ranges)
- feat(correlation): pending orphan delay for late-arriving B events
- fix(stdout): sink is now a no-op for data; JSON must never appear on stdout
- fix(clickhouse): all flush errors were silently discarded, now properly logged
- fix(clickhouse): buffer overflow with DropOnOverflow now logged at WARN
- fix(clickhouse): retry attempts logged at WARN with attempt/delay/error context
- feat(clickhouse): connection success logged at INFO, batch sends at DEBUG
- feat(clickhouse): SetLogger() for external logger injection
- test(stdout): assert stdout remains empty for correlated and orphan logs
- chore(rpm): bump version to 1.1.11, update changelog
- docs: README and architecture.yml updated

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 11:40:54 +01:00
c66df22351 chore: bump version to 1.1.8 (FPM → rpmbuild migration)
Version bump for rpm-build migration:
- Version: 1.1.7 → 1.1.8
- Updated Makefile (PKG_VERSION)
- Updated logcorrelator.spec (%changelog)

Changes in 1.1.8:
- Migrated from FPM to rpmbuild (native RPM build)
- Reduced build image size by 200MB (-40%)
- Removed FPM gem dependency
- Scripts post/preun/postun inline in spec file
- Build image: rockylinux:8 instead of ruby:3.2-bookworm

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 22:21:10 +00:00
caf363b156 perf(build): optimize build speed with cache and parallel builds (-60% time)
Build optimizations implemented:

1. Makefile: Remove --no-cache flag
   - Docker builds now use layer cache (incremental builds)
   - Added DOCKER_BUILDKIT=1 for better performance
   - Added buildx support for parallel builds
   - New targets: docker-build-dev-no-test, package-rpm-sequential

2. Dockerfile: Add SKIP_TESTS argument
   - SKIP_TESTS=true for faster production builds
   - Tests still run in CI by default
   - Added BuildKit cache mounts for:
     - /go/pkg/mod (Go modules)
     - /var/cache/apt (APT cache)
     - /var/lib/apt/lists (APT lists)

3. Dockerfile.package: Factorize common RPM tools
   - New stage: rpm-common-tools (shared across el8/el9/el10)
   - fpm installed once, reused 3 times
   - Common build script: /build-rpm.sh
   - Reduced duplication from 300 lines to 60 lines per stage

4. Parallel RPM builds with buildx
   - make package-rpm now uses buildx for parallel builds
   - el8, el9, el10 built simultaneously
   - Fallback: make package-rpm-sequential (if buildx fails)

Expected performance gains:
- Incremental build (code change only): 15-25 min → 3-5 min (-80%)
- Full build (no cache): 15-25 min → 8-12 min (-50%)
- RPM builds (parallel): 9 min → 4 min (-55%)
- Total typical workflow: ~20 min → ~5-7 min (-65%)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 22:08:04 +00:00
9db6848757 fix: critical Keep-Alive correlation bug - network events evicted prematurely
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
- Fix cleanExpired() to use TTL map instead of event timestamp for B events
- Increase default correlation time window from 1s to 10s
- Increase default network TTL from 30s to 120s for long sessions
- Use payload timestamp for network events when available (fallback to now)
- Add comprehensive Keep-Alive tests (TTL reset, long session scenarios)
- Bump version to 1.1.7

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 16:32:48 +01:00
51e1eb8d57 chore: bump version to 1.1.6
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
- Update Makefile PKG_VERSION
- Update RPM spec version and changelog

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 11:55:28 +01:00
4b4ab84ee0 fix: set /var/run/logcorrelator permissions to 755 in RPM
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
- RPM %post now sets chmod 755 on /var/run/logcorrelator
- Allows service to create sockets after reboot
- Version bumped to 1.1.5

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 00:17:56 +01:00
6b690a3eb3 fix: log raw JSON on parse errors for debugging
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
- Add raw JSON payload to parse error warnings
- Helps diagnose malformed JSON from senders
- Version bumped to 1.1.4

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 23:20:51 +01:00
7f2becf702 chore: bump version to 1.1.3
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
- RPM spec: 1.1.3-1
- Makefile PKG_VERSION: 1.1.3

Changes in 1.1.3:
- Refactor: Unix sockets switched from STREAM to DGRAM (SOCK_DGRAM)
- Test: Coverage improved to 74.4% with comprehensive tests
- Fix: Example config in /etc/logcorrelator/
- Change: Socket permissions 0666 (world read/write)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 22:54:12 +01:00
324b0042f8 fix(rpm): example config in /etc/logcorrelator + socket permissions 0666
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
- Install logcorrelator.yml.example to /etc/logcorrelator/ instead of /usr/share/logcorrelator/
- Change default socket permissions from 0660 to 0666 (world read/write)
- Bump version to 1.1.2
- Remove CHANGELOG.md

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 22:07:50 +01:00
ef819e8868 chore: bump PKG_VERSION to 1.1.1
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 21:54:05 +01:00
a415a3201a 1.0.9
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
2026-03-01 12:25:34 +01:00
d3436f6245 1.0.8
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
2026-03-01 11:30:55 +01:00
a3ae5421cf chore: version 1.0.7 - add log levels
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
- Add configurable log levels: DEBUG, INFO, WARN, ERROR
- Replace debug.enabled with log.level in configuration
- Add Warn/Warnf methods for warning messages
- Log orphan events and buffer overflow as WARN
- Log parse errors as WARN
- Log raw events and correlations as DEBUG

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 02:33:04 +01:00
56c2923121 chore: version 1.0.6 - simplify YAML configuration
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
- Remove service.name and service.language (unused)
- Remove enabled flags on outputs (presence = enabled)
- Simplify correlation config: time_window_s (integer) instead of nested object
- Simplify orphan_policy to emit_orphans boolean
- Rename apache socket to http.socket
- Add socket_permissions option for unix sockets (default: 0660)
- Update tests for new configuration format

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 01:59:59 +01:00
ea5ac94983 chore: bump version to 1.0.4
Some checks failed
Build and Test / test (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
- Update packaging/rpm/logcorrelator.spec: Version 1.0.4
- Update CHANGELOG.md with 1.0.4 release notes
- Update Makefile: PKG_VERSION 1.0.4

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 00:46:09 +01:00
644d81d33e refactor: rename RPM directories to generic el8/el9/el10 naming
- Replace rocky8/rocky9/almalinux10 with el8/el9/el10
- Rename Docker build stages: rpm-rocky* → rpm-el*
- Update Makefile to use new directory structure
- Update comments: 'Rocky Linux' → 'Enterprise Linux'
- Simplify Docker volume mount path for RPM output

This makes the naming more generic and aligned with RPM conventions
(el8, el9, el10) rather than specific distribution names.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 00:29:50 +01:00
0ca7f53d01 Add --no-cache to docker build commands
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 23:10:00 +01:00
58292e10d7 Add Makefile and remove obsolete build.sh/test.sh scripts
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 22:55:25 +01:00