mix phoenix_micro.health (PhoenixMicro v1.0.0)

Copy Markdown View Source

Hits the PhoenixMicro health endpoint and prints a formatted status table.

Usage

mix phoenix_micro.health

Options

--url URL       Health endpoint URL
                (default: http://localhost:4000/health/microservices)
--timeout MS    HTTP request timeout in ms (default: 5000)
--format FORMAT Output format: table|json (default: table)
--exit-code     Exit with code 1 if status is degraded (useful in CI)

Examples

# Check local dev server
mix phoenix_micro.health

# Check staging
mix phoenix_micro.health --url https://staging.example.com/health/microservices

# Use in CI — fails the pipeline if degraded
mix phoenix_micro.health --exit-code

# Raw JSON output
mix phoenix_micro.health --format json

Output


  PhoenixMicro Health Report                     
  http://localhost:4000/health/microservices     
  2025-01-01T12:00:00Z                           


Status       ok
Transport   rabbitmq (connected)

Consumers (2)
  MyApp.Payments.CreatedConsumer  payments.created   broadway  concurrency=10
  MyApp.Orders.PlacedConsumer     orders.placed      broadway  concurrency=5

Circuit Breakers (3)
  payments_db    closed
  orders_db      OPEN    (opened 45s ago)
  inventory_db  ~ half_open

Pipeline
  Running consumers: 2