packages feed

shibuya-metrics-0.11.0.0: CHANGELOG.md

# Changelog

## 0.11.0.0 — 2026-10-25

### Breaking Changes

- `MetricsServerConfig` gains `enableControl`, `corsAllowedOrigins`,
  `wsMaxQueuedFrames`, `wsMaxQueuedBytes`, and `wsSendTimeoutUs`; direct construction
  must supply them. `MetricsServer` gains the required `serverShutdown` action.
- `ServerMessage` gains `ServerError`; exhaustive matches must handle it.
  `ProcessorHealth` gains `paused`; direct construction must supply the count.
- Require `shibuya-core ^>=0.11.0.0`, including its extended processor metrics and
  paused-state API.

### New Features

- Add opt-in control discovery and pause/resume POST routes with structured errors,
  draining refusal, and actual-request Origin enforcement. Control is disabled by
  default. Export `Shibuya.Metrics.Control`.
- Expose optional latency, oldest in-flight, and bounded acknowledged progress in
  JSON and WebSocket metrics. Add the processing-duration Prometheus histogram and
  optional oldest-in-flight gauge; report paused health counts and state value 5.
- Bound queued WebSocket frames and encoded bytes with independent sampling and a
  single application writer. Recover dropped deltas with an adjacent
  `queue_overflow` error and replacement snapshot; bound sends and shutdown flushes.
- Export the pure `Shibuya.Metrics.Outbound` queue model and optional
  `WebSocketHooks` instrumentation. Subscription changes establish ordered snapshots.
- Send in-band WebSocket errors for malformed messages and before subscription-limit
  policy closes; expose stable `code` members in HTTP error responses.
- Add configurable HTTP CORS and preflight handling, and validate WebSocket upgrade
  Origins before acquiring connection slots. Export `Shibuya.Metrics.Cors` and
  `Shibuya.Metrics.Error` with reusable middleware and error helpers.

### Bug Fixes

- Suspend deltas after terminal-frame admission evicts updates so the next update
  establishes a replacement snapshot.

### Other Changes

- Bound the observer-load executable's `streamly-core` dependency to `^>=0.3`,
  matching the range already required by `shibuya-core`.
- Avoid waking WebSocket writers for empty terminal batches and make observer
  captures reproducible with bounded delivery acceptance evidence.

## 0.10.0.1 — 2026-10-05

### Other Changes

- Advance the shared release version and require shibuya-core 0.10.0.1, which admits random 1.3.

## 0.10.0.0 — 2026-09-21

### Breaking Changes

- `MetricsServerConfig` and `HealthConfig` gain `dependencyTimeoutMicros`; direct record
  construction must choose a per-check deadline. `ReadinessStatus` gains `application`, and
  its JSON object gains the corresponding lifecycle status field.
- `MetricsServerConfig` gains `host` and `wsMaxSubscriptions`. The built-in server now
  defaults to loopback instead of all interfaces, validates resource limits, and bounds
  retained WebSocket processor selections and exclusions.
- The processing-state JSON object gains `lastProgress`, paired with the new third field of
  `shibuya-core`'s `ProcessorState.Processing` constructor.
- `ServerMessage` gains `ProcessorTerminal`, with the new public
  `ProcessorTerminalStatus` type, and the exposed `WebSocketState` record gains a shutdown
  cell. Exhaustive matches and direct record construction must handle these additions.

### New Features

- Export `combinedApp` so callers can mount the unified metrics WAI application on
  an externally managed server.
- Send an additive `terminal` WebSocket frame when a formerly visible processor leaves the
  live registry in a retained stopped or failed state.

### Other Changes

- Add `shibuya-metrics-test`, a release-gated Hspec suite covering every published
  HTTP route and WebSocket frame plus exact JSON and Prometheus golden contracts.
- Declare the generated `Paths_shibuya_metrics` test module and bound the wire-load
  executable's Effectful and NQE dependencies so `cabal check` accepts the source
  distribution.

### Bug Fixes

- Base stuck detection on sampled progress instead of burst age, retain failed configured
  processors after live metrics unregister, report stopped masters not live, and bound each
  dependency readiness check while normalizing its synchronous exceptions as unhealthy.
- Release WebSocket connection slots on every setup and connection exit, reject upgrades
  when WebSockets are disabled, support exclusions from subscribe-all, and deliver `goodbye`
  when server shutdown begins.
- Close WebSocket clients with policy code 1008 before their retained processor subscription
  or subscribe-all exclusion set can exceed `wsMaxSubscriptions`.

## 0.9.0.3 — 2026-09-20

Version bumped to track `shibuya-core` 0.9.0.3. The core dependency bound is
updated to `^>=0.9.0.3`; no user-visible changes to `shibuya-metrics` itself.

## 0.9.0.2 — 2026-09-19

Version bumped to track `shibuya-core` 0.9.0.2. The core dependency bound is
updated to `^>=0.9.0.2`; no user-visible changes to `shibuya-metrics` itself.

## 0.9.0.1 — 2026-09-15

Version bumped to track `shibuya-core` 0.9.0.1. The core dependency bound is
updated to `^>=0.9.0.1`; no user-visible changes to `shibuya-metrics` itself.

## 0.9.0.0 — 2026-08-10

Version bumped to track `shibuya-core` 0.9.0.0. The core dependency bound is
updated to `^>=0.9.0.0`; no user-visible metrics API changes.

## 0.8.0.1 — 2026-07-04

Version bumped to track `shibuya-core` 0.8.0.1. No user-visible changes
to `shibuya-metrics` itself.

## 0.8.0.0 — 2026-07-04

### Breaking Changes

- Version bumped to track `shibuya-core` 0.8.0.0.
- The Prometheus endpoint no longer emits
  `shibuya_messages_dropped_total`; `shibuya-core` removed the always-zero
  `StreamStats.dropped` counter.
- Internal imports moved from `Shibuya.Runner.Master` and
  `Shibuya.Runner.Metrics` to the new public paths `Shibuya.App` and
  `Shibuya.Core.Metrics`. Application code using `shibuya-metrics` through
  `Shibuya.Metrics` does not need to change.

## 0.7.1.0 — 2026-06-15

Version bumped to track `shibuya-core` 0.7.1.0. No user-visible changes
to `shibuya-metrics` itself.

## 0.7.0.0 — 2026-06-05

Version bumped to track `shibuya-core` 0.7.0.0. No user-visible changes
to `shibuya-metrics` itself.

## 0.6.0.0 — 2026-05-31

Version bumped to track `shibuya-core` 0.6.0.0. No user-visible changes
to `shibuya-metrics` itself.

## 0.5.0.0 — 2026-05-05

Version bumped to track `shibuya-core` 0.5.0.0. No user-visible changes
to `shibuya-metrics` itself.

## 0.4.0.0 — 2026-04-29

Version bumped to track `shibuya-core` 0.4.0.0. No user-visible changes
to `shibuya-metrics` itself.

## 0.3.0.0 — 2026-04-24

Version bumped to track `shibuya-core` 0.3.0.0. No user-visible changes
to `shibuya-metrics` itself.

## 0.2.0.0 — 2026-04-22

Version bumped to track `shibuya-core` 0.2.0.0. No user-visible changes
to `shibuya-metrics` itself.

## 0.1.0.0 — 2026-02-24

Initial release.

### New Features

- HTTP/JSON metrics endpoint
- Prometheus metrics endpoint
- WebSocket streaming metrics endpoint
- Kubernetes-compatible health check endpoints