# production-adapters

Production adapter examples keep default verification offline while offering explicit external checks for real dependencies.

## Local external integration stack

Use the dedicated external stack when validating production adapters locally:

```bash
docker compose -f examples/production-adapters/docker-compose.external.yml config
scripts/external-integration.sh redis etcd otlp pyroscope mysql postgres
scripts/external-integration.sh kubernetes
```

`docker-compose.external.yml` starts Redis, etcd, OTLP collector, Pyroscope, MySQL, and PostgreSQL with non-default local ports and health checks. Kubernetes uses KinD through `scripts/external-integration.sh`, not Docker Compose. The non-default ports avoid conflicts with locally running etcd or Redis.

Set `RS_ZERO_SKIP_CLEANUP=1` to keep containers or the KinD cluster for diagnostics.

## Direct ignored tests

```bash
RS_ZERO_TEST_REDIS_URL=redis://127.0.0.1:16379 \
  cargo test --features cache-redis --test cache_integration redis_store_talks_to_external_redis -- --ignored

RS_ZERO_ETCD_ENDPOINT=http://127.0.0.1:12379 \
  cargo test --no-default-features --features discovery-etcd --test discovery_etcd_external -- --ignored

RS_ZERO_KUBE_EXTERNAL=1 RS_ZERO_KUBE_CONTEXT=kind-rs-zero-external \
  cargo test --no-default-features --features discovery-kube --test discovery_kube_external -- --ignored

RS_ZERO_OTLP_ENDPOINT=http://127.0.0.1:14318 \
  cargo test --no-default-features --features observability,otlp --test observability_otlp_external -- --ignored

RS_ZERO_PYROSCOPE_ENDPOINT=http://127.0.0.1:14040 \
  cargo test --no-default-features --features profiling --test profiling_pyroscope_external -- --ignored

RS_ZERO_MYSQL_URL=mysql://rs_zero:rs_zero@127.0.0.1:13306/rs_zero \
  cargo test --no-default-features --features db-mysql --test db_external mysql_external_pool_lifecycle -- --ignored

RS_ZERO_POSTGRES_URL=postgres://rs_zero:rs_zero@127.0.0.1:15432/rs_zero \
  cargo test --no-default-features --features db-postgres --test db_external postgres_external_pool_lifecycle -- --ignored
```

## Covered adapters

- Real etcd v3 discovery registry with lease keep-alive, watch, health update, and deregistration.
- Kubernetes EndpointSlice discovery watcher with fixture mapper for offline tests and KinD external validation.
- OTLP traces exporter with real collector flush/shutdown validation.
- SQLx SQLite, MySQL, and PostgreSQL database pools with external MySQL/PostgreSQL lifecycle tests.
- Cache trait, in-memory backend, and Redis adapter facade with external Redis validation.
- Pyroscope profiling adapter with external agent startup and shutdown validation.

More CI details are documented in [External integration CI](../../docs/external-integration-ci.md).
