> ## Documentation Index
> Fetch the complete documentation index at: https://cpaas.fireflo.au/llms.txt
> Use this file to discover all available pages before exploring further.

# Diagnostics

> How staff read every OMNI service's log lines and the background workers' state in the panel, what is kept and for how long, and who may see it.

**Platform → Diagnostics** answers **"what is the server doing, and what went wrong?"**
without a shell on the server. It has three views, **Logs**, **Celery** and **Charts**,
each over **Live**, **1 hour**, **24 hours** or **7 days**.

**Who can use it:** staff whose [Team level](https://cpaas.fireflo.au/operators/team.md#levels) includes the
**Diagnostics** area: **Owner** and **Admin**. Each log download and each log search is
written to [Activity](https://cpaas.fireflo.au/operators/team.md#activity); a search for a number is kept as "a
number ending 4412".

## Logs

![Diagnostics on its Logs view with the sources on the left and log lines by time, level and service.](https://mintcdn.com/fire-flo-omno/PE0OUbPWjBA9XF0k/images/shots/operators-diagnostics-light.webp?fit=max\&auto=format\&n=PE0OUbPWjBA9XF0k\&q=85\&s=e3e5c4a8814f9e52a496fdff75954c0b)

Logs: the sources on the left, and the lines by time, level and service.

* **Sources**, down the left: **Everything**, then each module (every battery, channel
  and plugin, and the core) and each service, with how many lines each has.
* **Level**: **All**, **Errors**, **Warnings** or **Info**, each with its count.
* **Search the lines** for a task, an id or any text, and narrow them to **one
  customer**.
* Each line shows its time, level, service and text. A line opens with its traceback.
* **Live** follows new lines as they are written. Lines from several services are listed
  newest first.

## Celery

![The tasks view: workers, task runs and failures, and the schedule with each job's last run.](https://mintcdn.com/fire-flo-omno/PE0OUbPWjBA9XF0k/images/shots/operators-diagnostics--tasks-light.webp?fit=max\&auto=format\&n=PE0OUbPWjBA9XF0k\&q=85\&s=35b39807fd9e5e7086a609771071afa1)

Celery: the worker pools, the tasks of the last hour, and the schedule.

The background workers at a glance:

* **Figures**: workers up, tasks running now, tasks waiting, and failures in the period
  out of how many runs.
* **Workers**: each pool, read from its own heartbeat, with its state (**Up**, **Down**
  or **Not seen**), how many tasks it is running and how many wait.
* **Tasks**, by module: each task with its runs, its failures and its average time.
* **The schedule**: each periodic job under its own name, with its last and next run.
* **Recent failures**.

## What is kept

Every OMNI service writes its log lines, tagged with the module, the task and the
customer, to a folder on the server, as well as to its usual log.

* **7 days, and at most 200 MB in all.**
* **Secrets are masked** before a line is written: passwords, tokens and keys. Masking
  goes by a value's shape and the name in front of it, so a bare key with no name before
  it, or a token inside an address, is not masked. The value after "code" is masked too,
  so "Error code: 0x45" loses its value in the kept lines.
* **Only the service user and its group** can read the kept files.
* **One server.** Diagnostics shows the lines kept on the server it runs on.

## Optional settings

Set on the server; none has to be added.

| Setting | What it does | Default |
| :- | :- | :- |
| `OMNI_DIAG_ENABLED` | Whether the services keep lines for Diagnostics. | on |
| `OMNI_DIAG_DIR` | The folder the lines are kept in. | `shared/logs/diag` in the install's folder |
| `OMNI_DIAG_LEVEL` | The lowest level kept. | `INFO` |
| `OMNI_DIAG_DAYS` | Days lines are kept. | 7 |
| `OMNI_DIAG_MAX_MB` | The most the kept lines may take, in MB. | 200 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.