Observability: Logs, Metrics and Traces

Technical versus business health, correlation IDs, SLIs, SLOs and SLAs, and alerts that someone can act on.

  • Advanced
  • About 15 minutes
  • Includes an exercise and a knowledge check

The scenario Healthy application, stuck business

The customer says yesterday’s settlement file uploaded fine, but 18,000 records are still waiting. The app says health UP and no errors. Technical metrics are green: CPU and memory normal, HTTP errors low, 0 restarts. Business metrics are red: settlement completion 0 of 18,000, oldest unreconciled 19 hours, open exceptions rising (example values). The ladder: SLI, a measurement such as the percentage of valid payment requests accepted; SLO, an internal target such as 99.9% over a rolling 30 days; SLA, a contract with consequences, only after the SLO is proven. A bad alert says CPU is high; a better one says payment ingestion errors exceeded the agreed threshold for 10 minutes and valid payments are not accepted.
Watch the business process as well as the machines.
SignalAnswersApex examples
LogsWhat happened?Payment received, file accepted, reconciliation failed, database timeout, exception resolved
MetricsHow much, how often, how long?Events a second, match rate, queue age, API latency, connections, error rate, open exceptions
TracesWhere did the time go?Load balancer, API, PostgreSQL, publication, queue, worker

jsonCorrelated, safe identifiers in a log line

{"level":"INFO","event":"SETTLEMENT_RECORD_RECONCILED","paymentId":"PAY-104582","settlementId":"SET-88321","correlationId":"COR-7F91A","ruleId":"EXACT_REFERENCE_AMOUNT","ruleVersion":2}

Log identifiers, not payloads. An authorized operator can join events by ID without the logs exposing amounts, names or account details.

TermIsApex example
SLIA measurement of service behaviorPercentage of valid payment requests accepted
SLOA target for that measurement over a period99.9% over a rolling 30 days
SLAA contractual commitment to the customer, with consequences such as service creditsSet by a commercial and legal agreement, ideally backed by an internal SLO that is stricter, so the team is warned before the contract is at risk

Practice Build the dashboard and alerts

Practical exercise

Exercise 08: the Apex observability design

Build a dashboard and at least five alerts, each linked to a runbook.

  1. Request rate, error rate, p95 latency, database health and container restarts.
  2. Queue depth and oldest message age.
  3. Payment volume, settlement progress, reconciliation success and open exceptions.
  4. Sample logs and a trace of one reconciliation.
Show a sample alert
  • Condition: settlement processing has not completed 2 hours after the file arrived.
  • Severity: SEV 2. Owner: platform on-call. Runbook: queue processing stopped. Impact: finance cannot close the day.

2 questions

Check your understanding

1. The health endpoint is UP but 18,000 records wait. What was missing?
2. What is the difference between an SLO and an SLA?
Answer every question to submit.

What you can do now

  • Combine logs, metrics and traces.
  • Define SLIs and SLOs.
  • Design actionable alerts.