Monitor API Uptime in Parallel and Alert Slack with the Exact Status of Each Endpoint
Probe three endpoints in parallel every 30 minutes and post one Slack alert naming each site that did not answer HTTP 200.
Read recent Mux video assets every hour, change nothing, and alert Slack when assets error or stay preparing, with the most common Mux error.
A video platform on Mux fails one upload at a time: a creator uploads a file that is not really video, a signed source URL expires before Mux fetches it, or a new client starts sending a format the encoder rejects. Each asset just ends with status: errored and an errors object, the player shows nothing, and support hears about it before engineering does. This blueprint turns a scheduled, read-only call to the Mux Video API into a processing health gate: io.kestra.plugin.core.http.Request reads recent assets, one jq query computes the error rate, the most common error and assets stuck in preparing, and the result routes to a quiet log or a Slack alert.
list_assets (io.kestra.plugin.core.http.Request) calls GET /video/v1/assets?limit=100 with HTTP basic auth (access token ID and secret), which returns the most recent assets with their status, created_at (Unix seconds) and errors. It is a read: nothing is uploaded, re-encoded or deleted. Retries cover short network blips, and allowFailed plus allowFailure keep an API error from aborting the flow so it can be reported instead.summarize_assets (io.kestra.plugin.core.debug.Return) first guards for a missing or non-200 response (UNREACHABLE). Otherwise one jq query keeps assets created inside the lookback window, treats ready and errored as finished, computes the share that errored, groups errored assets by errors.type and errors.messages, and flags assets still preparing after stuck_minutes. At or above critical_error_rate is CRITICAL; at or above warning_error_rate, or any stuck asset, is WARNING; fewer than min_assets finished assets is LOW_VOLUME; otherwise HEALTHY.route_by_errors (io.kestra.plugin.core.flow.Switch) branches on that classification: HEALTHY and LOW_VOLUME log quietly, WARNING posts a Slack note, CRITICAL and UNREACHABLE page Slack. A defaults fallback logs anything unexpected.log_audit_result (io.kestra.plugin.core.log.Log) writes one audit line per run with the HTTP status and the full summary.errors block pages Slack if the flow itself fails, and the hourly_check trigger runs at 35 minutes past every hour, shipped disabled: true.status output (HEALTHY / WARNING / CRITICAL / LOW_VOLUME / UNREACHABLE) other flows can gate on, for example to pause a bulk import while uploads are failing.Mux sends a webhook per asset event, which is great for updating one record and poor at telling you that one upload in five failed today. Kestra turns a plain, read-only API call into a scheduled, typed classification with retries, a failure path and an execution history, and the status output lets your ingestion flows react automatically.
MUX_TOKEN_ID: the access token ID, used as the basic-auth username.MUX_TOKEN_SECRET: the access token secret, used as the basic-auth password.SLACK_WEBHOOK: Slack incoming webhook used for every alert branch and the flow-failure alert.In Kestra OSS, secrets are supplied as environment variables prefixed SECRET_ and base64-encoded, for example SECRET_MUX_TOKEN_ID=$(echo -n 'your-token-id' | base64), and read back with {{ secret('MUX_TOKEN_ID') }}. Use the Enterprise secrets backend for encryption at rest and access control.
MUX_TOKEN_ID, MUX_TOKEN_SECRET and SLACK_WEBHOOK as secrets.min_assets and compare the counts and the error in the logs with the Assets page in the Mux dashboard.hourly_check.next_cursor when more than 100 assets are created in the window, or shorten lookback_hours (the summary reports more_pages).passthrough or meta to see which upload source or customer fails.GET /video/v1/live-streams to watch live streams in the same run.lookback_hours: type INT, default 24.warning_error_rate: type FLOAT, default 5.0 (percent).critical_error_rate: type FLOAT, default 20.0 (percent).min_assets: type INT, default 10.stuck_minutes: type INT, default 60.status: one of HEALTHY, WARNING, CRITICAL, LOW_VOLUME, UNREACHABLE.{{ fromJson(outputs.summarize_assets.value).top_error }} for the most common Mux error.next_cursor paging or a shorter window.preparing for a while; raise stuck_minutes if you ingest large files.