Skip to content

Commit 7da158d

Browse files
authored
Add Observability Stack and Comprehensive Documentation (#6)
* feat(observability): add Grafana and Prometheus monitoring stack - Add Prometheus service with Iggy metrics scraping (15s interval) - Add Grafana service with auto-provisioned datasource and dashboard - Configure Iggy server to expose /metrics endpoint - Create pre-built Iggy Overview dashboard with: - Server status indicator - HTTP request rate graph - Message throughput visualization - Request latency percentiles (p50, p95) - Active streams counter - Add shared Docker network for service discovery - Update CLAUDE.md with observability documentation Access points: - Iggy HTTP: localhost:3000 - Prometheus: localhost:9090 - Grafana: localhost:3001 (admin/admin) * feat(observability): add Iggy Web UI dashboard - Add apache/iggy-web-ui service on port 3050 - Configure Web UI to connect to Iggy HTTP API - Update documentation with Web UI access and features Web UI provides: - Streams and topics management - Message browsing and inspection - User management - Server health monitoring Access: http://localhost:3050 (iggy/iggy) * docs: add event-driven architecture guide and update README - Add comprehensive guide covering: - Streams, topics, and partitions explained - Partition keys and ordering guarantees - Consumer groups and scaling patterns - Message retention and expiry configuration - Error handling strategies (at-least-once, DLQ, idempotency) - Production patterns (outbox, saga, versioning) - Complete code examples for producers and consumers - CLI and HTTP API quick reference - Update README with: - Observability stack documentation (Grafana, Prometheus, Web UI) - Service access URLs and credentials - Architecture diagram with observability layer - Prometheus metrics and OpenTelemetry configuration - Link to new guide in documentation section * docs: add partitioning guide and enhance main guide - Add comprehensive partitioning-guide.md covering: - What partitions are and why they exist - The ordering problem and partition key solutions - Domain-specific partition key examples - Common partitioning mistakes and how to avoid them - Partition count guidelines and capacity planning - Consumer group rebalancing mechanics - Real-world scenario walkthroughs - Troubleshooting guide - Enhance docs/guide.md with educational details: - Add detailed Database struct explanation with SQL examples - Add database schema for idempotency pattern - Expand Outbox pattern with problem statement and solution - Add outbox table schema and publisher query examples - Add Further Reading references to external resources * docs: enhance partitioning guide with Iggy-specific details Add comprehensive Iggy-specific content to the partitioning guide: - Iggy Partitioning Strategies section: - Balanced (round-robin) strategy - Partition ID (direct assignment) strategy - Messages Key (hash-based) strategy with MurmurHash3 explanation - Comparison table and use case guidance - Iggy Partition Storage Architecture section: - Physical storage layout (streams/topics/partitions/segments) - Segment structure and benefits - Offset and time indexes explained - Index caching modes - Iggy Server Configuration section: - Partition settings (fsync, checksum, buffer thresholds) - Segment settings (size, expiry, caching, archival) - Topic settings (max_size, auto-delete) - Message deduplication options - Configuration trade-offs table - Custom Partitioners section: - Partitioner trait explanation - Example: Weighted partitioner for heterogeneous hardware - Example: Time-based partitioner for analytics - Example: Content-based priority partitioner - Integration with IggyClient - Enhanced Further Reading section: - Apache Iggy official resources - Distributed systems fundamentals - Related technologies (Kafka, MurmurHash, Cassandra) - Benchmarking resources * docs: add durable storage guide and documentation index - Add comprehensive durable storage guide covering: - Storage architecture (append-only log, segments) - Durability configuration (fsync settings, trade-offs) - Data retention policies (time-based, size-based) - Backup and archiving (disk, S3-compatible storage) - Recovery procedures and data integrity - Performance vs durability trade-offs - Production recommendations with config templates - Add docs/README.md as documentation index with: - Quick navigation by topic - Links to all available guides - External resources and references - Update README.md and CLAUDE.md to reference docs/ directory * chore: update dependencies * chore: add .claude/settings.local.json to gitignore * docs: update changelog for observability and documentation additions
1 parent 704a1c3 commit 7da158d

File tree

14 files changed

+3965
-86
lines changed

14 files changed

+3965
-86
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ fuzz/target/
3131
fuzz/corpus/
3232
fuzz/artifacts/
3333
fuzz/Cargo.lock
34+
35+
# local settings
36+
.claude/settings.local.json

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- **Observability Stack**: Complete Grafana-based monitoring setup
13+
- Prometheus metrics collection (port 9090) with 15-day retention
14+
- Grafana dashboards (port 3001) with pre-configured Prometheus datasource
15+
- Iggy Web UI integration (port 3050) for stream/topic/message management
16+
- Pre-built Iggy Overview dashboard (server status, request rates, throughput, latency)
17+
- **Documentation Guides**:
18+
- Event-driven architecture guide (`docs/guide.md`): streams/topics/partitions, consumer groups, error handling patterns, production patterns (outbox, saga, idempotency)
19+
- Partitioning guide (`docs/partitioning-guide.md`): partition keys, ordering guarantees, selection strategies
20+
- Durable storage guide (`docs/durable-storage-guide.md`): storage architecture, fsync configuration, S3 backup/archiving, recovery procedures
21+
- Documentation index (`docs/README.md`) with topic-based navigation
22+
23+
### Changed
24+
25+
- Updated `docker-compose.yaml` with full observability stack configuration
26+
- Simplified documentation section in README.md to reference `docs/` directory
27+
1028
## [0.1.0] - 2024-12-01
1129

1230
### Added

CLAUDE.md

Lines changed: 99 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ This application showcases how to build a production-ready message streaming ser
7575
7676
.commitlintrc.json # Conventional commits configuration
7777
78+
observability/
79+
├── prometheus/
80+
│ └── prometheus.yml # Prometheus scrape configuration
81+
└── grafana/
82+
└── provisioning/
83+
├── datasources/
84+
│ └── datasources.yml # Prometheus datasource
85+
└── dashboards/
86+
├── dashboards.yml # Dashboard provisioning
87+
└── iggy-overview.json # Pre-built Iggy dashboard
88+
7889
src/
7990
├── main.rs # Application entry point
8091
├── lib.rs # Library exports
@@ -117,8 +128,19 @@ fuzz/
117128
└── fuzz_validation.rs # Validation function fuzz tests
118129
119130
deny.toml # License and security policy for cargo-deny
131+
132+
docs/ # Documentation and guides
133+
├── README.md # Guide index and navigation
134+
├── guide.md # Event-driven architecture guide
135+
├── partitioning-guide.md # Partitioning strategies
136+
├── durable-storage-guide.md # Storage and durability configuration
137+
└── structured-concurrency.md # Task lifecycle management
120138
```
121139

140+
## Documentation
141+
142+
See the [docs/](docs/) directory for comprehensive guides covering event-driven architecture, partitioning strategies, durable storage configuration, and more.
143+
122144
## API Endpoints
123145

124146
### Health & Status
@@ -247,6 +269,81 @@ RUST_LOG=debug
247269
RUST_LOG=trace
248270
```
249271

272+
## Observability Stack
273+
274+
The project includes a complete Grafana-based observability stack for monitoring Iggy and the sample application.
275+
276+
### Components
277+
278+
| Service | Port | Description |
279+
|---------|------|-------------|
280+
| **Iggy** | 3000 | Message streaming server (also serves `/metrics`) |
281+
| **Iggy Web UI** | 3050 | Dashboard for streams, topics, messages, and users |
282+
| **Prometheus** | 9090 | Metrics collection and storage |
283+
| **Grafana** | 3001 | Visualization and dashboards |
284+
285+
### Quick Start with Observability
286+
287+
```bash
288+
# Start the full stack (Iggy + Prometheus + Grafana)
289+
docker-compose up -d
290+
291+
# Access the services:
292+
# - Iggy HTTP API: http://localhost:3000
293+
# - Iggy Web UI: http://localhost:3050 (iggy/iggy)
294+
# - Prometheus: http://localhost:9090
295+
# - Grafana: http://localhost:3001 (admin/admin)
296+
```
297+
298+
### Iggy Web UI
299+
300+
The Iggy Web UI provides a comprehensive dashboard for managing the Iggy server:
301+
302+
- **Streams & Topics**: Create, browse, and delete streams and topics
303+
- **Messages**: Browse and inspect messages in topics
304+
- **Users**: Manage users and permissions
305+
- **Server Health**: Monitor server status and connections
306+
307+
Access at http://localhost:3050 with credentials `iggy/iggy`.
308+
309+
### Grafana Dashboards
310+
311+
Pre-configured dashboards are automatically provisioned:
312+
313+
- **Iggy Overview**: Server status, request rates, message throughput, latency percentiles
314+
315+
### Prometheus Metrics
316+
317+
Iggy exposes Prometheus-compatible metrics at `/metrics`:
318+
319+
```bash
320+
# View raw metrics
321+
curl http://localhost:3000/metrics
322+
```
323+
324+
### Customizing Dashboards
325+
326+
1. Log into Grafana at http://localhost:3001
327+
2. Navigate to Dashboards → Iggy folder
328+
3. Edit existing dashboards or create new ones
329+
4. Export JSON and save to `observability/grafana/provisioning/dashboards/`
330+
331+
### Adding OpenTelemetry (Optional)
332+
333+
Iggy supports OpenTelemetry for distributed tracing. Add to docker-compose:
334+
335+
```yaml
336+
environment:
337+
- IGGY_TELEMETRY_ENABLED=true
338+
- IGGY_TELEMETRY_SERVICE_NAME=iggy
339+
- IGGY_TELEMETRY_LOGS_TRANSPORT=grpc
340+
- IGGY_TELEMETRY_LOGS_ENDPOINT=http://otel-collector:4317
341+
- IGGY_TELEMETRY_TRACES_TRANSPORT=grpc
342+
- IGGY_TELEMETRY_TRACES_ENDPOINT=http://otel-collector:4317
343+
```
344+
345+
---
346+
250347
## Development
251348
252349
### Prerequisites
@@ -255,9 +352,9 @@ RUST_LOG=trace
255352
256353
### Quick Start
257354
258-
1. Start Iggy server:
355+
1. Start Iggy server (with observability):
259356
```bash
260-
docker-compose up -d iggy
357+
docker-compose up -d iggy prometheus grafana
261358
```
262359

263360
2. Run the application:

Cargo.lock

Lines changed: 23 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)