Skip to main content

Monitoring

Monitor Oneliac deployments in production with comprehensive metrics, logging, and alerting.

Metrics Collection

Prometheus Integration

Oneliac exposes metrics at /metrics endpoint:

curl http://localhost:8000/metrics

Key metrics:

  • Request Duration: http_request_duration_seconds
  • Active Connections: active_connections
  • ZK Proof Generation: zk_proof_generation_ms
  • Blockchain Transactions: blockchain_tx_count
  • Cache Hit Rate: cache_hit_ratio

Grafana Dashboards

Configure Grafana to scrape Prometheus:

scrape_configs:
- job_name: 'oneliac'
static_configs:
- targets: ['localhost:8000']

Logging

Log Levels

LOG_LEVEL=INFO  # DEBUG, INFO, WARNING, ERROR, CRITICAL

Log Aggregation

Send logs to centralized system:

LOG_DESTINATION=syslog://logs.example.com:514

Health Monitoring

Liveness Probe

curl -f http://localhost:8000/health || exit 1

Readiness Probe

curl -f http://localhost:8000/ready || exit 1

Alerts

Configure alerts for:

  • API response time > 2 seconds
  • Error rate > 1%
  • Database connection pool exhaustion
  • ZK proof generation failures
  • Blockchain transaction failures

Performance Optimization

Monitor and optimize:

  • Database query performance
  • IPFS retrieval latency
  • ZK proof generation time
  • Blockchain gas usage