flyio-webhooks-events

Featured

Implement Fly.io machine events, health check monitoring, and log-based event processing for deployment automation and alerting. Trigger: "fly.io events", "fly.io machine status", "fly.io health monitoring".

AI & Automation 2,274 stars 319 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Fly.io Events & Monitoring ## Overview Fly.io does not have traditional webhooks. Instead, monitor machine state changes via the Machines API, process structured logs via `fly logs`, and use health check endpoints for automated responses. ## Instructions ### Step 1: Poll Machine State Changes ```typescript // Monitor machine state transitions via Machines API async function watchMachines(appName: string, callback: (event: MachineEvent) => void) { const client = new FlyClient(appName, process.env.FLY_API_TOKEN!); const stateCache = new Map<string, string>(); setInterval(async () => { const machines = await client.listMachines(); for (const m of machines) { const prev = stateCache.get(m.id); if (prev && prev !== m.state) { callback({ machineId: m.id, region: m.region, previousState: prev, currentState: m.state, timestamp: new Date(), }); } stateCache.set(m.id, m.state); } }, 10_000); // Check every 10 seconds } interface MachineEvent { machineId: string; region: string; previousState: string; currentState: string; timestamp: Date; } ``` ### Step 2: Health Check Event Handler ```typescript // Implement health check that reports machine health // Fly.io uses this to auto-restart unhealthy machines import express from 'express'; const app = express(); app.get('/health', async (req, res) => { const checks = { database: await checkPostgres(), ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category