-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
area/apiAPI endpointsAPI endpointsphase/1-testnetPhase 1: TestnetPhase 1: Testnetpriority/mediumMedium priorityMedium prioritytype/featureFeatureFeature
Description
Context
Phase 1 requires telemetry collection for bug reports and performance monitoring during testnet. This fulfills the Phase 1 deliverable: "Gather telemetry, bug reports, and performance data".
Scope
- Collect API request metrics (count, latency, errors)
- Collect identity operation metrics (creation, login, recovery)
- Collect DHT operation metrics (success rate, latency)
- Store metrics in-memory with configurable retention
- Endpoint:
GET /api/v1/metrics - Prometheus-compatible metrics format
Dependencies
None - independent feature
Development Setup
Starting branch: feature/sid-integration (contains latest SID work)
Recommended workflow:
# Clone and checkout base branch
git checkout feature/sid-integration
git pull origin feature/sid-integration
# Create feature branch for this work
git checkout -b feature/telemetry
# Work on implementation
# When done, push and create PR to merge back to feature/sid-integration
git push origin feature/telemetryAcceptance Criteria
- API request counters by endpoint
- Latency histograms (p50, p95, p99)
- Error rate tracking by endpoint
- Identity operations tracked (creates, logins, recoveries)
- DHT operation success/failure rates
- Metrics endpoint returns Prometheus format
- In-memory storage with 24h retention
- Unit tests for metric collection
- Documentation on available metrics
Technical Notes
- Use prometheus client library
- Metrics: http_requests_total, http_request_duration_seconds, identity_operations_total, dht_operations_total
- Keep metrics lightweight (no PII in labels)
- Support for external monitoring systems (Grafana, etc.)
- API handlers location: zhtp/zhtp/src/api/handlers/
Metadata
Metadata
Assignees
Labels
area/apiAPI endpointsAPI endpointsphase/1-testnetPhase 1: TestnetPhase 1: Testnetpriority/mediumMedium priorityMedium prioritytype/featureFeatureFeature