Agent Skills › relaticle/relaticle › configuring-horizon

configuring-horizon

GitHub

指导 Laravel Horizon 队列监控工具的配置、安装、仪表盘授权及生产故障排查。涵盖 Supervisor 设置、指标快照、通知路由等核心功能,用于保障队列系统稳定运行。

.claude/skills/configuring-horizon/SKILL.md relaticle/relaticle

Trigger Scenarios

配置 Laravel Horizon Horizon 仪表盘访问控制 解决 Horizon 队列监控问题

Install

npx skills add relaticle/relaticle --skill configuring-horizon -g -y
More Options

Non-standard path

npx skills add https://github.com/relaticle/relaticle/tree/main/.claude/skills/configuring-horizon -g -y

Use without installing

npx skills use relaticle/relaticle@configuring-horizon

指定 Agent (Claude Code)

npx skills add relaticle/relaticle --skill configuring-horizon -a claude-code -g -y

安装 repo 全部 skill

npx skills add relaticle/relaticle --all -g -y

预览 repo 内 skill

npx skills add relaticle/relaticle --list

SKILL.md

Frontmatter
{
    "name": "configuring-horizon",
    "license": "MIT",
    "metadata": {
        "author": "laravel"
    },
    "description": "Use this skill whenever the user mentions Horizon by name in a Laravel context. Covers the full Horizon lifecycle: installing Horizon (horizon:install, Sail setup), configuring config\/horizon.php (supervisor blocks, queue assignments, balancing strategies, minProcesses\/maxProcesses), fixing the dashboard (authorization via Gate::define viewHorizon, blank metrics, horizon:snapshot scheduling), and troubleshooting production issues (worker crashes, timeout chain ordering, LongWaitDetected notifications, waits config). Also covers job tagging and silencing. Do not use for generic Laravel queues without Horizon, SQS or database drivers, standalone Redis setup, Linux supervisord, Telescope, or job batching."
}

Horizon Configuration

Documentation

Use search-docs for detailed Horizon patterns and documentation covering configuration, supervisors, balancing, dashboard authorization, tags, notifications, metrics, and deployment.

For deeper guidance on specific topics, read the relevant reference file before implementing:

  • references/supervisors.md covers supervisor blocks, balancing strategies, multi-queue setups, and auto-scaling
  • references/notifications.md covers LongWaitDetected alerts, notification routing, and the waits config
  • references/tags.md covers job tagging, dashboard filtering, and silencing noisy jobs
  • references/metrics.md covers the blank metrics dashboard, snapshot scheduling, and retention config

Basic Usage

Installation

php artisan horizon:install

Supervisor Configuration

Define supervisors in config/horizon.php. The environments array merges into defaults and does not replace the whole supervisor block:

'defaults' => [
    'supervisor-1' => [
        'connection' => 'redis',
        'queue' => ['default'],
        'balance' => 'auto',
        'minProcesses' => 1,
        'maxProcesses' => 10,
        'tries' => 3,
    ],
],

'environments' => [
    'production' => [
        'supervisor-1' => ['maxProcesses' => 20, 'balanceCooldown' => 3],
    ],
    'local' => [
        'supervisor-1' => ['maxProcesses' => 2],
    ],
],

Dashboard Authorization

Restrict access in App\Providers\HorizonServiceProvider:

protected function gate(): void
{
    Gate::define('viewHorizon', function (User $user) {
        return $user->is_admin;
    });
}

Verification

  1. Run php artisan horizon and visit /horizon
  2. Confirm dashboard access is restricted as expected
  3. Check that metrics populate after scheduling horizon:snapshot

Common Pitfalls

  • Horizon only works with the Redis queue driver. Other drivers such as database and SQS are not supported.
  • Redis Cluster is not supported. Horizon requires a standalone Redis connection.
  • Always check config/horizon.php before making changes to understand the current supervisor and environment configuration.
  • The environments array overrides only the keys you specify. It merges into defaults and does not replace it.
  • The timeout chain must be ordered: job timeout less than supervisor timeout less than retry_after. The wrong order can cause jobs to be retried before Horizon finishes timing them out.
  • The metrics dashboard stays blank until horizon:snapshot is scheduled. Running php artisan horizon alone does not populate metrics.
  • Always use search-docs for the latest Horizon documentation rather than relying on this skill alone.

Version History

  • 1f433f8 Current 2026-08-20 14:43

Same Skill Collection

.claude/skills/echo-development/SKILL.md
.claude/skills/filament-development/SKILL.md
.claude/skills/laravel-query-builder/SKILL.md
.claude/skills/medialibrary-development/SKILL.md
.claude/skills/socialite-development/SKILL.md
.claude/skills/spatie-javascript/SKILL.md
.claude/skills/spatie-laravel-php/SKILL.md
.claude/skills/spatie-security/SKILL.md
.claude/skills/spatie-version-control/SKILL.md
.claude/skills/testing-best-practices/SKILL.md
.github/skills/custom-fields-development/SKILL.md
.github/skills/flowforge-development/SKILL.md
.claude/skills/agent-browser-relaticle/SKILL.md
.claude/skills/ai-sdk-development/SKILL.md
.claude/skills/business-review/SKILL.md
.claude/skills/cashier-stripe-development/SKILL.md
.claude/skills/fortify-development/SKILL.md
.claude/skills/infer-conventions/SKILL.md
.claude/skills/laravel-best-practices/SKILL.md
.claude/skills/livewire-development/SKILL.md
.claude/skills/mcp-development/SKILL.md
.claude/skills/passport-development/SKILL.md
.claude/skills/pennant-development/SKILL.md
.claude/skills/pest-testing/SKILL.md
.claude/skills/screenshot-with-callout/SKILL.md
.claude/skills/sluggable-development/SKILL.md
.claude/skills/tailwindcss-development/SKILL.md
.github/skills/livewire-development/SKILL.md
.github/skills/manual-testing/SKILL.md
.github/skills/tailwindcss-development/SKILL.md

Metadata

Files
0
Version
3ecbf26
Hash
9e8c1890
Indexed
2026-08-20 14:43

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-01 08:43
浙ICP备14020137号-1