Data Hub

Manage the watcher fleet

Open an instrument’s watcher page, monitor watcher health, list every watcher, change a watcher’s settings, deregister watchers, and approve or request uploads.

ForAdministrators

Each instrument’s watcher has its own page, under the instrument, with the watcher’s activity, health, and settings. Settings → Watchers lists every watcher in one table, below the form for choosing which version watchers update to. Publishing a new version is covered in Roll out watcher releases.

Members can open a watcher’s page too, but only to read it. Only admins see the settings form, Restore, Deregister, and Settings → Watchers. Check that new files will arrive describes what everyone else sees: the instrument’s status badge and its notices.

Open a watcher’s page

The watcher is part of its instrument, so its page is at /instruments/your_instrument_id/watcher. To open it:

  • Select the status badge beside the instrument’s name
  • Choose Watcher from the three-dot menu on the instrument page, or from a row’s menu on Instruments
  • Select See details in a notice on an instrument page or a run page
  • Select an instrument in the list under Settings → Watchers

The heading reads Watcher for and the instrument’s name, with the watcher’s status badge beside it. Under it, a summary shows:

  • Computer: the name of the instrument PC
  • Operating system
  • Version: followed by Up to date when it matches the Latest version under Settings → Watchers, or Update available and the latest version when it’s lower
  • Last heartbeat: how long ago, with the exact time when you hover over it
  • Upload mode: Automatic or Manual

One PC can run watchers for several instruments. When another active watcher reports the same computer name (ignoring capital letters, as Windows does), the summary names the other instruments and warns that restarting the computer takes them offline too. Deregistered watchers don’t count.

Below the summary, links switch between Activity, Health, and Settings. They are separate addresses, so you can share a link to one: /watcher is Activity, /watcher/health is Health, and /watcher/settings is Settings.

datahub.example.com/instruments/jolene-fplc/watcherWatcher page on the Activity tab, with an Online badge, a summary of the computer and version, and the event log

Past watchers

An instrument has at most one active watcher, but it keeps every watcher it has had. When it has had more than one, a button at the top of the summary, Viewing and a computer name, opens a list of them, newest first. Each entry shows the computer, Current or its dates, and who deregistered it.

A past watcher opens read-only. Its badge reads Deregistered, a notice explains that it is a past watcher and links back to the current one, and every tab shows that watcher’s own events, heartbeats, and settings history. The address ends in ?watcher= and the watcher’s ID. A watcher ID from another instrument returns a not-found page.

When an instrument has no current watcher, because its watcher was deregistered or the instrument was retired, /watcher opens on its most recent past watcher with that notice. Admins also see Connect a new watcher, which opens Set up an instrument. An instrument that never had a watcher shows “No watcher has connected yet.”

Watcher pages used to have their own addresses, and links to them still work:

  • /watchers/your_watcher_id opens the instrument’s watcher page, on the matching tab: ?tab=logs opens Activity, ?tab=status opens Health, and ?tab=configuration opens Settings. A deregistered watcher opens as a past watcher
  • /watchers opens Settings → Watchers for admins, on its Deregistered tab if the link asked for it, and Instruments for members

Monitor watcher health

Each watcher sends a heartbeat to Data Hub every 60 seconds, reporting its version, instrument, watch folder, upload mode, upload counts, and how long it has been running.

Status

The badge beside the page heading, and in the Status column of Settings → Watchers, shows the watcher’s state: Online, Waiting: folder not found, Unresponsive, Stopped, Registered, or Deregistered. Watcher status explains when each one shows. Hover over the badge for details, such as which folder a watcher in Waiting: folder not found is looking for.

The instrument’s own badge (Online, Restarting, Connecting, or Offline) is a simpler summary of the same state, for the people who use the instrument; see Instrument status.

Activity

Activity is the watcher’s event log. The heading shows how many events fall in the date range, which starts at Last 7 days. Use the Event type filter and the date range picker to narrow it. The page shows the first 20 events, and Show more loads more.

Each event is a row with a label, a plain message, and when it happened. Run IDs in a message link to the run. Select a row to expand it and see details such as the file’s size, the run, the number of upload parts, and the exact time. Admins also see the raw event as the watcher sent it, which is the most detailed record of what happened on the PC. Members see only the plain version.

The labels are Started, Stopped, File uploaded, Upload failed, Run reported, Settings synced, Error, Update started, Update finished, Update failed, Uploads cancelled, and Couldn’t upload. An event of any other type gets a label made from its name. Some events get a more specific label:

  • Missed heartbeat: an error saying the watcher checked in again after missing some heartbeats
  • File not ready: a file the watcher can’t read yet and will try again. Choosing Upload failed in the Event type filter leaves these out, because those files haven’t failed

The raw event keeps the type names the docs and the API use, such as watcher_started, run_reported, file_uploaded, update_*, and error with a details.kind field that says which error it was.

Data Hub records two events itself:

  • upload_requests_cancelled, shown as Uploads cancelled, when someone deletes a run that has requested uploads
  • uploads_failed, shown as Couldn’t upload, when the watcher reports files it gave up on: one event per run and reason, such as “Couldn’t upload 129 files in run X: folder no longer on the instrument PC”. The files read Upload failed; see When an upload fails. Watchers before 1.4.5 log a “Queued file missing” and a “Gave up uploading” error for each file instead

A file_uploaded event reports size_bytes, part_count, prep_seconds (time spent hashing the file and requesting its upload link), and upload_seconds (time spent sending the file to storage). Divide size_bytes by upload_seconds to get the upload speed.

For problems on the PC, see Troubleshoot a watcher.

Health

Health shows the last 7 days unless you pick another range, up to 31 days. It loads its heartbeat history only when you open it. It has three parts:

  • Four counts: Files uploaded, Upload failures, Restarts (with the reason, for example “All for automatic updates”), and Missed heartbeats (with how long each took to recover). A missed heartbeat is an error event that says the watcher checked in again after missing some
  • A bar chart of files uploaded per day
  • Connectivity: a grid with one row per day and one block per 30 minutes, in your time zone, which the caption names. Hover over a block to see what happened and when

The connectivity grid uses these colors:

  • Green: checked in
  • Gray: restarted for an update
  • Amber: missed a heartbeat and recovered
  • Red: unresponsive. A block that holds a heartbeat but is followed by a long silence with nothing to explain it, such as an outage that’s still going on, is red too
  • Light gray: no data yet, or a half hour that didn’t happen because the clocks changed

A watcher that shows amber blocks every few hours, or red blocks in the middle of the night, points at the PC or its network rather than at Data Hub.

datahub.example.com/instruments/jolene-fplc/watcher/healthWatcher page on the Health tab, with four counts, a chart of files uploaded per day, and the connectivity grid

See every watcher at once

Settings → Watchers, which only admins see, has the release form from Roll out watcher releases at the top and the list of All watchers below it, one row per instrument’s watcher. The list’s heading shows how far a release has spread, for example “14 out of 16 on the latest version”. It’s green when every watcher runs the latest version or a newer one, and amber otherwise.

The Active tab has one row for each watcher:

  • Instrument: opens the watcher’s page
  • Computer: sortable, with a stacked-layers icon when other active watchers share it. Hover over the icon, or focus it with the keyboard, to see how many watchers run on that computer and which instruments
  • Version
  • Status: the watcher’s status badge
  • Settings: Change pending, Change rejected, Edited on PC, restart pending, or a dash when there is nothing to report; see Change a watcher’s settings
  • Last heartbeat
  • A three-dot menu with Deregister

The Deregistered tab lists past watchers, with the Instrument, Computer, Last version, the date it was Deregistered on, and who it was Deregistered by.

datahub.example.com/settings/watchersSettings Watchers page with the release form and the list of all watchers, with a rollout pill and a column for each watcher’s settings

Change a watcher’s settings

Admins can change a watcher’s settings from the web app, without going to the instrument PC.

Open the watcher’s page and choose the Settings tab. It shows:

  • Current settings: what the watcher is running now, as it last reported. Admins get an Edit button here, which opens the form in a dialog with Save change and Preview with recent files. Saving closes the dialog.
  • History: every change, with who made it and when
  • Raw config file (YAML), folded away at the bottom

You can change:

  • Watch folder: any folder on the instrument PC
  • File patterns
  • How files become runs: a preset or your own pattern, and whether to include subfolders
  • Upload mode, Parallel uploads, Stability period, and Max stability wait

The form checks each value as you type. Preview with recent files shows which of the instrument’s recent files the new patterns match and the run ID each would get. It only covers files Data Hub already knows about, so files on the PC that never matched a pattern don’t appear.

datahub.example.com/instruments/instantraman/watcher/settingsWatcher page on the Settings tab, with the current settings, the Edit button, and the history of changes

After you save:

  1. A Change pending notice appears at the top of the tab.
  2. Within about a minute, the watcher learns from its next heartbeat that a change is waiting, and fetches it.
  3. The watcher checks the change, including that the new folder exists and can be read. If a check fails, it keeps its current settings and a Change rejected notice gives the reason, both on the Settings tab and as an error event.
  4. Otherwise it saves the new settings to config.yaml, waits up to two minutes for the uploads it’s sending, and starts watching again with the new settings. The change shows as Applied, and Current settings updates. A file that hadn’t finished uploading, such as a large file partway through, uploads again from the start after the change, unless the change moved the watch folder or switched to manual uploads.

If the new settings match more files, the watcher reports files that are already on the PC as detected, but doesn’t upload them. To upload them, use Upload on the run page; see Request uploads. New files after the change follow the upload mode.

If the watcher is offline, the change waits and is applied when the watcher next starts. If someone also edited config.yaml on the PC while it was offline, the newer of the two edits wins and the other stays in the history.

The same form also opens from the notice on an instrument page that says Data Hub can’t find the watch folder: Change folder opens Settings with the form already open and the Watch folder field selected. See Check that new files will arrive.

Edits made on the PC

An edit made on the PC while the watcher is running, such as with data-hub-watcher config edit, is saved to config.yaml and recorded in the history at once, as Applied. The watcher reads config.yaml only when it starts, though, so it keeps running its previous settings until it restarts. Until then the Settings tab shows Edited on PC — restart pending, and Settings → Watchers shows Edited on PC, restart pending. Current settings shows what the watcher is running, from the settings revision it reports in its heartbeat.

History and restore

The History card records every change, whether it came from Data Hub or from the config file on the PC (such as data-hub-watcher config edit). Each entry has its revision number, its state, who made it, or From the instrument PC, when, and a one-line summary of what changed. To go back to an earlier version, choose Restore on it. That saves its settings as a new change, and never edits the history.

When two admins edit the same watcher at once, the second save is refused with a message to reload, so neither overwrites the other unseen.

Members see the same cards, with the current settings, any notice, and the history, but no form and no Restore. A line with a lock icon says “Only admins can change watcher settings.”

Change settings with the API or an AI assistant

  • API: POST /api/v1/watchers/:watcherId/config-revisions with base_revision and the full settings. Signed-in callers must be admins; tokens must list watchers:admin explicitly (legacy * and watchers:write tokens are refused). GET /api/v1/watchers/:watcherId/config-revisions lists the history. See the generated API docs.
  • MCP: the update_watcher_config tool, for admins. It changes only the settings you name. The assistant shows you the change and asks you to confirm before it saves.

Deregister a watcher

Each instrument can have at most one active watcher. Deregister the old one when a PC is reimaged or replaced, or to clear “instrument already has an active watcher” on a new install.

  • Web app: open the watcher’s page, choose Deregister from its three-dot menu, or choose Deregister from the watcher’s row menu in Settings → Watchers. The dialog asks you to stop the watcher service on the PC first
  • API: DELETE /api/v1/watchers/:watcherId (requires watchers:admin)

Deregistration is a soft delete: heartbeats, events, and runs stay with the instrument, under its past watchers and on the Deregistered tab of Settings → Watchers. The instrument’s badge reads Offline until a new watcher registers, and its page says when the watcher was deregistered and by whom. A watcher removed through the API with a token shows that token’s name as the one that removed it.

A running watcher that’s deregistered stops by itself within about three minutes, and doesn’t start again: Windows doesn’t restart the service, and starting it is refused. To use the PC again, run data-hub-watcher init on it. Watchers before 1.4.3 keep running and getting errors until someone stops them on the PC. See Troubleshoot a watcher.

Retiring an instrument also deregisters its watcher automatically; see Retire an instrument. init is refused for a retired instrument, so reactivate it before anyone runs data-hub-watcher init on the PC again (see Reactivate).

You don’t need to deregister a watcher only because its token was revoked. Re-running data-hub-watcher init with a new token takes over the existing registration; see After revoking a token.

Request uploads

Upload on a run page, or on selected runs in a run list, asks the watcher to send files that are still on the instrument PC. The watcher polls the server’s upload queue once a minute and uploads the files that were requested.

  • In manual upload mode, every file waits in this queue until someone requests it.
  • In auto upload mode, files upload on their own, and the queue holds files someone asks for again, such as ones whose upload failed.

The Upload buttons on a run page follow the instrument’s badge. They work while it reads Online or Restarting, and are turned off for Connecting, Offline, Pending, and Retired, with the reason beside the button. Data Hub also refuses a request for such an instrument. See Request an upload.

When Data Hub cancels a request

Data Hub cancels pending upload requests, and the files go back to Not uploaded, in these cases:

  • The watcher stops cleanly, for example with data-hub-watcher service stop or a self-update you start by hand. It shows Stopped, and nothing is left to upload the files
  • The watcher doesn’t come back after a PC restart, a shutdown, or an automatic update. These stops are expected to be short, so the requests wait and the instrument reads Restarting. If no heartbeat arrives for about 15 minutes, Data Hub cancels them, the watcher shows Unresponsive, and the instrument reads Offline. See When the PC restarts or shuts down
  • Someone deletes the run. Data Hub records an upload_requests_cancelled event on the watcher with the run and the number of files; filter Activity by Uploads cancelled to find it. Restoring the run doesn’t bring the requests back, so request the uploads again. Other runs on the instrument keep their requests
  • Someone deregisters the watcher
  • Someone changes the instrument’s watch folder, from the web app or on the PC, so the watcher doesn’t look for files at paths that no longer apply
  • A requested file keeps failing, because it’s missing on disk or its upload fails. The watcher tries it on at most three checks before Data Hub cancels it, and requesting it again gives it three new tries. Before watcher 1.4.3, a request made right after a cancellation was cancelled at once

Each cancellation shows on the watcher’s Activity tab under its own event type. Watchers before 1.4.1 don’t report a PC restart, and watchers before 1.4.2 don’t report an automatic update, so those stops cancel requests at once.

Approve or delete files

For instruments in manual upload mode, the watcher reports runs but uploads a file only after someone approves it. The instrument’s page shows a note beside its file patterns: “Files upload when someone requests them.” Select a file in the files table and choose Upload in the bar at the bottom of the window to approve it, or choose Delete to tell the watcher not to upload it. Select several files to act on all of them at once.

datahub.example.com/instruments/hina-microscope/runs/20260316_101845_330Run page for a manual-upload instrument with its waiting files selected and a bar offering Upload and Delete

Delete also works on a file whose upload failed, on any instrument, and on a file that already reached Data Hub. A deleted file stays deleted, even if the watcher reports it again, and Data Hub keeps it in storage so you can restore it. Deleting a file that was waiting to upload cancels its upload request. Delete and restore files covers the rest.

When a deleted path gets a new file

The watcher reports each path only once, so a new file that the instrument later writes at a deleted file’s path doesn’t appear on its own. It appears when the watcher reports that path again: after data-hub-watcher state forget, or when the watcher starts without its saved record of what it has reported, for example after a reinstall. Data Hub then treats it as a new file if its size or creation time differs from the deleted file’s. On Linux, the modification time stands in for the creation time.

Because Data Hub compares only size and time, two cases can surprise you:

  • A new file the same size as the deleted one counts as the same file when it keeps the old creation time, so it stays deleted. On Windows and macOS this happens when the instrument overwrites the file in place. On Windows it can also happen when the file is deleted and written again, or saved through a temporary copy, within about 15 seconds.
  • Copying a folder, for example with Explorer or xcopy on Windows or cp without -p on Linux, gives the copies new times. After you replace an instrument PC or restore its folder from a backup, a new watcher that scans the copied folder reports the files you deleted as new files. Delete them again.

On this page