a-ariff / a-ariff/rust-selfhost-server
Add Prometheus metrics integration
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Integrate Prometheus metrics with request counts, response times, error rates, and system metrics. Add /metrics endpoint and Grafana dashboard examples.
Acceptance Criteria
- Add Prometheus metrics library to Cargo.toml dependencies
- Implement metrics collection for:
- HTTP request count by method and status code
- Request duration/response times (histogram)
- Active connection count
- Error rates by endpoint
- System metrics (CPU, memory usage)
- Create
/metricsendpoint that exposes metrics in Prometheus format - Add middleware to automatically collect HTTP metrics
- Include example Grafana dashboard configuration
- Document metrics collection and monitoring setup
- Add Docker Compose configuration for local Prometheus/Grafana stack
- Ensure metrics collection has minimal performance impact
Technical Notes
- Use
prometheuscrate for metrics collection - Consider using
metricscrate as abstraction layer - Implement proper error handling for metrics collection
- Add configuration options to enable/disable specific metric types
- Follow Prometheus naming conventions for metrics
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting Cargo.toml and the server's HTTP entry points to understand the existing Rust request handling. Then determine where middleware and the /metrics endpoint belong, and review the Prometheus and Grafana configuration requirements. Done means the requested metrics, endpoint, dashboard example, documentation, Docker Compose stack, and configuration options are implemented with tests or verification for the acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, grafana, prometheus, rust
- Domain
- api, backend, devops, documentation, observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100