# Gate 05 — Observability

**State at `v1.1.0`: 🟡 FAIL** until a `smoke-test` job is added asserting `/health` returns 200 against the freshly-built image.

## Required items

| Item                                             | Required | State                                                                             |
| ------------------------------------------------ | -------- | --------------------------------------------------------------------------------- |
| Structured logging across backend                | yes      | ✅ PASS                                                                            |
| Self-hosted Langfuse v3 stack documented in repo | yes      | ✅ PASS                                                                            |
| Metrics emission for the 24 evaluation metrics   | yes      | ✅ PASS                                                                            |
| Health endpoints exposed and tested in CI        | partial  | 🟡 **FAIL** — health endpoint exists but not asserted by a smoke test in `ci.yml` |

## What "observability" means here

Edge ships with three observability surfaces:

```mermaid
flowchart LR
    BE[FastAPI] -->|structured logs| Stdout[stdout / journald]
    BE -->|optional traces| LF[Langfuse]
    BE -->|/health, /metrics| Probes[K8s probes / scrapers]
    BE -->|24 metric scores| PB[(PocketBase)]
```

## Closing plan

Add a `smoke-test` job to `.github/workflows/ci.yml`:

```yaml
smoke-test:
  needs: docker-build
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - run: docker run -d --name edge -p 8080:8080 ${IMAGE_TAG}
    - run: |
        for i in {1..30}; do
          if curl -sf http://localhost:8080/health; then exit 0; fi
          sleep 2
        done
        exit 1
```

When green for 7 consecutive runs on `main`, this gate flips ✅.

## Why it matters

A `/health` endpoint that compiles but doesn't actually return 200 against the production image is invisible until a real outage. The smoke test catches it in CI.

## Compliance mapping

* ISO 27001 Annex A.8.15 (Logging).
* ISO 27001 Annex A.8.16 (Monitoring activities).
* DORA Art 11(2)(c) (ICT operational resilience — monitoring).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.edge.nyami.fr/banking-readiness/gate-05-observability.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
