Skip to content

feat(observability): add Loki log-sink provider (#662) - #1060

Merged
RonaldHensbergen merged 4 commits into
mainfrom
feat/662-loki-log-sink
Oct 31, 2026
Merged

RonaldHensbergen merged 4 commits into
mainfrom
feat/662-loki-log-sink

Conversation

@RonaldHensbergen

Copy link
Copy Markdown
Owner

Summary

  • Add an experimental Loki/Vector provider for the existing vendor-neutral log-sink contract.
  • Classify pushed JSON events into raw and structured retention tiers, with configurable retention periods.
  • Document the HTTP ingestion behavior and clarify that container logs are not tailed automatically.

Validation

  • python3 -m unittest tests.test_loki_module -v (4 tests passed)
  • Markdown lint passed for the changed docs.
  • Live Docker smoke test: posted raw and structured events and queried both Loki tiers.

Closes #662

Generated by Mistral Vibe.

Co-Authored-By: Mistral Vibe <vibe@mistral.ai>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ct (#662)

The multi-service loki module now sets serviceName: loki on the provided
log-sink contract, matching the marquez module and the contract field's
own guidance, so the E150 host cross-check uses an explicit serving-service
advertisement instead of relying only on the namesake-service rule.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>

@RonaldHensbergen RonaldHensbergen left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review verdict

  • Blocking: none
  • Major: none
  • Minor: 1 — missing serviceName advertisement on the provided log-sink contract (inline comment above); fixed in e37f44a on this branch

Recommendation: merge after CI re-runs green on e37f44a (quality judgment, not just mergeable-status: tests, lint, CI, review substance all checked below).

What was verified

  • CI (head 74fabdc): all check runs green — CI (lint, package, security-scan, cds-runtime, tests on ubuntu/windows/macos, CDS Test Stable Profile), Docker Runtime Smoke Test, GitHub Advanced Security, SonarCloud Code Analysis (quality gate passed, 0 new issues).
  • Tests locally: full suite via scripts/run_tests_with_deprecation_gate.py — 2048 tests OK (30 skipped); tests/test_loki_module.py 4/4; module.yaml validates against cli/resources/module.schema.json; yamllint, ruff (UP rules), markdownlint all clean on the changed files.
  • Render/plan/runtime: rendered a local profile with the module — loopback-only port 127.0.0.1:8686:8686, no docker.sock mount, read_only + cap_drop: ALL + pids_limit + tmpfs on both services, retention env 7d/90d, LOKI_ENDPOINT correctly namespaced to logs-loki-storage:3100, named volume logs-loki-data. cds test passes all four stages (validate/security/plan/render).
  • Live runtime smoke (Docker, pinned digests): started both services with the module's exact flags; POSTed structured (all five string fields), raw, and wrong-typed events to /logs — all HTTP 200; Loki streams show {tier="structured"} only for the fully-stringed event and {tier="raw"} for the other two; Loki accepted retention_period: 7d + retention_stream 90d override and reached ready. So this does not just render green — the classification and retention wiring works at runtime.
  • Security posture: no-new-privileges omission is empirically justified, not a shortcut — both pinned binaries fail exec with EPERM under no_new_privs in this runc runtime (tested as root and non-root; binaries are not setuid, consistent with file capabilities). All other hardening (cap_drop ALL, read_only, pids_limit, tmpfs, loopback-only publish, auth_enabled: false documented as local-only, productionSuitable: false) is in place; unauthenticated ingest + no container-log tailing are documented in the module README known-limitations. CDS-SEC-090/091 don't apply to local-classified profiles with a non-production-suitable module; the security stage passes. Tracked upstream follow-up: #1066.
  • Repo conventions: CHANGELOG [Unreleased] → Added entry present in house style; docs updated (docs/observability.md §5, common-ground-alignment.md, haven-parity-plan.md row 3.3); docs/roadmap.md already lists the module (#1057). No new E-/W-codes and no cli/ changes, so no README troubleshooting rows or code-collision checks needed; PR carries no labels per convention; single Conventional-Commit feat commit with co-author trailer.

Out of scope, filed as issues (milestone inherited from #662)

  • #1067 — repo-wide contract-port semantics (host-published port advertised as the in-network contract port; breaks in-network consumers when config.port is non-default)
  • #1065 — docker smoke-test CI does not cover experimental modules; loki/otel runtime behavior is only manually verified
  • #1066 — pinned vector/loki images fail exec under no-new-privileges; re-enable security_opt once upstream drops the file capabilities

Note: open PR #1063 (otel-collector) touches docs/observability.md, CHANGELOG.md, docs/haven-parity-plan.md — expect merge conflicts there, none functional.

Copy link
Copy Markdown
Owner Author

Review follow-ups filed during review (out of scope for this PR, milestone inherited from #662):

The one in-PR minor finding (missing serviceName on the provided log-sink contract) is fixed in e37f44a and its review thread is resolved.

@RonaldHensbergen RonaldHensbergen left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End-to-end review complete. No actionable issues found. I reviewed the contract and endpoint wiring, Loki/Vector configuration, retention-tier classification, security posture and limitations, documentation, and tests. The pinned Loki and Vector configurations validate; the module tests and an isolated Docker smoke test pass, including confirming raw and structured records reach their respective Loki tiers. All PR checks are green. No open review points remain; in my judgment, this PR is merge-ready.

@RonaldHensbergen RonaldHensbergen left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction to my earlier verdict: I found one actionable issue that the default-port smoke test did not expose. ingestPort changes the loopback host binding only (host:8686 in the container), but the current contract exports it as the in-network port; setting a non-default host port therefore breaks Compose consumers. I fixed the local working copy and added a regression test using a non-default host port. Those changes are not in this PR head yet, so the PR is not merge-ready until they are included and CI reruns.

RonaldHensbergen and others added 2 commits October 31, 2026 23:20
Keep the log-sink contract on Vector's container listener port while allowing the host loopback publish port to be configured independently. Cover the distinction with a non-default host port regression test.

Generated by Mistral Vibe.

Co-Authored-By: Mistral Vibe <vibe@mistral.ai>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@RonaldHensbergen
RonaldHensbergen merged commit 9eb940e into main Oct 31, 2026
13 checks passed
@RonaldHensbergen
RonaldHensbergen deleted the feat/662-loki-log-sink branch October 31, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add a log-sink provider module (e.g. Loki/Vector) for centralized log aggregation

1 participant