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

# Quickstart — Docker Agent

> Monitor Celery with zero code changes using the Sluice Go agent.

By the end of this guide, the Sluice agent will be reading events from your Redis broker and forwarding them to the dashboard — without modifying a single line of your application code.

## Prerequisites

* Docker (or any container runtime)
* A Redis instance used as your Celery broker
* A [Sluice account](https://sluice.sh/signup) (free, no credit card required)

## 1. Create a connection

Sign in to the [Sluice dashboard](https://sluice.sh) and go to **Connections**. Click **Add Connection**, pick "Docker Agent", and name your connection (e.g., "Production Celery"). You'll receive:

* An **API key** — starts with `sk_`
* A **Connection ID** — a UUID that identifies this connection

Copy both values.

## 2. Run the agent

```bash theme={null}
docker run -d \
  --name sluice-agent \
  -e SLUICE_API_KEY=sk_live_... \
  -e SLUICE_API_URL=https://sluice.sh/api \
  -e SLUICE_CONNECTION_ID=550e8400-e29b-41d4-a716-446655440000 \
  -e SLUICE_REDIS_URL=redis://your-redis:6379/0 \
  ghcr.io/sluice-sh/agent:v0.1.0
```

That's it. One command.

## 3. Verify the connection

Check the agent logs to confirm it connected:

```bash theme={null}
docker logs sluice-agent
```

You should see:

```
sluice-agent | Connecting to Redis at redis://your-redis:6379/0
sluice-agent | Detected framework: celery
sluice-agent | Subscribed to celery events stream
sluice-agent | Forwarding events to Sluice API
```

## 4. See your data

Open the [Sluice dashboard](https://sluice.sh). Jobs from your Celery workers will appear in real time.

## How the agent works

The Go agent connects directly to your Redis broker and:

1. **Subscribes to Celery events** — listens on `celeryev.*` PUB/SUB channels for task and worker events.
2. **Polls queue depths** — reads queue lengths via `LLEN` on queue keys.
3. **Reads queue topology** — scans `_kombu.binding.*` keys to discover which queues exist.
4. **Normalizes and forwards** — converts Celery events to Sluice's unified model and batches them to the Sluice API.
5. **Reconnects automatically** — if Redis goes down, the agent retries with exponential backoff and resumes when it comes back.

<Warning>
  **Celery events must be enabled.** The agent reads events from Redis PUB/SUB, but Celery disables events by default. Add these settings to your Celery config:

  ```python theme={null}
  worker_send_task_events = True
  task_send_sent_event = True
  task_track_started = True
  ```

  The [Python SDK](/quickstart/sdk) enables these automatically — the agent cannot, since it doesn't modify your application.
</Warning>

<Warning>
  **The Docker agent requires a Redis broker.** RabbitMQ is not supported by the agent in V0. The agent reads Celery events from Redis PUB/SUB channels and polls queue depths via Redis commands — none of which apply to AMQP brokers. If your Celery deployment uses RabbitMQ, use the [Python SDK](/quickstart/sdk) instead.
</Warning>

## Kubernetes deployment

For production Kubernetes clusters, deploy the agent as a single-replica Deployment:

```yaml theme={null}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: sluice-agent
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sluice-agent
  template:
    metadata:
      labels:
        app: sluice-agent
    spec:
      containers:
        - name: sluice-agent
          # Pin to a specific version — avoid :latest in production
          image: ghcr.io/sluice-sh/agent:v0.1.0
          env:
            - name: SLUICE_API_KEY
              valueFrom:
                secretKeyRef:
                  name: sluice-secrets
                  key: api-key
            - name: SLUICE_API_URL
              value: https://sluice.sh/api
            - name: SLUICE_CONNECTION_ID
              valueFrom:
                secretKeyRef:
                  name: sluice-secrets
                  key: connection-id
            - name: SLUICE_REDIS_URL
              value: redis://redis-master:6379/0
```

<Tip>
  Run one agent per Redis instance. If your Celery workers use multiple Redis databases or instances, deploy one agent for each.
</Tip>

## SDK vs Agent — which to choose

|                                   | Python SDK                      | Docker Agent                    |
| --------------------------------- | ------------------------------- | ------------------------------- |
| **Code changes**                  | 2 lines                         | None                            |
| **Auto-configures Celery events** | Yes                             | No (manual config needed)       |
| **Data richness**                 | Highest (in-process access)     | High (Redis events + key reads) |
| **Deployment**                    | In your Celery worker process   | Separate container              |
| **Best for**                      | App developers who own the code | Platform/DevOps teams           |

## Next steps

* [Agent Configuration Reference](/agent/configuration) — all environment variables and defaults
* [Troubleshooting](/troubleshooting/no-data) — if jobs aren't appearing
* [Connection Issues](/troubleshooting/connection-issues) — Redis connectivity problems
* [REST API Reference](/api/overview) — programmatic access to your data
