Effem AppView: what to monitor #
What to watch on the deployed service, at what thresholds, and what each
signal means. The steps to take when something fires are in RUNBOOK.md.
Status on 2026-11-09: nothing here is set up. No uptime monitor and no metrics scraper exist. The uptime monitor in section 2 is a task to finish before public launch. The Prometheus rules in section 3 can wait until there is traffic to watch.
Railway does not monitor the service. It calls the health check path only while a deploy starts, to decide when the new deployment may take traffic, and never again afterwards.
1. What the service reports #
| Signal | How to read it | What it tells you |
|---|---|---|
GET /_live |
Open. 200 {"status":"ok","db":true}, or 503 with "status":"unavailable". |
This process is up and the database answers. Nothing about Jetstream. Railway's deploy check uses it. |
GET /_health |
Open. 200 with "status":"ok", or 503 with "status":"starting" or "status":"degraded". |
The whole service is doing its job: the database answers and records are arriving. |
GET /metrics |
Admin token. Prometheus text. | Counters and gauges of this process since it started. |
| Logs | railway logs --service zonal-charisma |
Every request, every indexed Effem record, and every failure. |
The body of /_health:
{"status": "ok", "db": true, "firehose_up": true, "firehose_seq": 27012306290, "firehose_age_s": 1}
| Field | Meaning |
|---|---|
status |
ok; starting when no Jetstream cursor has been saved yet (an empty database, for the first seconds); degraded when the database does not answer within three seconds or the newest event is more than 300 seconds old. |
db |
The database answered. |
firehose_up |
Some process holds the ingest lease right now, so a reader is running. |
firehose_seq |
The Jetstream sequence number of the newest event saved. |
firehose_age_s |
Seconds since that event. In normal running it is a few seconds and now and then ten or more. |
The answer is read from the database, so every instance gives the same one.
The key order in the JSON varies; "status":"ok" always appears as one
unbroken string.
Both routes give the database three seconds. When it does not answer in
that time, /_live answers 503 unavailable and /_health answers 503
degraded with "db":false, about three seconds after the request. Against
a frozen local database every answer took between 3.0 and 3.5 seconds. A
database outage therefore reaches a monitor as a 503 and not as a timeout.
A monitor still needs a timeout of its own and has to count a timeout as a
failure, because that is what a dead process or an unreachable network looks
like. RUNBOOK.md, "Health states", has the measurements.
The 300-second limit is deliberate, and it is ten times the Go service's 30. The stream this service subscribes to is quiet. Outside Effem's own records it carries only account and identity events for the whole network, roughly one every second or two when measured on 2026-11-09, and gaps of ten seconds occur without anything being wrong.
2. The uptime monitor (before launch) #
Use an external service that does not run on Railway, so that it still works when Railway does not. Two checks:
| Check | Target | Passes when | Timeout | Suggested schedule |
|---|---|---|---|---|
| AppView | GET https://appview.effem.xyz/_health |
HTTP 200 and the body contains "status":"ok" |
10 seconds | Every minute; alert after two failures in a row |
| Sign-in keys | GET https://auth.sparrowtek.com/effem/.well-known/jwks.json |
HTTP 200 and the body contains "keys" |
10 seconds | Every five minutes; alert after two failures in a row |
Send both to one channel that reaches a phone.
What the AppView check catches, and how fast:
- The service is down or unreachable, or the database is down: within two
checks. A database outage is a 503 with
"db":false, about three seconds after the request and well inside the check's timeout. A dead process or a broken network is a timeout, so make sure the monitor counts a timeout as a failure. - Jetstream ingestion has stopped: after 300 seconds without an event, plus two checks. New comments and subscriptions stop appearing in the app while everything else still works.
What it does not catch: a single failing route, slow answers, a full report queue, or Podcast Index trouble. Section 3 covers the first three of those.
The second check is on the shared sign-in service, which is a separate deployment. If it is down nobody can sign in to Effem or refresh a session, and nothing in the AppView notices.
Expect one harmless pattern. On an empty database /_health answers
starting with a 503 until the first event arrives, a few seconds after
the first start. An ordinary deploy should not cause a failure: the old
deployment serves until the new one answers /_live, and the saved cursor
keeps /_health at ok while the reader changes hands.
3. Metrics #
GET /metrics needs a token with the admin scope and reports one process.
Counters start at zero on every deploy.
A counter is created the first time it is incremented. Until then the series does not exist at all, so a rule written on a counter returns no data, not zero, for an event that has never happened. The rules below are written with that in mind.
The metrics the code exports #
Custom metrics, from Sources/EffemAppView/Observability/Metrics.swift:
| Metric | Type | Labels | Meaning |
|---|---|---|---|
effem_firehose_connected |
gauge | none | 1 while this process holds a Jetstream connection, 0 after it loses one. Absent until this process first connects. |
effem_firehose_lag_seconds |
gauge | none | Seconds since this process last received a Jetstream event. Updated once a second while connected, and not at all while disconnected. |
effem_firehose_events_total |
counter | kind, action |
Events received. kind is commit, account, identity, sync or info. action is create, update or delete for a commit, active or inactive for an account event, the notice's name for info, and empty otherwise. Commits are counted for the Effem collections only. |
effem_indexer_errors_total |
counter | collection, action |
Records that failed to index or delete. Each one is also a row in indexer_errors. |
effem_pi_cache_hits_total |
counter | endpoint |
Podcast requests answered from a fresh cached copy. |
effem_pi_cache_misses_total |
counter | endpoint |
Podcast requests that found no fresh copy. |
effem_pi_upstream_calls_total |
counter | endpoint, outcome |
Calls that reached Podcast Index. outcome is ok, error, or not_found when Podcast Index answered that it holds no feed at the address asked for, which is an answer and not a failure. Two more come from getNewEpisodes (endpoint episodes_since): timeout for a call cancelled at the route's eight-second limit, which Podcast Index being slow about feeds it was not asked about lately makes ordinary, and too_much for an answer that came back full and was asked for again in halves. |
effem_pi_budget_rejections_total |
counter | scope |
Cache misses refused a call to Podcast Index. scope is client (one caller over its allowance) or service (the ceiling for the whole service). |
effem_pi_stale_served_total |
counter | endpoint |
Requests answered with an expired copy because the budget was spent or Podcast Index failed. |
effem_rate_limit_rejections_total |
counter | kind |
Requests refused with 429. kind is ip, sub, report (the report limiter) or unknown (the caller could not be identified, which means the proxy settings are wrong). |
endpoint is one of search_podcasts, search_title, search_person,
podcast_by_feed_id, podcast_by_itunes_id, episodes_by_feed_id,
episodes_by_feed_url, episode_by_id, trending and recent_episodes.
HTTP metrics come from Hummingbird's own middleware:
| Metric | Type | Labels | Meaning |
|---|---|---|---|
hb_requests |
counter | http_route, http_request_method, http_response_status_code |
Requests answered, including unexpected errors as 500. An unmatched path has the route NotFound. |
hb_request_errors |
counter | http_route, http_request_method, error_type |
Requests that ended in an error of any kind, 4xx included. error_type is the status code. |
http_server_request_duration |
histogram | http_route, http_request_method, http_response_status_code |
Time to answer, in seconds, as _bucket, _sum and _count series. |
http_server_active_requests |
gauge | http_request_method |
Requests in flight. |
The Go service's effem_http_requests_total does not exist here. A rule
ported from it has to use hb_requests and its label names.
Scraping #
scrape_configs:
- job_name: effem-appview
scheme: https
metrics_path: /metrics
scrape_interval: 30s
authorization:
type: Bearer
credentials_file: /etc/prometheus/effem-admin-token
static_configs:
- targets: ['appview.effem.xyz']
Give the scraper its own admin token, a second entry in
EFFEM_AUTH_ADMIN_TOKENS, so it can be rotated without touching the
moderator's. Write it as <token>=*: the scraper is a machine and should
not act as anyone's account. An admin token can ban accounts and remove
content, so store the scraper's as carefully as any other.
Rules #
These are starting values. Nothing here has seen production traffic yet, so revisit the thresholds after the first month.
groups:
- name: effem-appview
rules:
- alert: EffemAppViewDown
expr: up{job="effem-appview"} == 0
for: 2m
labels: { severity: page }
annotations:
summary: "The AppView has not answered a scrape for 2 minutes"
- alert: EffemJetstreamDisconnected
expr: effem_firehose_connected == 0 or absent(effem_firehose_connected)
for: 5m
labels: { severity: page }
annotations:
summary: "No Jetstream connection for 5 minutes"
- alert: EffemJetstreamSilent
expr: effem_firehose_connected == 1 and effem_firehose_lag_seconds > 120
for: 3m
labels: { severity: warn }
annotations:
summary: "Connected to Jetstream but no event for over 2 minutes"
- alert: EffemIndexerErrors
expr: sum(increase(effem_indexer_errors_total[1h])) > 20
labels: { severity: warn }
annotations:
summary: "More than 20 records failed to index in the last hour"
- alert: EffemServerErrors
expr: |
sum(rate(hb_requests{http_response_status_code=~"5..", http_route!~"/_health|/_live"}[5m]))
/
sum(rate(hb_requests{http_route!~"/_health|/_live"}[5m]))
> 0.05
for: 10m
labels: { severity: page }
annotations:
summary: "More than 5% of requests answered 5xx for 10 minutes"
- alert: EffemCallerNotIdentified
expr: sum(increase(effem_rate_limit_rejections_total{kind="unknown"}[15m])) > 0
labels: { severity: warn }
annotations:
summary: "Requests arrived without a usable client address; check the proxy settings"
- alert: EffemRateLimitRejections
expr: sum(rate(effem_rate_limit_rejections_total{kind!="unknown"}[5m])) > 5
for: 10m
labels: { severity: warn }
annotations:
summary: "More than 5 requests a second refused with 429 for 10 minutes"
- alert: EffemPodcastIndexCeiling
expr: sum(increase(effem_pi_budget_rejections_total{scope="service"}[15m])) > 0
labels: { severity: warn }
annotations:
summary: "The service-wide Podcast Index ceiling was reached"
- alert: EffemPodcastIndexFailing
expr: |
sum(rate(effem_pi_upstream_calls_total{outcome="error"}[10m]))
/
sum(rate(effem_pi_upstream_calls_total[10m]))
> 0.5
for: 10m
labels: { severity: warn }
annotations:
summary: "More than half the calls to Podcast Index failed for 10 minutes"
page means someone should look now. warn means look the same day.
Notes on the rules:
EffemJetstreamDisconnectedusesabsentbecause the gauge does not exist until the reader first connects. An instance that never gets the ingest lease, or never reaches Jetstream, exports nothing.EffemJetstreamSilentonly makes sense while connected. The lag gauge keeps its last value after a disconnect, so on its own it would stay low through an outage.EffemServerErrorsleaves out/_healthand/_live. Both answer 503 on purpose, and the uptime monitor polls/_health, so during an incident its own checks would otherwise inflate the rate.- The health threshold for ingestion is the 300 seconds in section 1. The
Silentrule is an earlier warning, not a replacement.
What each alert points at #
| Alert | Read in RUNBOOK.md |
|---|---|
EffemAppViewDown, a failed uptime check |
"Health states" |
EffemJetstreamDisconnected, EffemJetstreamSilent |
"Jetstream trouble" |
EffemIndexerErrors |
"Indexer errors and the watchdog" |
EffemServerErrors |
"Reading logs", then search for request failed |
EffemCallerNotIdentified |
"Client address" in README.md |
EffemPodcastIndexCeiling, EffemPodcastIndexFailing |
"Podcast Index answers 503" |
4. What has no signal #
- New reports. There is no metric. The notice posted to
EFFEM_REPORT_WEBHOOK_URLis the alert, and that variable is not set as of 2026-11-09. Until it is, the queue has to be read by hand (RUNBOOK.md, "Moderation"). - The backfill queue and the indexer error list. Both are tables with no
gauge.
backfill abandonedin the log means an account was dropped after five failed attempts. The error list is read throughxyz.effem.admin.listIndexerErrors. - The database volume. 5 GB is allocated. Watch its use in the Railway
dashboard on the
Postgresservice, or withrailway metrics --service Postgres --volume. - Logs by level. Railway files every line this service writes as
info, because the service logs to standard output, so Railway's@level:errorfilter finds nothing. Search for message text instead.
Incident log #
Add a row whenever an alert fired for a real reason.
| Date | Signal | What happened | What changed afterwards |
|---|---|---|---|