Skip to main content
zerotal

Documentation


Documentation / @zerotal/monitor / MonitorConfigShape

Interface: MonitorConfigShape

Defined in: monitor/src/config.ts:14

Extended by

Properties

path?

optional path?: string

Defined in: monitor/src/config.ts:16

URL prefix the panel mounts at. Default: /monitor.


title?

optional title?: string

Defined in: monitor/src/config.ts:18

Browser tab title / sidebar heading. Default: Super Panel.


subtitle?

optional subtitle?: string

Defined in: monitor/src/config.ts:20

Sub-label under the title. Default: Zerotal Ops.


auth?

optional auth?: (user) => boolean | Promise<boolean>

Defined in: monitor/src/config.ts:25

Authorization gate. Receives the authenticated user (or undefined) and must return true to allow access. Default: allow only outside production.

Parameters

user

unknown

Returns

boolean | Promise<boolean>


record?

optional record?: boolean

Defined in: monitor/src/config.ts:27

Install the recorder middleware to capture live request data. Default: true.


refreshMs?

optional refreshMs?: number

Defined in: monitor/src/config.ts:29

Auto-refresh cadence in milliseconds while "Live" is on. Default: 3000.


apdexTargetMs?

optional apdexTargetMs?: number

Defined in: monitor/src/config.ts:31

Apdex satisfaction threshold (T) in ms. Default: 100.


slowQueryMs?

optional slowQueryMs?: number

Defined in: monitor/src/config.ts:33

Queries at/above this many ms count as "slow". Default: 100.


slowRequestMs?

optional slowRequestMs?: number

Defined in: monitor/src/config.ts:35

Requests at/above this many ms count as "slow" (Slow Requests widget). Default: 1000.


capturePayloads?

optional capturePayloads?: boolean

Defined in: monitor/src/config.ts:42

Capture request/response headers and bodies on each request (Telescope-style), shown in the request trace. Off by default — it buffers bodies and is privacy-sensitive. Sensitive headers (authorization/cookie) and body keys (password/token/secret/…) are redacted automatically.


payloadMaxBytes?

optional payloadMaxBytes?: number

Defined in: monitor/src/config.ts:44

Truncate captured request/response bodies to this many bytes. Default: 65536.


snapshotCacheMs?

optional snapshotCacheMs?: number

Defined in: monitor/src/config.ts:50

Cache built snapshots for this many ms, keyed by range, so overlapping reads (panel poll + Prometheus scrape + alert loop) share one build. Mutating actions invalidate it. Default: 1000. Set 0 to always build fresh.


storage?

optional storage?: string

Defined in: monitor/src/config.ts:56

SQLite file the panel persists to, so history survives restarts and the 1h/24h/7d ranges trace real data. Default: storage/monitor.sqlite. Use :memory: for an ephemeral, in-process store.


retentionDays?

optional retentionDays?: number

Defined in: monitor/src/config.ts:58

Days of history to keep before pruning. Default: 7.


retentionMode?

optional retentionMode?: RetentionMode

Defined in: monitor/src/config.ts:60

What to do with data past retention: delete it or archive it. Default: delete.


metrics?

optional metrics?: boolean

Defined in: monitor/src/config.ts:67

Expose a Prometheus text-exposition endpoint. Default: false (opt-in). The endpoint is unauthenticated (a scraper can't satisfy user-auth), so it ships off; enable it only when you protect metricsPath at the network layer (firewall/ingress) or scope it to a private interface.


metricsPath?

optional metricsPath?: string

Defined in: monitor/src/config.ts:69

Path for the Prometheus endpoint. Default: /metrics. Protect it at the network layer.


alerts?

optional alerts?: boolean

Defined in: monitor/src/config.ts:71

Evaluate threshold alerts on a short interval. Default: true.


alertThresholds?

optional alertThresholds?: AlertThresholds

Defined in: monitor/src/config.ts:73

Alert thresholds (error rate, queue backlog, p95, rollbacks).


alertCooldownMs?

optional alertCooldownMs?: number

Defined in: monitor/src/config.ts:79

Minimum gap (ms) before the same alert can fire again after it recovers and re-breaches. Stops an oscillating metric from re-paging / re-flooding the feed for one ongoing issue. Default: 30 min. Set 0 to fire on every fresh breach.


alertWebhook?

optional alertWebhook?: string

Defined in: monitor/src/config.ts:86

Slack-compatible webhook URL. When set, every newly-firing alert is POSTed to it as JSON ({ text, level, title, detail }) so alerts page someone instead of only lighting up the panel. Dependency-free (uses fetch); delivery is best-effort. For richer routing, register a handler with onAlert() instead.


accent?

optional accent?: string

Defined in: monitor/src/config.ts:88

Accent colour (hex) for the panel chrome. Default: Zerotal orange.


zerotalVersion?

optional zerotalVersion?: string

Defined in: monitor/src/config.ts:90

Version string shown in the System footer.


region?

optional region?: string

Defined in: monitor/src/config.ts:92

Region label shown in the System footer.


deploy?

optional deploy?: string

Defined in: monitor/src/config.ts:94

Deploy SHA shown in the System footer.


sections?

optional sections?: Record<string, boolean>

Defined in: monitor/src/config.ts:100

Switch contributed sections off by id — { scheduler: false } keeps the scheduler installed but drops its section from the panel. Anything absent here is on.