Architecture
Detailed architecture of the Rhesis tracing system.
Component Architecture
SDK Components
OpenTelemetry Integration
The SDK wraps standard OpenTelemetry components:
Decorator Flow
When a decorated function executes:
OTLP Exporter
The custom exporter sends spans via HTTP POST:
Backend Components
Ingestion Endpoint
The /telemetry/traces endpoint:
- Validates the OTLP JSON payload
- Extracts organization/project from API key
- Stores spans in PostgreSQL (bulk insert)
- Enqueues enrichment (async) or runs sync
- Triggers trace linking
Linking Service
The linking service connects traces to test results using a hybrid strategy:
Enrichment Service
Enrichment calculates costs and detects anomalies:
Enrichment Strategy
Async-First with Graceful Fallback
Benefits:
- ✅ Production optimal (async)
- ✅ Development simple (no workers needed)
- ✅ Automatic detection (no config)
- ✅ Graceful degradation (workers crash → sync fallback)
Enrichment Timing
| Mode | Ingestion | Enrichment | Query |
|---|---|---|---|
| Async (production) | ~10ms | Background (~50-100ms) | ~10ms |
| Sync (development) | ~60-110ms | Inline | ~10ms |
Both modes produce the same result, just different timing.