> For the complete documentation index, see [llms.txt](https://docs.umh.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umh.app/usage/unified-namespace/redpanda.md). Agents can also search and read this documentation through its [MCP server](https://docs.umh.app/~gitbook/mcp).

# Redpanda

Redpanda is the message broker inside the UMH Core container, and it uses the Kafka protocol. It stores the messages of the [Unified Namespace](https://docs.umh.app/usage/unified-namespace.md) in the Kafka topic `umh.messages`. The [Topic Browser](https://docs.umh.app/usage/unified-namespace/topic-browser.md) reads the Unified Namespace topics from the messages in `umh.messages`. Redpanda also runs the schema registry on port 8081, which holds the schemas of your data models and data contracts.

umh-core starts one Redpanda inside the container and restarts it when it fails. Redpanda keeps its data in `/data/redpanda`.

## Redpanda states

Redpanda is always in one of the states below. The **Redpanda** card on the instance details page in the Management Console shows the state as a badge. The badge tooltip shows the reason for the state.

| State      | Meaning                                                                                                                       | Badge                                                   |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| `starting` | Redpanda is starting. umh-core waits for the log line `Successfully started Redpanda!` and for the schema registry to answer. | Neutral                                                 |
| `idle`     | Redpanda runs. No messages were written to it or read from it recently.                                                       | Active                                                  |
| `active`   | Redpanda runs, and messages are written to it or read from it.                                                                | Active                                                  |
| `degraded` | One of the checks in [When Redpanda is degraded](#when-redpanda-is-degraded) failed.                                          | Degraded                                                |
| `stopping` | Redpanda is shutting down.                                                                                                    | Neutral                                                 |
| `stopped`  | Redpanda does not run.                                                                                                        | Stopped when Redpanda is set to stop, otherwise Neutral |

An idle Redpanda shows the Active badge. Its tooltip starts with `idle: no input bytes activity`. This is normal for an instance that has no data flows yet.

## When Redpanda is degraded

The badge tooltip starts with `degraded:`, a space and the reason. umh-core runs the checks in the order of this table and shows the reason of the first check that fails. The two `found error` rows are one check, which shows the earliest matching log line. Redpanda returns to `idle` once no check fails.

| Reason                                                                         | What it means                                                                                                                | What to do                                                                                                                      |
| ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `s6 is not running, current state: <state>`                                    | The Redpanda process is not running. umh-core restarts it, and the reason changes to `degraded: restarting service`.         | Select **Logs** on the Redpanda card to see why the process stopped.                                                            |
| `healthchecks did not pass, live: false, ready: false`                         | Redpanda does not report itself as ready. Both values come from the same readiness check. They are therefore always equal.   | Read the Redpanda logs.                                                                                                         |
| `found error (clears in <time>): <log line>` with `Address already in use`     | Another process holds a port that Redpanda needs, such as 9092 or 9644.                                                      | Stop the other process. If the container shares the host network, check which host process uses the port.                       |
| `found error (clears in <time>): <log line>` with `Reactor stalled for <n> ms` | Redpanda was blocked for more than 500 milliseconds and processed nothing in that time.                                      | Check [CPU Health](https://docs.umh.app/usage/instances/container/cpu-health.md). Give the container more CPU or a faster disk. |
| `Redpanda storage free space alert: <free> free bytes (total: <total> bytes)`  | Redpanda reports that its disk is nearly full.                                                                               | Free disk space, enlarge the disk, or shorten the retention. See [Disk](https://docs.umh.app/production/sizing-guide.md#disk).  |
| `Redpanda unavailable topics: <n>`                                             | Redpanda cannot serve `<n>` partitions. A partition is one part of a Kafka topic.                                            | Read the Redpanda logs to find the cause.                                                                                       |
| `unexpected restarts within the last hour: [<exit codes>]`                     | The Redpanda process exited with an error at least once in the last hour. The reason stays for one hour after the last exit. | Read the Redpanda logs around the time of the exit.                                                                             |

A `found error` reason stays for 10 minutes after the log line. The `clears in` value counts down that time. Only the two log lines in the table cause this reason. A `Reactor stalled` line counts only after Redpanda has started.

## Redpanda card

The Redpanda card on the instance details page shows the state badge, the throughput, and two buttons.

| Field                   | Shows                                                                                                                                             |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Incoming Throughput** | Bytes per second written to Redpanda, averaged over a time window. The unit is B/s, KiB/s, MiB/s or a larger binary unit, depending on the value. |
| **Outgoing Throughput** | Bytes per second read from Redpanda, averaged over the same window. The unit scales the same way.                                                 |
| **Logs**                | Opens the Redpanda log.                                                                                                                           |
| **Metrics**             | Opens the Redpanda Metrics page.                                                                                                                  |

The Redpanda Metrics page shows a table with the columns Path, Name and Value. Select **Refresh** to load the current values.

| Path                     | Name                     | Value                                                                |
| ------------------------ | ------------------------ | -------------------------------------------------------------------- |
| `redpanda.storage`       | `disk_free_bytes`        | Free bytes on the disk that holds Redpanda's data.                   |
| `redpanda.storage`       | `disk_total_bytes`       | Size of that disk in bytes.                                          |
| `redpanda.storage`       | `disk_free_space_alert`  | `true` while Redpanda's low-disk alert is raised, otherwise `false`. |
| `redpanda.cluster`       | `topics`                 | Number of Kafka topics.                                              |
| `redpanda.cluster`       | `unavailable_partitions` | Number of partitions Redpanda cannot serve.                          |
| `redpanda.kafka`         | `request_bytes_in`       | Total bytes written to Redpanda since Redpanda started.              |
| `redpanda.kafka`         | `request_bytes_out`      | Total bytes read from Redpanda since Redpanda started.               |
| `redpanda.topic.<topic>` | `partitions`             | Number of partitions of that topic.                                  |

`request_bytes_in` and `request_bytes_out` are totals. umh-core computes the throughput on the card from the same totals.

## Reference

### Configuration

Redpanda's settings are under `internal.redpanda` in the [config file](https://docs.umh.app/usage/instances/config-file.md). The [configuration reference](https://docs.umh.app/reference/configuration-reference.md) lists them. To change how long Redpanda keeps messages, follow [Disk](https://docs.umh.app/production/sizing-guide.md#disk) in the sizing guide.

When umh-core starts without a config file, it creates one with the two settings in this table. Both are under `internal.redpanda.redpandaServiceConfig.topic`.

| Setting                     | Value       | Effect                                                   |
| --------------------------- | ----------- | -------------------------------------------------------- |
| `defaultTopicRetentionMs`   | `604800000` | Redpanda keeps messages for seven days.                  |
| `defaultTopicCleanupPolicy` | `delete`    | Redpanda deletes messages older than the retention time. |

umh-core applies a change to either setting to the running Redpanda. Neither needs a restart.

If your config file was created before umh-core started to write `defaultTopicCleanupPolicy`, it has no such setting, and Redpanda uses `compact`. Under `compact`, Redpanda keeps only the latest message per key once a segment of the topic closes. A segment closes after one hour by default. You cannot replay the older history of a topic then.

### Metrics

Redpanda serves its own metrics on its admin port 9644 at `/public_metrics`, which is inside the container and not published by default. Port 8080 has no series that Redpanda reports itself. It carries umh-core's own view of Redpanda, as standard [FSMv1 metrics](https://docs.umh.app/usage/instances/agent/metrics.md#fsmv1-metrics). [Metrics](https://docs.umh.app/usage/instances/agent/metrics.md) explains how to read them.

Redpanda has `component="redpanda_instance"` with `instance="redpanda"`. Its monitor, a separate process in the container that reads Redpanda's status once per second, has `component="redpanda_monitor"` with `instance="redpanda-redpanda"`. In Prometheus, write `exported_instance` for `instance`.

To alert when Redpanda is degraded, use:

```promql
umh_core_service_current_state{component="redpanda_instance"} == 5
```

The definitions are in [`pkg/metrics/metrics.go`](https://github.com/united-manufacturing-hub/united-manufacturing-hub/blob/staging/umh-core/pkg/metrics/metrics.go).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.umh.app/usage/unified-namespace/redpanda.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
