datadog-agent/doc/reference/components/status.md
Ofek Lev 47e5a39d12
Move dev docs to a dedicated root directory (#56908)
### What does this PR do?

Moves the maintained Datadog Agent developer documentation from `docs/public/` to `doc/`, together with its site support files. Published page URLs stay the same.

### Motivation

AI coding agents use repository documentation to guide their changes. Moving maintained guidance into `doc/` gives them one directory to consult, with unfinished and deprecated pages kept in `docs/` until they are reviewed for incorporation or removal.

### Describe how you validated your changes

```text
$ dda run docs build
Syncing dependencies
Build started
No issues found
Build finished in 3.80s

$ dda run docs check-links
🔍 6852 Total (in 973ms) 🔗 989 Unique ✅ 6566 OK 🚫 0 Errors 👻 200 Excluded ⛔ 86 Unsupported


$ dda inv linter.docs-links
Synchronizing dependencies
The documentation references this repository properly

$ dda inv invoke-unit-tests.run --tests=docs_repo_links,docs_links
Synchronizing dependencies
................................
----------------------------------------------------------------------
Ran 32 tests in 0.087s

OK
...
----------------------------------------------------------------------
Ran 3 tests in 0.024s

OK
Running tests from module docs_repo_links_tests

Running tests from module docs_links_tests
```

### Additional Notes

`docs/README.md` lists every retained page and its reason. Unpublished pages, deprecated component guidance, and empty placeholders remain temporarily while their content is reviewed for removal or incorporation.

Co-authored-by: ofek.lev <ofek.lev@datadoghq.com>
2026-09-25 15:18:19 +00:00

2.5 KiB

Status provider reference

Components can register a status provider. When the status command is executed, we will populate the information displayed using all the status providers.

Status Providers

There are two types of status providers:

  • Header Providers: these providers are displayed at the top of the status output. This section is reserved for the most important information about the agent, such as agent version, hostname, host info, or metadata.
  • Regular Providers: these providers are rendered after all the header providers.

Each provider has the freedom to configure how they want to display their information for the three types of status output: JSON, Text, and HTML. This flexibility allows you to tailor the output to best suit your component's needs.

The JSON and Text outputs are displayed within the status CLI, while the HTML output is used for the Agent GUI.

To guarantee consistent output, we order the status providers internally. The ordering mechanism is different depending on the status provider. We order the header providers based on an index using the ascending direction. The regular providers are ordered alphabetically based on their names.

Header Providers Interface

type HeaderProvider interface {
    // Index is used to choose the order in which the header information is displayed.
    Index() int
    // Name is rendered as a header in text output.
    Name() string
    JSON(verbose bool, stats map[string]interface{}) error
    Text(verbose bool, buffer io.Writer) error
    HTML(verbose bool, buffer io.Writer) error
}

Regular Providers Interface

// Provider supplies a regular status section.
type Provider interface {
    // Name is used to sort the status providers alphabetically.
    Name() string
    // Section is used to group the status providers.
    // Section is rendered as a header in text output.
    Section() string
    JSON(verbose bool, stats map[string]interface{}) error
    Text(verbose bool, buffer io.Writer) error
    HTML(verbose bool, buffer io.Writer) error
}

Rendering helpers

The status component provides helper functions to create status providers: NewInformationProvider and NewHeaderInformationProvider.

The RenderText and RenderHTML helpers render text and HTML output. Both accept the following arguments:

(templateFS embed.FS, template string, buffer io.Writer, data any)

See adding a status provider for registration, templates, and testing.