Skip to main content

Know when a context stream falls behind

Each context stream that copies data into Prism is refreshed on a schedule. If those refreshes stop, Prism goes on answering from the last copy it has, and an answer about this week can quietly become an answer about three weeks ago. This page covers how Prism notices that, how to see it, and how to have your own monitoring watch for it, since nobody at Tetrate can see your installation.

What stale means​

A context stream is stale when its last completed refresh is older than its threshold. Admin → Context streams then shows the word stale on the stream. The line under the word says when the last refresh completed and which threshold it is over. The self test shows the stream as a warning.

The age is measured from when the last refresh completed, not from the newest date in the data. A source with only a date and no time of day can look up to two days old however recently it was refreshed, and that is not what this measures.

A source that copies several tables, such as a database snapshot of several views, copies each table on its own, and one refused table does not stop the others. The source's last completed refresh is the last one in which every table copied, so one table that keeps being refused holds it back. Each table is therefore also judged on its own latest copy:

  • Admin → Context streams lists, under Datasets, when each table last copied, and for a table whose latest copy was refused, when and why.
  • The line under stale starts with which tables are behind, for example behind: changes (1 of 4) · the other 3 copied within 3h.
  • The self test's line for the stream says the same.
  • The status endpoint below has a datasets list.

A table that Prism reads as a time window rather than copying whole has no copy of its own to judge, and reads as its source does.

A table that Prism copies whole may have no record of its own copy. This happens after an upgrade from a release before the record existed, until the table's first good copy, and for a table whose pull has always come back empty. Prism then dates the table by the time its rows were written. A run whose pull came back empty writes no rows, so it does not make the table look newer. When Prism cannot read that time, the table's age is unknown, and its stale, last_copied_at and age_seconds on the status endpoint are null. The same is true when that time is more than five seconds ahead of Prism's own clock, because the datapond's clock wrote it.

A stream held back only by refused tables is not stale. When every other table copied inside the threshold, the stream does not wear stale: the line under its word starts with the tables being refused, for example refused: changes (1 of 4), and its pane says only refused tables hold it back. It still counts as overdue and as failing. It is still stale when any other table is behind, when every table is refused, or when one of its tables reads as its source does.

Only switched-on streams that copy data can be stale. A stream that reads at question time (query-through) copies nothing and has no refresh to fall behind. A stream that has never completed a refresh has no age yet. If its refreshes are failing, the stream is marked refresh failed; see How each copy went.

Where the threshold comes from​

You can set a threshold on each stream. Open it on Admin → Context streams, enter an ISO 8601 duration such as PT12H, P2D or P1W, and choose Set threshold. Choose Use the derived threshold to remove it.

Without one, the threshold is derived from the stream's own schedule. The stream is stale once ingest.stallAfterIntervals scheduled refreshes have passed with none completing. The chart default is 4, so a stream refreshed every 6 hours is stale after 24 hours, and one refreshed daily at 03:00 is stale at the fourth 03:00 after its last refresh. Set ingest.stallAfterIntervals to 0 to turn the derived threshold off; thresholds you set on a stream still apply.

A kind: file source, such as an uploaded roster, has no schedule because you replace the file yourself. It is stale only against a threshold you set on it.

Answers read the same threshold you set. When an answer uses a stream that Prism copies, it calls the stream's figures stale against the threshold on that stream first, then against one the stream's manifest declares (policy.freshness.expect_within), then against the threshold this page derives from the stream's schedule, and otherwise against 24 hours. A kind: file source with neither threshold is never called stale in an answer. An answer drawn from its latest copy still gives that copy's date and how long ago it was loaded, so an old upload never reads as current.

Every change to a threshold is recorded in the audit log, with the value it replaced.

See it in Prism​

A super administrator sees a chip in the top bar of every page, chat included, when one or more context streams are overdue: "2 streams overdue". It links to Admin → Context streams. Other users see nothing new.

Overdue means the stream's last refresh is older than its threshold, whatever word Admin → Context streams gives it. A stream that has stopped for good, for example one the ingest no longer runs (not ingested), is counted too. If Prism could not read its context streams or its record of their refreshes, the chip says "freshness unknown" instead.

When no stream is overdue but one or more had a failed last refresh, the chip says "2 streams failing". When streams are overdue, the chip says so first, and its tooltip adds how many are failing. If Prism could not read its record of each stream's runs, the chip says "refresh failures unknown". The Context streams page shows the same failing count beside its summary line.

The counts are worked out at most once a minute on each of the app's pods, so they can lag by up to a minute and two pods can briefly disagree. The documentation pages under /docs do not show the chip.

Find it in your logs​

Each time the ingest tick runs, it judges every switched-on stream by the same rule, and prints one line on its standard output when a stream becomes overdue and one when it recovers. It prints nothing while a stream's state is unchanged, so a log pipeline that keeps the tick's output can alert on these lines directly. A line is recorded only once it has been printed, so a tick stopped at that moment may print it again at its next run:

{"event": "stream_freshness", "component": "prism-ingest", "source": "gitlab",
"state": "stale", "previous": "fresh", "last_completed_at": "2026-10-07T03:10:00+00:00",
"age_seconds": 90000, "threshold_seconds": 86400, "threshold_from": "schedule",
"at": "2026-10-08T04:10:00+00:00"}
FieldMeaning
sourceThe stream's name on Admin → Context streams.
statestale when the last refresh is older than the threshold, fresh when it no longer is. This is "overdue" as above, not the word the page shows.
previousThe state the tick last reported, or null the first time it reports this stream.
last_completed_at, age_secondsWhen the last refresh completed, and how long ago.
threshold_seconds, threshold_fromThe threshold, and whether it was set on the stream or derived from its schedule.
atWhen the tick judged it.

The first time the tick runs after an upgrade to this release, every stream that is already overdue is reported once, with previous: null. A stream that is fresh the first time is recorded without a line, so there is no "recovered" line for a stream that was never reported overdue.

No line is printed for a stream with no completed refresh, one no threshold applies to, a synthetic one, or one the ingest never copies. A stream switched off or deleted while overdue is no longer judged, so no recovery line follows.

Have your own monitoring watch it​

Prism can report every stream's freshness to your monitoring as JSON. This is off until you give it a token:

secrets:
statusToken: "<output of: openssl rand -hex 32>"

With existingSecret, put the token under the key status-token instead. To change the token without a gap, give two separated by a comma, move your monitor to the new one, then remove the old one.

Your monitor then sends the token in the X-Prism-Status-Token header:

curl -s -H "X-Prism-Status-Token: $TOKEN" https://<prism>/api/status/streams

Authorization: Bearer <token> is accepted too, for a monitor that can only send that. Prefer X-Prism-Status-Token: some sign-in proxies remove the caller's Authorization header (see below).

{
"checked_at": "2026-10-09T12:00:00+00:00",
"stale": 1,
"overdue": 1,
"failing": 1,
"ingest_state": "ok",
"run_history": "ok",
"verification_check": "ok",
"streams": [
{"name": "gitlab", "label": "GitLab", "word": "stale", "stale": true, "overdue": true,
"last_completed_at": "2026-10-07T03:10:00+00:00",
"age_seconds": 204600, "threshold_seconds": 86400,
"failing_streak": 3,
"datasets": []}
]
}

One entry appears for each switched-on stream:

  • word is what Admin → Context streams shows, and stale is true when that word is stale. A stream that is also, say, wrong shows that word instead, as on the page.
  • overdue is true when the last refresh is older than the threshold, whatever the word. A stream that has stopped for good, for example one the ingest no longer runs (not ingested) or whose manifest no longer validates (needs setup), is overdue without being stale, and records no failed run.
  • last_completed_at and age_seconds are null when no refresh has completed.
  • threshold_seconds is null when no threshold applies.
  • datasets judges each table (see What stale means). refused_at is when its latest copy was refused and is null otherwise; the reason is on the stream's pane, not here. copy_noted is true when the copy being served carries a note, such as that it landed without a reload check (Postgres snapshot); the note itself is on the stream's pane. The stream's own fields above are its last completed refresh, which one refused table holds back; held_back is true when only refused tables hold it back while the others copied inside the threshold, and the stream is then not stale.
  • failing_streak counts the runs in a row that have failed or been abandoned since the stream last completed one. It is null if the run history could not be read; run_history then says unreadable.

The top-level stale, overdue and failing count the streams with each condition. ingest_state says whether Prism could read its own record of each stream's refreshes and judge every stream against it. When it is unreadable, at least one stream could not be judged, and reads stale: false and overdue: false because nothing could be measured, not because it is fresh.

verification_check says whether Prism could ask which questions marked correct this version refuses. Such a question no longer counts as proven, on the page or here. When it is unreadable, a word may say verified on the strength of such a question. It does not change stale or overdue.

A reasonable alert fires when overdue is above zero, when any stream's failing_streak reaches a number you choose, or when ingest_state or run_history is not ok. Whoever is paged opens the stream on Admin → Context streams: its Runs tab shows why each run failed.

What the endpoint does not do:

  • Without a token it does not exist. It answers 404.
  • With a token, it answers only a caller who presents it, in either header. Anyone else gets 401 and nothing about the streams. The token is never written to a log.
  • It carries no error text and no data. It reports stream names, labels, times and counts only.
  • It is checked at request time, so poll it on your monitor's own schedule.

With viewer scoping on​

If viewer scoping is on under the easyauth or iap sign-in mode, the app's network policy admits only your sign-in proxy, so a monitor cannot reach the app directly. Do not add the monitor to viewerScoping.networkPolicy.from: anything listed there can send the identity headers the app trusts. The monitor has to come through the sign-in proxy, which must let this one path through without a sign-in and pass the token header on unchanged.

  • oauth2-proxy: add --skip-auth-route=GET=^/api/status/streams$ and send the token as X-Prism-Status-Token. Measured on oauth2-proxy v7.12.0 and v7.13.0, including the configuration file in Sign in with Entra ID: X-Prism-Status-Token reached Prism unchanged in every configuration tried. A caller's forged identity header did not reach Prism on that path, and every other path still required a sign-in. Authorization is not safe here: an oauth2-proxy that sets it itself (--pass-authorization-header, or an Authorization entry in injectRequestHeaders) removes the caller's, even on the skipped path.
  • Azure Container Apps' built-in authentication: not documented; test it on your install. Its globalValidation.excludedPaths lets a path through without a sign-in, but Microsoft's documentation does not say which request headers survive on an excluded path, and this has not been measured. A 401 from Prism on that path means the token did not arrive.

What to do when a stream is stale​

  1. Open the stream on Admin → Context streams and look at its Runs tab.
    • Runs are failing: the newest one says why, and the reason is usually an expired credential or an unreachable source. Fix it, then choose Copy now to refresh without waiting for the schedule.
    • No runs since the last good one: the ingest is not running at all. Check that the ingest tick's CronJob is scheduling (kubectl get cronjob in Prism's namespace) and that the stream is switched on.
  2. If the threshold is wrong for this stream, for example a monthly extract held to a daily schedule's threshold, set the right one on the stream rather than ignoring the word.

Until a refresh completes, answers that use the stream come from its last copy.