Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 64 additions & 1 deletion docs/installation/advanced/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Currently, the following SeaTable components expose metrics in a [Prometheus](ht
- dtable-db
- caddy

In addition, **Gunicorn** and **NGINX** can be configured to expose metrics in a different format. Exporters can be used to transform these into a Prometheus-compatible format.
In addition, **Gunicorn**, **NGINX** and **Redis** can be configured to expose metrics in a different format. Exporters can be used to transform these into a Prometheus-compatible format.

## SeaTable Components

Expand Down Expand Up @@ -391,6 +391,69 @@ curl -sS http://127.0.0.1:9113/metrics
```
</details>

### Redis

[`redis_exporter`](https://github.com/oliver006/redis_exporter) must be deployed alongside your Redis instance in order to expose the built-in Redis metrics in a Prometheus-compatible format.
You can use the following `redis-exporter.yml` file to get started:

```yaml
services:
redis-exporter:
image: oliver006/redis_exporter:v1.86.0
container_name: redis-exporter
restart: unless-stopped
environment:
- REDIS_ADDR=redis://redis:6379
- REDIS_PASSWORD=${REDIS_PASSWORD:?Variable is not set or empty}
networks:
- o11y-net
ports:
- 127.0.0.1:9121:9121

# redis-exporter needs to access Redis
redis:
networks:
- o11y-net

networks:
o11y-net:
name: o11y-net
```

Remember to add `redis-exporter.yml` to the `COMPOSE_FILE` variable and start the exporter by running the following command:

```bash
docker compose up -d
```

You can test the metrics endpoint by running the following command on the host:

```bash
curl -sS http://127.0.0.1:9121/metrics
```

<details>
<summary>Example Output</summary>
```text
# HELP redis_commands_total Total number of calls per command
# TYPE redis_commands_total counter
redis_commands_total{cmd="auth"} 85122
redis_commands_total{cmd="client|setinfo"} 290
redis_commands_total{cmd="client|setname"} 116
redis_commands_total{cmd="command"} 0
redis_commands_total{cmd="command|docs"} 1
redis_commands_total{cmd="config|get"} 115
redis_commands_total{cmd="del"} 495856
redis_commands_total{cmd="exec"} 31
redis_commands_total{cmd="exists"} 13771
redis_commands_total{cmd="expire"} 155
redis_commands_total{cmd="get"} 6.876658e+06
redis_commands_total{cmd="hello"} 127
redis_commands_total{cmd="incrby"} 4
redis_commands_total{cmd="info"} 124
```
</details>

### Caddy

[Caddy](https://caddyserver.com/) natively supports exposing metrics in a Prometheus-compatible format. Since SeaTable uses [caddy-docker-proxy](https://github.com/lucaslorentz/caddy-docker-proxy), metrics can be enabled by adding Docker labels to the Caddy service.
Expand Down
Loading