# State 007: Observability Baseline with LGTM

> For the complete documentation index, see [llms.txt](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/llms.txt).

State `007-observability-lgtm-compose` adds a reusable observability baseline on top of the architecture chain (`005` PostgreSQL + `006` NATS).

The goal was to make diagnostics first-class without changing business behavior. We wanted consistent local visibility across logs, metrics, traces, and service health for every generated runtime that inherits this state.

## What Was Added

*   LGTM stack in compose runtime: Grafana, Loki, Tempo, Prometheus.
*   OpenTelemetry collector wiring for cross-service telemetry flow.
*   Baseline probes and health checks for observability services.
*   Default dashboards and smoke checks so observability is verifiable, not aspirational.

## Why This Matters

*   Functional states can now be developed with immediate telemetry feedback.
*   Regressions are easier to detect and isolate across services.
*   Later states (`008`, `009`, and convergence states) inherit the same baseline by default.

## Decision Record

The state-scoped rationale is captured in:

*   [ADR-007 Adopt LGTM + OpenTelemetry Stack for State 007 Baseline](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/docs/adr/007-state-007-adopt-lgtm-observability-stack.md)

## Spec + Code Links

*   State spec pack: [/specs/observability-lgtm-compose](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/observability-lgtm-compose.md)
*   Learning guide: [/docs/learning/state-007-observability-lgtm-compose](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/docs/learning/state-007-observability-lgtm-compose.md)
*   Generated code branch: [code/generated-state-007-observability-lgtm-compose](https://github.com/finos/traderX/tree/code/generated-state-007-observability-lgtm-compose)
*   Compare vs parent (`005`): [code/generated-state-006-messaging-nats-replacement...code/generated-state-007-observability-lgtm-compose](https://github.com/finos/traderX/compare/code%2Fgenerated-state-006-messaging-nats-replacement...code%2Fgenerated-state-007-observability-lgtm-compose)
