Skip to content

metrics: runtime failures become a successful empty or partial fleet #81

Description

@sweetcornna

What happened

POST /listSandboxMetrics catches every rejection from executor.metrics() and removes that sandbox from the response. The documented skip case is a container that vanished during measurement, but the catch-all also swallows Docker daemon outages, docker stats failures, mount/statfs failures, and other accounting errors.

Focused reproduction:

  1. Acquire one active sandbox in a route test.
  2. Replace executor.metrics with a rejection such as Error('dockerd unavailable').
  3. Call POST /listSandboxMetrics.

Expected: An unrelated runtime failure should produce an error response, or an explicit per-sandbox error representation. Only the narrow vanished-container race should be omitted.

Actual: The endpoint responds HTTP 200 with samples: []. With more sandboxes it returns a silently partial fleet.

Impact: Monitoring clients cannot distinguish an unhealthy Docker/runtime host from a healthy host with no measurable sandboxes, so outages can look like successful empty telemetry.

Relevant code and contract:

  • packages/server/src/routes/sandboxes.ts:455-487 catches all metrics errors and filters them to null.
  • packages/shared/src/metrics.ts:46-52 reserves absence for non-measurable or vanished containers.
  • packages/server/src/executor/docker.ts:533-577 shows other fallible operations covered by the same catch, including Docker stats and filesystem accounting.
  • packages/server/src/routes/observability.test.ts:686-699 verifies only the narrow vanished-container case.
  • website/content/docs/metrics.mdx:42-54 describes the endpoint as answering for the whole measurable fleet.

dor doctor output

Not applicable: the defect is an API error-classification path. A Docker outage may also be visible to Doctor, but this endpoint still returns success.

Environment

  • Dormice commit: 4417ae14938273f5d937c476cf7cdc57e22e53a5
  • API route: POST /listSandboxMetrics
  • Verification: focused route behavior with a rejected metrics provider, plus source-path inspection

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions