Skip to content
Matinee

Alerts and metrics

Server health shows what’s wrong when you look. Alerts tell you when you’re not looking: Matinee sends an email or posts a message when something needs you, and again when it’s sorted.

Alerts go straight from your server to your own mail server, Discord channel, ntfy topic or Home Assistant. Nothing passes through anyone else’s servers.

Set them up in Settings → Server health, under Alerts. Only admins can.

Alerts: what to alert on, email, and a Home Assistant webhook

Every alert is on until you turn it off. Change the numbers to suit your server.

Alert When it’s sent
A disk is almost full A disk the server uses gets to 90% full (or what you set). That’s the data folder, transcoding scratch space, seek bar previews, artwork, downloads and every library folder. You hear once, then again only if it gets 5 points fuller (95%, say) or nearly out of room (98%), and once more when there’s room again. A disk that goes a point or two under and back doesn’t count as clearing up, and restarting the server doesn’t send it again.
A library folder can’t be read A library folder has been out of reach for 2 minutes, which usually means a network share has dropped. A share that’s gone for a moment doesn’t count. You hear again when it’s back.
Errors pile up The server logs 10 or more errors within 15 minutes (or what you set). The alert names the most common ones.
Transcodes keep failing 3 or more transcodes fail within 15 minutes (or what you set), so players couldn’t play. That’s often a GPU that’s stopped working, or FFmpeg that can’t read the files.
Transcodes run out of room A heads-up first: the transcode folder is too small to hold a whole long video, so transcodes have started keeping only the minutes around where they play. Videos still play; this is your warning before anything fails, sent at most once a day. Then, if a video couldn’t start or stopped partway because the folder was full, a warning saying how much room was left, at most once an hour. See When the transcode folder runs short of room.
The server starts or restarts The server starts. The alert says if it was updated, and warns when it stopped last time without shutting down cleanly, such as after a crash, the container being killed, or a power cut. That run’s log, and the crash if there was one, is in Server health.

Errors and failing transcodes are sent at most once an hour while they keep happening, so a bad night doesn’t flood your inbox.

Add as many places as you like. Send a test alert tries them all, before or after you save, and says which worked and why any didn’t.

Turn on Send alerts by email and fill in your mail server, the same details a mail app asks for. Most providers use port 587 with STARTTLS; some use 465 with TLS. For Gmail and other accounts with two-step sign-in, make an app password and use that.

To takes several addresses, separated by commas.

In Discord, open the channel’s settings, then Integrations → Webhooks → New Webhook, and Copy Webhook URL. Add a webhook in Matinee, pick Discord, and paste it.

ntfy sends push notifications to your phone. Pick ntfy and enter your topic’s address, such as https://ntfy.sh/a-long-secret-topic, or one on your own ntfy server. If the topic needs a sign-in, enter an access token too. Problems arrive as high priority, and a folder that can’t be read as urgent.

Matinee can start any automation in Home Assistant: flash a light, speak on a speaker, or send a notification to the Home Assistant app.

  1. In Home Assistant, make an automation and pick the Webhook trigger. Leave Only accessible from the local network on if Matinee is on the same network.
  2. Copy the trigger’s address, such as http://homeassistant.local:8123/api/webhook/matinee-alerts.
  3. In Matinee, add a webhook, pick Home Assistant, and paste it.

The automation gets the alert in trigger.json. For example, to send it to your phone:

triggers:
- trigger: webhook
webhook_id: matinee-alerts
allowed_methods: [POST]
local_only: true
actions:
- action: notify.mobile_app_your_phone
data:
title: "{{ trigger.json.title }}"
message: "{{ trigger.json.message }}"

Pick Other (JSON) to post alerts to anything that takes JSON. Each alert looks like this:

{
"server": "Matinee",
"rule": "disk",
"key": "disk:/media/movies",
"level": "warning",
"title": "Disk almost full",
"message": "The disk with Movies (/media/movies) is 93% full: 140.2 GB free of 1.8 TB.",
"resolved": false,
"time": "2026-11-02T06:00:00Z",
"url": "https://matinee.example.com/settings/health"
}

rule is disk, folder, errors, transcodes, restart or test, and level is info, warning or critical. An alert that’s sorted comes again with resolved: true. url links to Server health when the server knows its own address (MATINEE_PUBLIC_URL, see Configuration).

Webhook addresses, the mail password and ntfy tokens stay on the server. Settings only shows a hint of each address; leave the box empty to keep it.

The last 50 alerts are listed under Recent alerts, with where each was delivered and, for any place it couldn’t reach, why. Alerts that are still true are listed first under Happening now.

Recent alerts: a test alert delivered to Home Assistant

If you watch your home lab with Prometheus and Grafana, Matinee can report what Server health shows. It’s off until you turn it on.

  1. Under Prometheus metrics, select Turn on. Matinee makes a token.
  2. Add the scrape config it shows to prometheus.yml. Prometheus sends the token with each request.

Prometheus metrics: the address, the token, and a scrape config to copy

The metrics are at /metrics on the server’s address, and answer only with the token. New token replaces it (the old one stops working), and Turn off turns metrics off again.

Metric What it is
matinee_build_info The server’s version, in the version label.
matinee_start_time_seconds When the server started.
matinee_cpu_percent, matinee_host_cpu_percent How much of the processors Matinee and the whole machine use.
matinee_memory_bytes, matinee_memory_limit_bytes Memory Matinee uses, and a container’s limit.
matinee_sent_bytes_total Bytes sent since the server started.
matinee_http_requests_total, matinee_http_server_errors_total Requests answered, and those that failed on the server.
matinee_log_warnings_total, matinee_log_errors_total Warnings and errors logged.
matinee_streams_playing, matinee_transcodes_active What’s playing and transcoding now.
matinee_transcodes_started_total, matinee_transcodes_failed_total Transcodes started and failed.
matinee_disk_total_bytes, matinee_disk_free_bytes Each disk’s size and free space, labeled with a path on it and its use.
matinee_disk_reachable 1 when a folder can be read, 0 when it can’t.
matinee_libraries How many libraries there are.
matinee_alerts_firing Alerts that are true now, by rule.
matinee_goroutines A detail of the server process, for bug reports.

Counts that end in _total start again from zero when the server restarts, which Prometheus expects.

On Kubernetes, point a ServiceMonitor or scrape job at the Matinee service’s port with the token as a bearer token, the same as the config above. The Helm chart can make one, with alerts ready to go (see Kubernetes).

These say how quickly players get going and whether the server keeps up, and give away a server that’s slowly leaking.

Metric What it is
matinee_transcode_start_seconds How long players wait for a transcode to start: pressing play, or seeking past what’s been made. A histogram, so Grafana can show the typical and the worst.
matinee_segment_wait_seconds How long players wait for each transcoded piece they ask for. Long waits are buffering.
matinee_transcodes_slow Transcodes making video slower than it plays. Their players will buffer.
matinee_transcodes_superseded_total Transcodes stopped because the player jumped somewhere else. Lots of these are normal when someone scrubs.
matinee_ffmpeg_processes FFmpeg processes running for playback. It should match matinee_transcodes_active within a few seconds. More for minutes means FFmpeg isn’t stopping.
matinee_heap_live_bytes Memory held by the server’s live data. It goes up and down with use; one that only climbs over days is a leak.
matinee_open_files Files and connections the server has open (Linux).
matinee_gc_cycles_total How often the server has cleaned up memory.

To get a useful picture, look at these in Grafana:

  • Start time: histogram_quantile(0.9, sum by (le) (rate(matinee_transcode_start_seconds_bucket[15m]))) is how long 9 in 10 starts take. On most servers it’s a second or two.
  • Buffering: 1 - sum(rate(matinee_segment_wait_seconds_bucket{le="5"}[10m])) / sum(rate(matinee_segment_wait_seconds_count[10m])) is the share of pieces players waited over 5 seconds for.

When the server is slow or its memory keeps growing, Go’s profiler shows where. It’s at /debug/pprof/ and takes the metrics token too, so it’s off while metrics are off.

Terminal window
curl -H "Authorization: Bearer $TOKEN" -o heap.pprof https://matinee.example.com/debug/pprof/heap
curl -H "Authorization: Bearer $TOKEN" -o cpu.pprof "https://matinee.example.com/debug/pprof/profile?seconds=30"
curl -H "Authorization: Bearer $TOKEN" "https://matinee.example.com/debug/pprof/goroutine?debug=1" > goroutines.txt
go tool pprof -http=: heap.pprof

Attach the files to a bug report if you’d like us to look.

For a dashboard such as Homepage, /stats gives a short summary as JSON. It takes the same token as /metrics, so turn metrics on first.

Field What it is
playing, transcodes What’s playing and transcoding now.
users, libraries Accounts (without guests and profiles) and libraries.
movies, shows, episodes Videos in the libraries. Extra versions of a title count once.
artists, albums, tracks, audiobooks, podcasts Music, books and podcasts.
requests, issues Requests waiting for an admin, and reported problems not yet resolved.
alerts Alerts that are true now.

In Homepage it fits the custom API widget:

- Matinee:
href: https://matinee.example.com
icon: mdi-filmstrip
widget:
type: customapi
url: http://matinee:7171/stats
headers:
Authorization: Bearer your-metrics-token
mappings:
- {field: playing, label: Playing, format: number}
- {field: transcodes, label: Transcoding, format: number}
- {field: movies, label: Movies, format: number}
- {field: shows, label: Shows, format: number}