🍗 PCK ZRA Middleware Wiki

Monitoring & Health Checks

Three layers of monitoring are available: the in-app portal reports, machine health endpoints, and Prometheus metrics.

Health endpoints

EndpointWhat it tells you
GET /pckzra/api/taxint/healthBasic liveness: status, version, timestamp
GET /pckzra/actuator/healthDetailed Spring Boot health, including database connectivity (details always shown)
GET /pckzra/actuator/infoApplication info
GET /pckzra/actuator/metricsFull metrics catalog
GET /pckzra/actuator/loggersInspect/adjust log levels at runtime

Component health checks (configurable):

CheckPropertyDefault
Chrilan API reachabilityhealth.chrilan.api.check.enabled / timeouttrue / 5000ms
Database reachabilityhealth.database.check.enabled / timeouttrue / 3000ms

Prometheus

Metrics are exported in Prometheus format at /pckzra/actuator/prometheus (JVM and system metrics included). Point your Prometheus scrape config at the production host:

scrape_configs:
  - job_name: pck-middleware
    metrics_path: /pckzra/actuator/prometheus
    static_configs:
      - targets: ['server.zra.co.zm:443']
    scheme: https

What to watch

SignalWhereAlert when
Transaction success ratePortal dashboard / Reports APIDrops below ~98% over an hour
Failed transactionsReports → failed (7-day default)Any sustained cluster of 500s (Chrilan outage) or 403s (store config)
Response time (ms)Transaction history column / metricsSustained rise toward the 30s Chrilan timeout
Per-store volumeReports → volume by storeA trading store shows zero during business hours
Menu syncOutbound /product/createBulk transactionsRepeated failures for a store (check Oracle LocRef, STS credentials)
DB poolHikariCP metrics (leak detection at 60s)Pool exhaustion or leak warnings in logs
Actuator health/actuator/healthAny component DOWN

Logs

Useful queries

-- Transactions in the last hour
SELECT COUNT(*) FROM api_transactions
WHERE created_at > NOW() - INTERVAL 1 HOUR;

-- Recent failures with their error
SELECT transaction_id, store_id, status_code, error_message, created_at
FROM api_transactions
WHERE success = FALSE
ORDER BY created_at DESC LIMIT 20;

-- Failed conversions today
SELECT * FROM conversion_logs
WHERE conversion_success = FALSE AND created_at > CURDATE()
ORDER BY created_at DESC;

Alerting notes