tutorial

Monitoring Solidus eCommerce with Vigilmon

Solidus is a battle-tested Ruby on Rails eCommerce engine used by mid-market and enterprise merchants. This guide shows you how to monitor every critical layer — Rails, PostgreSQL, Sidekiq, Redis, and checkout conversion — with Vigilmon.

Solidus is the open source eCommerce engine of choice for merchants who need serious customization: complex order management, headless commerce, subscription billing, multi-currency support, and business logic that can't be shoehorned into a SaaS platform. Built as a set of Ruby on Rails engines, Solidus inherits Rails' operational characteristics — but a production Solidus store also runs background jobs (Sidekiq), a cache and job queue (Redis), and a database (PostgreSQL) that all need to be healthy for orders to flow. Vigilmon gives you visibility into every layer, from the Solidus API to checkout conversion rates.

What You'll Set Up

  • Solidus storefront and API health monitoring
  • PostgreSQL database health monitoring
  • Sidekiq job queue depth and failure rate alerting
  • Redis connectivity monitoring
  • Order success rate monitoring
  • Checkout API response time monitoring
  • Inventory adjustment success monitoring
  • Solidus backend (admin) health monitoring
  • Promotion engine health monitoring

Prerequisites

  • Solidus 3.x (or 2.x) installed as a Rails application
  • Sidekiq configured as the ActiveJob adapter
  • PostgreSQL as the primary database
  • A free Vigilmon account

Why Monitoring Solidus Matters

Solidus merchants typically run high-value, complex orders — custom products, B2B accounts, subscription fulfillments. A failure in any layer hits revenue and operations:

  • Rails app crash → the entire storefront and API go offline; no orders can be placed.
  • Sidekiq stopped → payment capture jobs don't run; order confirmation emails queue forever; report generation halts.
  • Redis down → Sidekiq cannot process any jobs (Redis is its job store); Rails session cache may also fail.
  • PostgreSQL slow → checkout becomes sluggish; order management in the Solidus backend times out.
  • Checkout API p95 > 2s → conversion rate drops; headless storefronts (Next.js, Nuxt) show loading spinners.
  • Promotion engine errors → coupon codes silently fail to apply; customers abandon cart.

Vigilmon monitors each of these failure modes, giving you early warning before merchants or customers are affected.


Step 1: Add a Health Endpoint to Your Solidus App

Solidus doesn't ship with a built-in health endpoint, but adding one is straightforward. Create a dedicated controller:

# app/controllers/health_controller.rb
class HealthController < ActionController::Base
  def show
    checks = {
      database: database_ok?,
      redis: redis_ok?,
    }
    all_ok = checks.values.all?
    render json: checks, status: all_ok ? :ok : :service_unavailable
  end

  private

  def database_ok?
    ActiveRecord::Base.connection.execute('SELECT 1')
    true
  rescue => e
    false
  end

  def redis_ok?
    Redis.new.ping == 'PONG'
  rescue => e
    false
  end
end
# config/routes.rb
get '/health', to: 'health#show'

Deploy the change. Then in Vigilmon:

  1. Click Add MonitorHTTP / HTTPS.
  2. URL: https://yoursolidusstore.com/health.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 1 minute.
  5. Set a Response body contains check for "database":true.
  6. Click Save.

This single endpoint covers both Rails app health and database/Redis connectivity in one check.


Step 2: Monitor the Solidus API

Modern Solidus deployments often serve a headless storefront via the Solidus v2 REST API. Monitor the API independently from the storefront:

  1. In Vigilmon, add a new HTTP / HTTPS monitor.
  2. URL: https://yoursolidusstore.com/api/v2/storefront/products?per_page=1.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 2 minutes.
  5. Set Response time alert at 2000 ms (2 seconds) — the Solidus API p95 should stay under 2s.
  6. Enable Response body contains check for "data":[.
  7. Click Save.

A non-200 from this endpoint means the API is unavailable; a slow response means the product query is hitting unoptimized database joins or missing indexes.


Step 3: Monitor PostgreSQL Health

PostgreSQL holds all Solidus data — products, variants, orders, customers, inventory units, promotions. Add a dedicated database health check:

# app/controllers/health/database_controller.rb
module Health
  class DatabaseController < ActionController::Base
    def show
      start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
      ActiveRecord::Base.connection.execute('SELECT 1')
      latency_ms = ((Process.clock_gettime(Process::CLOCK_MONOTONIC) - start) * 1000).round(1)

      render json: { database: 'ok', latency_ms: latency_ms },
             status: latency_ms < 100 ? :ok : :service_unavailable
    rescue => e
      render json: { database: 'error', message: e.message }, status: :service_unavailable
    end
  end
end
# config/routes.rb
namespace :health do
  get 'database', to: 'database#show'
end

In Vigilmon, add a monitor for https://yoursolidusstore.com/health/database. Alert when status is non-200. The endpoint returns 503 when database query latency exceeds 100ms, which is an early indicator of table bloat or lock contention on the spree_orders or spree_line_items tables.


Step 4: Monitor Sidekiq Job Queue Health

Sidekiq processes all Solidus background jobs: payment captures, order confirmation emails, inventory updates, and reports. A Sidekiq outage silently backs up all async processing.

Add a Sidekiq health endpoint:

# app/controllers/health/sidekiq_controller.rb
module Health
  class SidekiqController < ActionController::Base
    def show
      stats = Sidekiq::Stats.new
      queue_depth = stats.enqueued
      failure_rate = stats.failed.to_f / [stats.processed, 1].max * 100

      healthy = queue_depth < 500 && failure_rate < 5.0
      render json: {
        sidekiq: healthy ? 'ok' : 'degraded',
        queue_depth: queue_depth,
        failure_rate_pct: failure_rate.round(1),
        workers: stats.workers_size
      }, status: healthy ? :ok : :service_unavailable
    end
  end
end

In Vigilmon:

  1. Add a monitor for https://yoursolidusstore.com/health/sidekiq.
  2. Set Expected HTTP status to 200.
  3. Set Check interval to 2 minutes.
  4. The endpoint returns 503 when queue depth > 500 or failure rate > 5% — Vigilmon alerts automatically.

Step 5: Monitor Redis Health

Redis is both Sidekiq's job store and Rails' cache backend in most Solidus deployments. If Redis goes down, Sidekiq halts entirely.

# app/controllers/health/redis_controller.rb
module Health
  class RedisController < ActionController::Base
    def show
      redis = Redis.new
      pong = redis.ping
      info = redis.info('memory')
      used_mb = (info['used_memory'].to_i / 1024.0 / 1024.0).round(1)

      render json: { redis: 'ok', ping: pong, used_memory_mb: used_mb }
    rescue => e
      render json: { redis: 'error', message: e.message }, status: :service_unavailable
    end
  end
end

In Vigilmon, add a monitor for https://yoursolidusstore.com/health/redis with a 1-minute check interval. Any non-200 response means Redis is unavailable and Sidekiq has stopped processing jobs.


Step 6: Monitor Order Success Rate

Order creation is the most critical Solidus operation. Add an endpoint that reports the recent order success rate:

# app/controllers/health/orders_controller.rb
module Health
  class OrdersController < ActionController::Base
    def show
      window_start = 10.minutes.ago
      recent = Spree::Order.where(completed_at: window_start..)
      total = recent.count
      failed = recent.where(state: %w[canceled failed]).count
      error_rate = total > 0 ? (failed.to_f / total * 100).round(1) : 0.0

      healthy = error_rate <= 1.0
      render json: {
        orders_10min: total,
        failed: failed,
        error_rate_pct: error_rate
      }, status: healthy ? :ok : :service_unavailable
    end
  end
end

In Vigilmon, add a monitor for https://yoursolidusstore.com/health/orders. The endpoint returns 503 when more than 1% of recent orders are in a failed or canceled state — an early signal of payment gateway issues, inventory conflicts, or promotion calculation errors.


Step 7: Monitor the Solidus Backend (Admin)

Solidus backend is the merchant admin interface for order management, product editing, and returns. An unavailable backend is an operational emergency.

  1. In Vigilmon, add a new HTTP / HTTPS monitor.
  2. URL: https://yoursolidusstore.com/admin/login.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 2 minutes.
  5. Set Alert on non-2xx status.
  6. Click Save.

Step 8: Monitor Inventory Adjustment Success

Solidus inventory management — stock adjustments, backorder processing, return authorizations — runs through the inventory system. Failures here cause overselling or incorrect stock counts.

# app/controllers/health/inventory_controller.rb
module Health
  class InventoryController < ActionController::Base
    def show
      # Check for any inventory units in a problematic state from the last hour
      stuck_units = Spree::InventoryUnit
        .where(state: 'on_hand')
        .where('updated_at < ?', 2.hours.ago)
        .where(shipment_id: nil)
        .count

      healthy = stuck_units == 0
      render json: { inventory: healthy ? 'ok' : 'degraded', stuck_units: stuck_units },
             status: healthy ? :ok : :service_unavailable
    end
  end
end

In Vigilmon, add a monitor for https://yoursolidusstore.com/health/inventory with a 5-minute check interval. Alert when inventory units are stuck in an inconsistent state.


Step 9: Monitor Promotion Engine Health

Solidus promotion codes are a high-value feature — coupon campaigns, loyalty discounts, B2B pricing. Silent promotion failures mean customers are denied discounts they should receive, damaging trust.

# app/controllers/health/promotions_controller.rb
module Health
  class PromotionsController < ActionController::Base
    def show
      # Verify at least one active promotion is queryable
      active_count = Spree::Promotion.active.count
      render json: { promotions: 'ok', active_count: active_count }
    rescue => e
      render json: { promotions: 'error', message: e.message }, status: :service_unavailable
    end
  end
end

Add a Vigilmon monitor for this endpoint. The primary signal is a non-200 (indicating a promotion model query error), but you can also alert on active_count dropping to zero unexpectedly if you always have active promotions running.


Step 10: Set Up a Solidus Background Job Heartbeat

Sidekiq processes recurring jobs (scheduled via sidekiq-cron or whenever). Add a heartbeat ping to your most critical recurring job:

# app/jobs/order_status_update_job.rb
class OrderStatusUpdateJob < ApplicationJob
  queue_as :default

  def perform
    # ... your job logic ...
    HeartbeatService.ping(ENV['VIGILMON_ORDER_JOB_HEARTBEAT_TOKEN'])
  end
end
# app/services/heartbeat_service.rb
class HeartbeatService
  def self.ping(token)
    return unless token.present?
    URI.open("https://vigilmon.online/heartbeat/#{token}") rescue nil
  end
end

In Vigilmon, create a Cron / Heartbeat monitor matching your job's schedule. If the job fails or the Sidekiq worker stops, no ping arrives and Vigilmon alerts you.


Recommended Alert Configuration

| Monitor | Alert Condition | Severity | |---|---|---| | Solidus app health (/health) | Non-200 | Critical | | Solidus API | Non-200 or p95 > 2s | Critical | | PostgreSQL health | Non-200 or latency > 100ms | Critical | | Sidekiq health | Queue > 500 or failure > 5% | High | | Redis health | Non-200 | Critical | | Order success rate | Error rate > 1% | Critical | | Solidus backend login | Non-200 | High | | Inventory health | Stuck units > 0 | High | | Promotion engine | Non-200 | High | | Background job heartbeat | Missed interval | High |


Conclusion

A Solidus store is a sophisticated Rails application with multiple moving parts. Vigilmon gives you a complete view across the stack: from the storefront and API your customers see, to the PostgreSQL database, Sidekiq queue, and Redis backend that power the commerce engine under the hood. With monitors for order success rate, checkout performance, and inventory health, you're watching the business metrics that matter — not just whether the server is up.

Start monitoring your Solidus store at vigilmon.online.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →