# Monitoring Object Storage

What you can watch for a bucket, from replication and emptying progress to what a bucket holds and the audit log.

Object Storage publishes no metrics or alarms of its own. What you can follow:

## Replication

The bucket's **Replication** tab, **Status** section: **State**, **Still to copy**, **Failed**,
**Oldest waiting**, **Last full comparison** and recent failures with their error; it refreshes
every 5 seconds while copying. Over the API, `GET /s3/api/buckets/{name}/replication` answers
`pending`, `failed`, `oldestPendingAt`, `lastFullScanAt` and `recentFailures`. On the S3 API,
reading an object of a replicating bucket answers `x-amz-replication-status` (`PENDING`,
`COMPLETED` or `FAILED`), and a replica answers `REPLICA`.

**Console**
Open the bucket, then choose **Replication**.

**CLI**
```sh
dcloud s3 bucket-replication get example-uploads
```

**API**
```http
GET /s3/api/buckets/example-uploads/replication
```

## Remote copy

For a bucket on a storage cluster, `dcloud s3 bucket-remote-copy get` answers `pendingKeys`
(written but not copied yet) and `failedKeys` (given up on after retries; the next hourly scan
copies them again).

## Emptying a bucket

A banner on every tab of the bucket shows how many entries are deleted and how many a second;
`dcloud s3 bucket-objects empty-status` answers the same.

## What a bucket holds

`dcloud s3 bucket-objects count` answers the objects, older versions, delete markers and bytes
under a prefix or in the bucket (at most 10,000 entries read; `complete: false` means a floor).
For buckets on your own hosts, the **Overview**'s **Storage** section shows what the bucket holds.

## Encryption key health

`GET /s3/api/buckets/{name}/encryption` answers whether the bucket's key is `usable` and, if not,
the `problem`. The **Encryption** tab then shows "The bucket’s KMS key cannot be used: reads and
writes are refused."

## Audit log

Writes, through the API and signed S3 requests alike, sensitive reads and refused requests are in
the audit log; unsigned (anonymous) requests have no principal and are not recorded (see
[Audit log](/docs/audit-log)).

## Related

- [Security](security.md)
- [Troubleshooting](troubleshooting.md)
