oxidecomputer / oxidecomputer/omicron

sled agent could better expose information about what it's currently doing

Open
#1,881 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Debugging Sled Agent
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

I realize this is pretty vague, and may turn into a project or just a bunch of more targeted tickets.

Under #1880, when we hit #1879, we spent kind of a while just trying to figure out what was currently going on. It would have been pretty helpful if we'd been able to query the Sled Agent process and see:

  • RSS's state: it had found a pre-existing plan and was attempting to resume executing it
  • that RSS was waiting on a specific bootstrap agent request
  • that the bootstrap agent request was in a retry loop

You can figure a bunch of this out from the log, the code, and a lot of reasoning. It's just time-consuming and error-prone.

I've had some success with past systems having an endpoint for fetching state specifically for debugging. In this case we could report state like:

"subsystems": {
    "rss": {
        "plan": "found", /* alternatively: "uninitialized", "created" */
        "steps": [ {
                "name": "do_the_things",
                "started": $timestamp,
                "done": $timestamp,
                "result": "success",
        }, ..., {
                "name": "initialize_agents",
                "started": $timestamp,
                "attempts": 27,
                "last_attempt": $timestamp,
                "next_attempt": $timestamp,
                "last_attempt_result": { "error": "Sled Agent already initialized" }
        } ]
    }
}

At Joyent we had composable libraries that would emit the pieces of this. For example vasync was a control flow library that emitted something like the "steps" field above. An analog for us might be to have a function that takes a FuturesOrdered and produces the "steps" output above or something like that? The idea was to make this available in a common way and queryable via a single tool like kang, although we didn't wind up doing much with kang. (We did wind up putting all this into some dashboards that were very useful.)

Thoughts?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Sled Agent, RSS, and bootstrap agent behavior alongside the existing logs and the FuturesOrdered discussion. The issue does not name files or tests; the intended outcome is a queryable debugging state that reports subsystem progress, waiting requests, retries, timestamps, and results through a common tool or endpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.