Skip to content

Release: Phase 18b — Loki + promtail + Kafka UI - #79

Merged
Poojithvsc merged 3 commits into
mainfrom
dev
Jun 5, 2026
Merged

Release: Phase 18b — Loki + promtail + Kafka UI#79
Poojithvsc merged 3 commits into
mainfrom
dev

Conversation

@Poojithvsc

Copy link
Copy Markdown
Owner

Phase 18b makes ShopSphere's logs and its broker legible, completing the observability pair started in 18a (metrics).

What shipped

  • Log correlation across modules. New common.OrderLog deep module owns the orderId/customerId MDC field names; Payment (charge outcome, PAID/CANCELLED) and Reservation (reserve/confirm/release) now stamp orderId onto their lines, so a Loki line filter {container="shopsphere-app"} |= "<orderId>" returns every module's leg of an order. Unit-tested via OrderLogTests (logback ListAppender).
  • Loki + promtail + Kafka UI compose services under the full profile. Promtail tails the app container's JSON stdout into Loki; Grafana gains Loki as a second provisioned datasource; Kafka UI at http://localhost:8081.
  • ADR-0018b (Loki/promtail over ELK; query by line filter not high-cardinality label; kafbat over Confluent Control Center; books cited).

Validation

mvn verify green — full Testcontainers suite (incl. DockerImageSmokeIT) plus the new OrderLogTests. docker compose config validates.

Honest limits (in the ADR)

  • End-to-end Loki search is a manual QA step (run the full stack, walkthrough, paste the orderId into Grafana) — like 18a's "panels light up."
  • "Outbox" coverage is the Ordering leg. The outbox is Spring Modulith's publication table (no app code to stamp); Order placed is logged in the same transaction as the outbox insert, and the externalised event carries orderId (visible in Kafka UI).

Closes #63.

Poojithvsc and others added 3 commits June 6, 2026 01:04
…18b)

Add common.OrderLog — the one place that knows the orderId/customerId MDC
field names — and stamp an orderId-tagged line in Payment (charge outcome,
PAID/CANCELLED transitions) and Reservation (reserve/confirm/release), so a
Loki line filter `{container="shopsphere-app"} |= "<orderId>"` returns every
module's leg of an order's journey. OrderPlacement refactored onto the helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ase 18b)

Compose grows loki (:3100), promtail, and kafbat/kafka-ui (:8081) under the
full profile. Promtail discovers the app container via the Docker socket and
ships its JSON stdout to Loki verbatim (raw line, low-cardinality container
label — query by line filter, not by orderId label). Grafana gains Loki as a
second provisioned datasource beside Prometheus. Kafka UI browses topics,
partitions, and consumer-group offsets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Loki+promtail over ELK; query by line filter not high-cardinality label; one
deep module (OrderLog) owns the correlation field; kafbat over Confluent
Control Center. Books cited (PragProg, APoSD, PoEAA, XP). Records two honest
limits: end-to-end Loki search is manual QA; "Outbox" coverage is the Ordering
leg (Modulith's publication table, no app code to stamp).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Poojithvsc
Poojithvsc merged commit 27320d8 into main Jun 5, 2026
2 checks passed
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.

Phase 18b: Observability - Loki + promtail + Kafka UI

1 participant