Optional features

Opt-in functionality lives behind feature flags of the consolidated bsrs crate so the default build stays small and dependency-light.

Document sinks

FeaturePulls inUse when
zmqpure-Rust omq crate + rmp-serdebluesky RemoteDispatcher consumers
tiledtiled-rs (HTTP)Tiled catalog ingestion
kafkapure-Rust rskafka crateKafka topics, no librdkafka
cargo build -p bsrs --features zmq,tiled,kafka

Frame sinks (stream module)

FeaturePulls inUse when
hdf5rust-hdf5 (pure Rust)NeXus-flavored HDF5 detector files
pvaepics-pva-rsNTNDArray monitor source

Hdf5FrameSink::new("det", "/data/run.h5", payload_size) writes into /entry/instrument/<name>/data (chunked, optional gzip) and emits Resource + Datum docs pointing at the file path. The PvaMonitorSource subscribes to a PVA NTNDArray PV and pushes frames into a FramePipe that fans out to one or more sinks.

EPICS backends

Both EPICS backends live in the consolidated bsrs crate as features that are on by default:

CrateFeatureBehavior without the feature
bsrscaStub backend that errors on call
bsrspvaStub backend that errors on call
# Real backends build by default; opt out for an EPICS-free build:
cargo build -p bsrs --no-default-features

--no-default-features swaps in the stub backends so the rest of the workspace compiles cleanly on systems without EPICS. CI build-tests both the stub and the real paths; live IOC integration testing is on the roadmap.

Lua read-side surface

FeatureAdds
cli + tiledtiled.from_uri(url) Lua global + methods
cargo build -p bsrs --features cli,tiled

Inside the REPL:

local cat = tiled.from_uri("http://localhost:8000")
for _, k in ipairs(cat:keys()) do print(k) end
local run = cat:get("scan_42")
print(run:metadata())

All HTTP calls run on bsrs's tokio runtime; the REPL thread re-enters mlua's reentrant lock, so calls inside Lua plans are safe.

Observability

CrateFeatureAdds
bsrs-qsmetricsPrometheus /metrics HTTP listener
bsrs qs-manager --metrics 127.0.0.1:9090
# build first with: cargo build -p bsrs-qs --features metrics

Currently exported:

  • bsrs_qs_rpc_calls_total{method=...}
  • bsrs_qs_rpc_errors_total{method=...} (when wired)
  • bsrs_qs_queue_depth (gauge)
  • bsrs_qs_runs_total{exit_status=...}
  • bsrs_qs_documents_total{name=...}

Scrape with the standard Prometheus config:

scrape_configs:
  - job_name: 'bsrs-qs'
    static_configs:
      - targets: ['localhost:9090']